public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/6] RISC-V kasan rework
@ 2023-01-23 10:09 Alexandre Ghiti
  2023-01-23 10:09 ` [PATCH v2 1/6] riscv: Split early and final KASAN population functions Alexandre Ghiti
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Alexandre Ghiti @ 2023-01-23 10:09 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou, Andrey Ryabinin,
	Alexander Potapenko, Andrey Konovalov, Dmitry Vyukov,
	Vincenzo Frascino, Ard Biesheuvel, linux-riscv, linux-kernel,
	kasan-dev, linux-efi
  Cc: Alexandre Ghiti

As described in patch 2, our current kasan implementation is intricate,
so I tried to simplify the implementation and mimic what arm64/x86 are
doing.

In addition it fixes UEFI bootflow with a kasan kernel and kasan inline
instrumentation: all kasan configurations were tested on a large ubuntu
kernel with success with KASAN_KUNIT_TEST and KASAN_MODULE_TEST.

inline ubuntu config + uefi:
 sv39: OK
 sv48: OK
 sv57: OK

outline ubuntu config + uefi:
 sv39: OK
 sv48: OK
 sv57: OK

Actually 1 test always fails with KASAN_KUNIT_TEST that I have to check:
# kasan_bitops_generic: EXPECTATION FAILED at mm/kasan/kasan__test.c:1020
KASAN failure expected in "set_bit(nr, addr)", but none occurrred

Note that Palmer recently proposed to remove COMMAND_LINE_SIZE from the
userspace abi
https://lore.kernel.org/lkml/20221211061358.28035-1-palmer@rivosinc.com/T/
so that we can finally increase the command line to fit all kasan kernel
parameters.

All of this should hopefully fix the syzkaller riscv build that has been
failing for a few months now, any test is appreciated and if I can help
in any way, please ask.

v2:
- Rebase on top of v6.2-rc3
- patch 4 is now way simpler than it used to be since Ard already moved
  the string functions into the efistub.

Alexandre Ghiti (6):
  riscv: Split early and final KASAN population functions
  riscv: Rework kasan population functions
  riscv: Move DTB_EARLY_BASE_VA to the kernel address space
  riscv: Fix EFI stub usage of KASAN instrumented strcmp function
  riscv: Fix ptdump when KASAN is enabled
  riscv: Unconditionnally select KASAN_VMALLOC if KASAN

 arch/riscv/Kconfig             |   1 +
 arch/riscv/kernel/image-vars.h |   2 -
 arch/riscv/mm/init.c           |   2 +-
 arch/riscv/mm/kasan_init.c     | 516 ++++++++++++++++++---------------
 arch/riscv/mm/ptdump.c         |  24 +-
 5 files changed, 298 insertions(+), 247 deletions(-)

-- 
2.37.2


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-01-24  8:00 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-23 10:09 [PATCH v2 0/6] RISC-V kasan rework Alexandre Ghiti
2023-01-23 10:09 ` [PATCH v2 1/6] riscv: Split early and final KASAN population functions Alexandre Ghiti
2023-01-23 22:15   ` Conor Dooley
2023-01-24  8:00     ` Alexandre Ghiti
2023-01-23 10:09 ` [PATCH v2 2/6] riscv: Rework kasan " Alexandre Ghiti
2023-01-23 10:09 ` [PATCH v2 3/6] riscv: Move DTB_EARLY_BASE_VA to the kernel address space Alexandre Ghiti
2023-01-23 10:09 ` [PATCH v2 4/6] riscv: Fix EFI stub usage of KASAN instrumented strcmp function Alexandre Ghiti
2023-01-23 10:19   ` Ard Biesheuvel
2023-01-23 10:09 ` [PATCH v2 5/6] riscv: Fix ptdump when KASAN is enabled Alexandre Ghiti
2023-01-23 10:09 ` [PATCH v2 6/6] riscv: Unconditionnally select KASAN_VMALLOC if KASAN Alexandre Ghiti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox