Skip to content

Commit ce16531

Browse files
Merge patch series "Prevent dynamic relocations in vDSO"
The first is a fix and the second a check to make sure we don't regress on the relocations, so I'm picking this up as a series to get the fix into fixes. * b4-shazam-merge: riscv: Check that vdso does not contain any dynamic relocations riscv: vdso: Prevent the compiler from inserting calls to memset() Link: https://lore.kernel.org/r/20241016083625.136311-1-alexghiti@rivosinc.com Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
2 parents 18efe86 + c6898d6 commit ce16531

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

arch/riscv/kernel/vdso/Makefile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ obj-vdso = $(patsubst %, %.o, $(vdso-syms)) note.o
1818

1919
ccflags-y := -fno-stack-protector
2020
ccflags-y += -DDISABLE_BRANCH_PROFILING
21+
ccflags-y += -fno-builtin
2122

2223
ifneq ($(c-gettimeofday-y),)
2324
CFLAGS_vgettimeofday.o += -fPIC -include $(c-gettimeofday-y)
@@ -44,7 +45,7 @@ $(obj)/vdso.o: $(obj)/vdso.so
4445

4546
# link rule for the .so file, .lds has to be first
4647
$(obj)/vdso.so.dbg: $(obj)/vdso.lds $(obj-vdso) FORCE
47-
$(call if_changed,vdsold)
48+
$(call if_changed,vdsold_and_check)
4849
LDFLAGS_vdso.so.dbg = -shared -soname=linux-vdso.so.1 \
4950
--build-id=sha1 --hash-style=both --eh-frame-hdr
5051

@@ -64,7 +65,8 @@ include/generated/vdso-offsets.h: $(obj)/vdso.so.dbg FORCE
6465
# actual build commands
6566
# The DSO images are built using a special linker script
6667
# Make sure only to export the intended __vdso_xxx symbol offsets.
67-
quiet_cmd_vdsold = VDSOLD $@
68-
cmd_vdsold = $(LD) $(ld_flags) -T $(filter-out FORCE,$^) -o $@.tmp && \
68+
quiet_cmd_vdsold_and_check = VDSOLD $@
69+
cmd_vdsold_and_check = $(LD) $(ld_flags) -T $(filter-out FORCE,$^) -o $@.tmp && \
6970
$(OBJCOPY) $(patsubst %, -G __vdso_%, $(vdso-syms)) $@.tmp $@ && \
70-
rm $@.tmp
71+
rm $@.tmp && \
72+
$(cmd_vdso_check)

0 commit comments

Comments
 (0)