]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
riscv: vdso: Prevent the compiler from inserting calls to memset()
authorAlexandre Ghiti <alexghiti@rivosinc.com>
Wed, 16 Oct 2024 08:36:24 +0000 (10:36 +0200)
committerPalmer Dabbelt <palmer@rivosinc.com>
Thu, 24 Oct 2024 17:52:52 +0000 (10:52 -0700)
The compiler is smart enough to insert a call to memset() in
riscv_vdso_get_cpus(), which generates a dynamic relocation.

So prevent this by using -fno-builtin option.

Fixes: e2c0cdfba7f6 ("RISC-V: User-facing API")
Cc: stable@vger.kernel.org
Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Reviewed-by: Guo Ren <guoren@kernel.org>
Link: https://lore.kernel.org/r/20241016083625.136311-2-alexghiti@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/kernel/vdso/Makefile

index 960feb1526caa00488726f2a5dfcd16143ba6c91..3f1c4b2d0b0642b90ce9d18994fc6fc966235c24 100644 (file)
@@ -18,6 +18,7 @@ obj-vdso = $(patsubst %, %.o, $(vdso-syms)) note.o
 
 ccflags-y := -fno-stack-protector
 ccflags-y += -DDISABLE_BRANCH_PROFILING
+ccflags-y += -fno-builtin
 
 ifneq ($(c-gettimeofday-y),)
   CFLAGS_vgettimeofday.o += -fPIC -include $(c-gettimeofday-y)