Skip to content

RFC Support KASLR for RISC-V

Zong Li linux-riscv lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest8 patches 21 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8riscv/kaslr: add interface to get kaslr offsetarch/riscv/include/asm/page.h+5 -01 reply
2/8riscv/kaslr: introduce functions to clear page tablearch/riscv/mm/init.c+54 -02 replies
3/8riscv/kaslr: support KASLR infrastructurearch/riscv/Kconfig arch/riscv/kernel/Makefile arch/riscv/kernel/head.S +2 more+163 -14 replies
4/8riscv/kaslr: randomize the kernel image offsetarch/riscv/kernel/kaslr.c arch/riscv/mm/init.c+273 -310 replies
5/8riscv/kaslr: support sparse memory modelarch/riscv/kernel/kaslr.c+105 -340 replies
6/8riscv/kaslr: clear the original kernel imagearch/riscv/include/asm/kaslr.h arch/riscv/kernel/kaslr.c arch/riscv/mm/init.c+30 -04 replies
7/8riscv/kaslr: add cmdline support to disable KASLRarch/riscv/kernel/kaslr.c+34 -00 replies
8/8riscv/kaslr: dump out kernel offset information on panicarch/riscv/kernel/setup.c+23 -00 replies

Reviews trailers per patch

1 of 8 patches has a Reviewed-by or Acked-by.

PatchAlexandre Ghiti
1/8R-b
2/8
3/8
4/8
5/8
6/8
7/8
8/8

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH RFC 0/8] Support KASLR for RISC-V

This patch series implement KASLR for RISC-V. It copies kernel image to a proper and random place, and make all harts go to the new destination.

This patch depends on the patch 'riscv: Introduce CONFIG_RELOCATABLE', but given a small change by making PAGE_OFFSET be constant, so all the memory could be available after moving kernel physical address. This patch also depends on 'Support strict kernel memory permissions for security'.

Zong Li (8):
riscv/kaslr: add interface to get kaslr offset riscv/kaslr: introduce functions to clear page table riscv/kaslr: support KASLR infrastructure riscv/kaslr: randomize the kernel image offset riscv/kaslr: support sparse memory model riscv/kaslr: clear the original kernel image riscv/kaslr: add cmdline support to disable KASLR riscv/kaslr: dump out kernel offset information on panic

 arch/riscv/Kconfig             |  15 ++
 arch/riscv/include/asm/kaslr.h |  12 +
 arch/riscv/include/asm/page.h  |   5 +
 arch/riscv/kernel/Makefile     |   2 +
 arch/riscv/kernel/head.S       |  39 +++
 arch/riscv/kernel/kaslr.c      | 442 +++++++++++++++++++++++++++++++++
 arch/riscv/kernel/setup.c      |  23 ++
 arch/riscv/mm/init.c           | 115 ++++++++-
 8 files changed, 651 insertions(+), 2 deletions(-)
 create mode 100644 arch/riscv/include/asm/kaslr.h
 create mode 100644 arch/riscv/kernel/kaslr.c
Signature · 1 line
2.25.1