diff mbox series

[v2,2/2] arm64: vdso: enable orphan handling for VDSO

Message ID 20220407101304.539-3-joey.gouly@arm.com (mailing list archive)
State New, archived
Headers show
Series Enable orphan-handling=warn for VDSO | expand

Commit Message

Joey Gouly April 7, 2022, 10:13 a.m. UTC
Like vmlinux, enable orphan-handling for the VDSO. This can catch
subtle errors that might arise from unexpected sections being included.

Signed-off-by: Joey Gouly <joey.gouly@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Masahiro Yamada <masahiroy@kernel.org>
Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>
Cc: Kees Cook <keescook@chromium.org>
---
 arch/arm64/kernel/vdso/Makefile | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Comments

Kees Cook April 7, 2022, 4:49 p.m. UTC | #1
On Thu, Apr 07, 2022 at 11:13:04AM +0100, Joey Gouly wrote:
> Like vmlinux, enable orphan-handling for the VDSO. This can catch
> subtle errors that might arise from unexpected sections being included.
> 
> Signed-off-by: Joey Gouly <joey.gouly@arm.com>

Reviewed-by: Kees Cook <keescook@chromium.org>
Vincenzo Frascino April 8, 2022, 7:20 a.m. UTC | #2
On 4/7/22 11:13 AM, Joey Gouly wrote:
> Like vmlinux, enable orphan-handling for the VDSO. This can catch
> subtle errors that might arise from unexpected sections being included.
> 
> Signed-off-by: Joey Gouly <joey.gouly@arm.com>

Reviewed-by: Vincenzo Frascino <vincenzo.frascino@arm.com>

> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will@kernel.org>
> Cc: Masahiro Yamada <masahiroy@kernel.org>
> Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>
> Cc: Kees Cook <keescook@chromium.org>
> ---
>  arch/arm64/kernel/vdso/Makefile | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/kernel/vdso/Makefile b/arch/arm64/kernel/vdso/Makefile
> index 172452f79e46..623d9ad2c717 100644
> --- a/arch/arm64/kernel/vdso/Makefile
> +++ b/arch/arm64/kernel/vdso/Makefile
> @@ -24,7 +24,13 @@ btildflags-$(CONFIG_ARM64_BTI_KERNEL) += -z force-bti
>  # routines, as x86 does (see 6f121e548f83 ("x86, vdso: Reimplement vdso.so
>  # preparation in build-time C")).
>  ldflags-y := -shared -soname=linux-vdso.so.1 --hash-style=sysv	\
> -	     -Bsymbolic --build-id=sha1 -n $(btildflags-y) -T
> +	     -Bsymbolic --build-id=sha1 -n $(btildflags-y)
> +
> +ifdef CONFIG_LD_ORPHAN_WARN
> +  ldflags-y += --orphan-handling=warn
> +endif
> +
> +ldflags-y += -T
>  
>  ccflags-y := -fno-common -fno-builtin -fno-stack-protector -ffixed-x18
>  ccflags-y += -DDISABLE_BRANCH_PROFILING -DBUILD_VDSO
diff mbox series

Patch

diff --git a/arch/arm64/kernel/vdso/Makefile b/arch/arm64/kernel/vdso/Makefile
index 172452f79e46..623d9ad2c717 100644
--- a/arch/arm64/kernel/vdso/Makefile
+++ b/arch/arm64/kernel/vdso/Makefile
@@ -24,7 +24,13 @@  btildflags-$(CONFIG_ARM64_BTI_KERNEL) += -z force-bti
 # routines, as x86 does (see 6f121e548f83 ("x86, vdso: Reimplement vdso.so
 # preparation in build-time C")).
 ldflags-y := -shared -soname=linux-vdso.so.1 --hash-style=sysv	\
-	     -Bsymbolic --build-id=sha1 -n $(btildflags-y) -T
+	     -Bsymbolic --build-id=sha1 -n $(btildflags-y)
+
+ifdef CONFIG_LD_ORPHAN_WARN
+  ldflags-y += --orphan-handling=warn
+endif
+
+ldflags-y += -T
 
 ccflags-y := -fno-common -fno-builtin -fno-stack-protector -ffixed-x18
 ccflags-y += -DDISABLE_BRANCH_PROFILING -DBUILD_VDSO