Skip to contentSkip to conversation

riscv: disable stack-protector for vDSO

PATCH In review Tobias Klauser 2 participants 2 messages Jul 29, 2020 – Jul 31, 2020 RISC-V

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 riscv: disable stack-protector for vDSO

Currently, building the vDSO with clang leads assembler errors like the following:

/tmp/vgettimeofday-1ae0d2.s: Assembler messages:
/tmp/vgettimeofday-1ae0d2.s:28: Error: bad expression /tmp/vgettimeofday-1ae0d2.s:28: Error: illegal operands `auipc a2,%got_pcrel_hi(__stack_chk_guard)'

Disable the stack-protector for vDSO to fix these.

---
 arch/riscv/kernel/vdso/Makefile | 2 ++
 1 file changed, 2 insertions(+)
arch/riscv/kernel/vdso/Makefile +2 -0
index c8c9e40023c6..478e7338ddc1 100644
@@ -16,6 +16,8 @@ vdso-syms += flush_icache
 # Files to link into the vdso
 obj-vdso = $(patsubst %, %.o, $(vdso-syms)) note.o
 
+ccflags-y := -fno-stack-protector
+
 ifneq ($(c-gettimeofday-y),)
   CFLAGS_vgettimeofday.o += -fPIC -include $(c-gettimeofday-y)
 endif
Signature · 7 lines
2.27.0


_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
maintainer
#1 lore raw
Quoted 20 lines · On Wed, 29 Jul 2020 00:51:29 PDT (-0700), [email protected] wrote:

Currently, building the vDSO with clang leads assembler errors like the following:

/tmp/vgettimeofday-1ae0d2.s: Assembler messages:
/tmp/vgettimeofday-1ae0d2.s:28: Error: bad expression /tmp/vgettimeofday-1ae0d2.s:28: Error: illegal operands `auipc a2,%got_pcrel_hi(__stack_chk_guard)'

Disable the stack-protector for vDSO to fix these.

---
 arch/riscv/kernel/vdso/Makefile | 2 ++
 1 file changed, 2 insertions(+)
arch/riscv/kernel/vdso/Makefile +0 -0
index c8c9e40023c6..478e7338ddc1 100644

arch/riscv/kernel/vdso/Makefile vdso-syms += flush_icache · line 23

Quoted 8 lines
arch/riscv/kernel/vdso/Makefile +2 -0
@@ -16,6 +16,8 @@ vdso-syms += flush_icache
 # Files to link into the vdso
 obj-vdso = $(patsubst %, %.o, $(vdso-syms)) note.o
 
+ccflags-y := -fno-stack-protector
+
 ifneq ($(c-gettimeofday-y),)
   CFLAGS_vgettimeofday.o += -fPIC -include $(c-gettimeofday-y)
 endif

Thanks, this is on fixes.

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv