Re: [tip: x86/bugs] x86/retpoline: Ensure default return thunk isn't used at runtime

From: Borislav Petkov
Date: Fri Feb 16 2024 - 16:28:18 EST


On Thu, Feb 15, 2024 at 09:42:35PM -0800, Josh Poimboeuf wrote:
> Right, the good news is this isn't a regression and the warning is
> working as designed.
>
> This should tell the build to invoke objtool on that file:
>
> diff --git a/arch/x86/entry/vdso/Makefile b/arch/x86/entry/vdso/Makefile
> index b1b8dd1608f7..92d67379f570 100644
> --- a/arch/x86/entry/vdso/Makefile
> +++ b/arch/x86/entry/vdso/Makefile
> @@ -36,6 +36,7 @@ UBSAN_SANITIZE_vma.o := y
> KCSAN_SANITIZE_vma.o := y
> OBJECT_FILES_NON_STANDARD_vma.o := n
> OBJECT_FILES_NON_STANDARD_extable.o := n
> +OBJECT_FILES_NON_STANDARD_vdso-image-64.o := n

Right, this should be:

diff --git a/arch/x86/entry/vdso/Makefile b/arch/x86/entry/vdso/Makefile
index c4df99aa1615..4a514cafd73e 100644
--- a/arch/x86/entry/vdso/Makefile
+++ b/arch/x86/entry/vdso/Makefile
@@ -36,6 +36,8 @@ UBSAN_SANITIZE_vma.o := y
KCSAN_SANITIZE_vma.o := y
OBJECT_FILES_NON_STANDARD_vma.o := n
OBJECT_FILES_NON_STANDARD_extable.o := n
+OBJECT_FILES_NON_STANDARD_vdso-image-32.o := n
+OBJECT_FILES_NON_STANDARD_vdso-image-64.o := n

# vDSO images to build
vdso_img-$(VDSO64-y) += 64

for completeness.

Lemme know if you want to write a formal patch or I should.

If you do, please make sure to include the exact way to reproduce
because we might need it in the future.

Thx.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette