Skip to content

Commit f3d60f2

Browse files
tklauserpalmer-dabbelt
authored andcommitted
riscv: Disable KSAN_SANITIZE for vDSO
We use the generic C VDSO implementations of a handful of clock-related functions. When kasan is enabled this results in asan stub calls that are unlikely to be resolved by userspace, this just disables KASAN when building the VDSO. Verified the fix on a kernel with KASAN enabled using vDSO selftests. Link: https://lore.kernel.org/lkml/CACT4Y+ZNJBnkKHXUf=tm_yuowvZvHwN=0rmJ=7J+xFd+9r_6pQ@mail.gmail.com/ Tested-by: Tobias Klauser <tklauser@distanz.ch> Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Tested-by: Dmitry Vyukov <dvyukov@google.com> [Palmer: commit text] Fixes: ad5d112 ("riscv: use vDSO common flow to reduce the latency of the time-related functions") Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
1 parent cc937ca commit f3d60f2

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎arch/riscv/kernel/vdso/Makefile‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@ CPPFLAGS_vdso.lds += -P -C -U$(ARCH)
3232
# Disable -pg to prevent insert call site
3333
CFLAGS_REMOVE_vgettimeofday.o = $(CC_FLAGS_FTRACE) -Os
3434

35-
# Disable gcov profiling for VDSO code
35+
# Disable profiling and instrumentation for VDSO code
3636
GCOV_PROFILE := n
3737
KCOV_INSTRUMENT := n
38+
KASAN_SANITIZE := n
3839

3940
# Force dependency
4041
$(obj)/vdso.o: $(obj)/vdso.so

0 commit comments

Comments
 (0)