[PATCH AUTOSEL 5.4 10/15] sparc: vdso: Disable UBSAN instrumentation

From: Sasha Levin
Date: Fri Mar 29 2024 - 09:25:07 EST


From: Kees Cook <keescook@xxxxxxxxxxxx>

[ Upstream commit d4be85d068b4418c341f79b654399f7f0891069a ]

The UBSAN instrumentation cannot work in the vDSO since it is executing
in userspace, so disable it in the Makefile. Fixes the build failures
such as:

arch/sparc/vdso/vclock_gettime.c:217: undefined reference to `__ubsan_handle_shift_out_of_bounds'

Acked-by: Sam Ravnborg <sam@xxxxxxxxxxxx>
Link: https://lore.kernel.org/all/20240224073617.GA2959352@xxxxxxxxxxxx
Signed-off-by: Kees Cook <keescook@xxxxxxxxxxxx>
Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
---
arch/sparc/vdso/Makefile | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/sparc/vdso/Makefile b/arch/sparc/vdso/Makefile
index 997ffe46e953a..5b869c2c84363 100644
--- a/arch/sparc/vdso/Makefile
+++ b/arch/sparc/vdso/Makefile
@@ -2,6 +2,7 @@
#
# Building vDSO images for sparc.
#
+UBSAN_SANITIZE := n

KBUILD_CFLAGS += $(DISABLE_LTO)

--
2.43.0