riscv: Disable KSAN_SANITIZE for vDSO
PATCH 1/1 riscv: Disable KSAN_SANITIZE for vDSO
Dmitry Vyukov reports:
Quoted 5 lines
I've localized one issue with riscv/KASAN:
KASAN breaks VDSO and that's I think the root cause of weird faults I saw earlier. The following patch fixes it.
Could somebody please upstream this fix? I don't know how to add/run tests for this.
Verified the fix on a kernel with KASAN enabled using vDSO selftests.
--- arch/riscv/kernel/vdso/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/riscv/kernel/vdso/Makefile +2 -1
@@ -32,9 +32,10 @@ CPPFLAGS_vdso.lds += -P -C -U$(ARCH) # Disable -pg to prevent insert call site CFLAGS_REMOVE_vgettimeofday.o = $(CC_FLAGS_FTRACE) -Os -# Disable gcov profiling for VDSO code +# Disable profiling and instrumentation for VDSO code GCOV_PROFILE := n KCOV_INSTRUMENT := n +KASAN_SANITIZE := n # Force dependency $(obj)/vdso.o: $(obj)/vdso.so
Signature · 7 lines
2.30.0 _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv
Quoted 8 lines · Tobias Klauser
Dmitry Vyukov reports:
Quoted 5 lines
I've localized one issue with riscv/KASAN:
KASAN breaks VDSO and that's I think the root cause of weird faults I saw earlier. The following patch fixes it.
Could somebody please upstream this fix? I don't know how to add/run tests for this.
Quoted 6 lines
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/ open hereCc Dmitry Vyukov <[email protected]>Tested-by Tobias Klauser <[email protected]>Signed-off-by Tobias Klauser <[email protected]>
Thanks for the quick fix!
Quoted 21 lines
--- arch/riscv/kernel/vdso/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)arch/riscv/kernel/vdso/Makefile +2
-2@@ -32,9 +32,10 @@ CPPFLAGS_vdso.lds += -P -C -U$(ARCH) # Disable -pg to prevent insert call site CFLAGS_REMOVE_vgettimeofday.o = $(CC_FLAGS_FTRACE) -Os -# Disable gcov profiling for VDSO code +# Disable profiling and instrumentation for VDSO code GCOV_PROFILE := n KCOV_INSTRUMENT := n +KASAN_SANITIZE := n # Force dependency $(obj)/vdso.o: $(obj)/vdso.so --
Quoted 2 lines
2.30.0
_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
Palmer Dabbelt
maintainerQuoted 23 lines · On Tue, 16 Feb 2021 09:33:05 PST (-0800), [email protected] wrote:
Dmitry Vyukov reports:
Quoted 5 lines
I've localized one issue with riscv/KASAN:
KASAN breaks VDSO and that's I think the root cause of weird faults I saw earlier. The following patch fixes it.
Could somebody please upstream this fix? I don't know how to add/run tests for this.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/ open hereCc Dmitry Vyukov <[email protected]>Tested-by Tobias Klauser <[email protected]>Signed-off-by Tobias Klauser <[email protected]>--- arch/riscv/kernel/vdso/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)arch/riscv/kernel/vdso/Makefile +0
-0@@ -32,9 +32,10 @@ CPPFLAGS_vdso.lds += -P -C -U$(ARCH) # Disable -pg to prevent insert call site
arch/riscv/kernel/vdso/Makefile CPPFLAGS_vdso.lds += -P -C -U$(ARCH) · line 41
Quoted 10 lines
arch/riscv/kernel/vdso/Makefile +2
-1CFLAGS_REMOVE_vgettimeofday.o = $(CC_FLAGS_FTRACE) -Os -# Disable gcov profiling for VDSO code +# Disable profiling and instrumentation for VDSO code GCOV_PROFILE := n KCOV_INSTRUMENT := n +KASAN_SANITIZE := n # Force dependency $(obj)/vdso.o: $(obj)/vdso.so
This seems reasonable. Building the VDSO with asan results in a bunch of PLT entries for the VDSO stubs. I don't see a sane way to resolve those, and it looks like this is what everyone else is doing.
That said, the commit text is a bit funny so I've written one of my own. This is on for-next, as it's still the merge window. Let me know if the text doesn't make sense.
Thanks!
_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
Quoted 39 lines · Palmer Dabbelt
Quoted 23 lines · On Tue, 16 Feb 2021 09:33:05 PST (-0800), [email protected] wrote:
Dmitry Vyukov reports:
Quoted 5 lines
I've localized one issue with riscv/KASAN:
KASAN breaks VDSO and that's I think the root cause of weird faults I saw earlier. The following patch fixes it.
Could somebody please upstream this fix? I don't know how to add/run tests for this.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/ open hereCc Dmitry Vyukov <[email protected]>Tested-by Tobias Klauser <[email protected]>Signed-off-by Tobias Klauser <[email protected]>--- arch/riscv/kernel/vdso/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)arch/riscv/kernel/vdso/Makefile +0
-0@@ -32,9 +32,10 @@ CPPFLAGS_vdso.lds += -P -C -U$(ARCH) # Disable -pg to prevent insert call sitearch/riscv/kernel/vdso/Makefile CPPFLAGS_vdso.lds += -P -C -U$(ARCH) · line 41
Quoted 10 lines
arch/riscv/kernel/vdso/Makefile +2
-1CFLAGS_REMOVE_vgettimeofday.o = $(CC_FLAGS_FTRACE) -Os -# Disable gcov profiling for VDSO code +# Disable profiling and instrumentation for VDSO code GCOV_PROFILE := n KCOV_INSTRUMENT := n +KASAN_SANITIZE := n # Force dependency $(obj)/vdso.o: $(obj)/vdso.soThis seems reasonable. Building the VDSO with asan results in a bunch of PLT entries for the VDSO stubs. I don't see a sane way to resolve those, and it looks like this is what everyone else is doing.
Quoted 3 lines
That said, the commit text is a bit funny so I've written one of my own. This is on for-next, as it's still the merge window. Let me know if the text doesn't make sense.
Thanks for fixing up the commit message and adding the Fixes line. Makes sense to me.
_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv