Skip to contentSkip to conversation

LoongArch: vDSO: Disable UBSAN instrumentation

PATCH Applied Kees Cook 2 participants 2 messages Jan 30, 2024 – Jan 31, 2024 LoongArch

lore
Share & tools
lore

Kees Cook

author
#0 lore raw

PATCH 1/1 LoongArch: vDSO: Disable UBSAN instrumentation

The vDSO executes in userspace, so the kernel's UBSAN should not instrument it. Solves these kind of build errors:

loongarch64-linux-ld: arch/loongarch/vdso/vgettimeofday.o: in function `vdso_shift_ns':
lib/vdso/gettimeofday.c:23:(.text+0x3f8): undefined reference to `__ubsan_handle_shift_out_of_bounds'

---
 arch/loongarch/vdso/Makefile | 1 +
 1 file changed, 1 insertion(+)
arch/loongarch/vdso/Makefile +1 -0
index c74c9921304f..f597cd08a96b 100644
@@ -2,6 +2,7 @@
 # Objects to go into the VDSO.
 
 KASAN_SANITIZE := n
+UBSAN_SANITIZE := n
 KCOV_INSTRUMENT := n
 
 # Include the generic Makefile to check the built vdso.
Signature · 1 line
2.34.1
maintainer Applied
#1 lore raw

Queued, thanks.

Huacai

Quoted 36 lines · Kees Cook

The vDSO executes in userspace, so the kernel's UBSAN should not instrument it. Solves these kind of build errors:

loongarch64-linux-ld: arch/loongarch/vdso/vgettimeofday.o: in function `vdso_shift_ns':
lib/vdso/gettimeofday.c:23:(.text+0x3f8): undefined reference to `__ubsan_handle_shift_out_of_bounds'

---
 arch/loongarch/vdso/Makefile | 1 +
 1 file changed, 1 insertion(+)
arch/loongarch/vdso/Makefile +1 -1
index c74c9921304f..f597cd08a96b 100644
@@ -2,6 +2,7 @@
 # Objects to go into the VDSO.
 
 KASAN_SANITIZE := n
+UBSAN_SANITIZE := n
 KCOV_INSTRUMENT := n
 
 # Include the generic Makefile to check the built vdso.
--

2.34.1