mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Zong Li <zong.li@sifive.com>
To: palmer@dabbelt.com, paul.walmsley@sifive.com, alex@ghiti.fr,
	linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
Cc: Zong Li <zong.li@sifive.com>
Subject: [PATCH RFC 0/8] Support KASLR for RISC-V
Date: Tue, 24 Mar 2020 15:30:45 +0800	[thread overview]
Message-ID: <cover.1584352425.git.zong.li@sifive.com> (raw)

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

-- 
2.25.1


             reply	other threads:[~2020-03-24  7:31 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-24  7:30 Zong Li [this message]
2020-03-24  7:30 ` [PATCH RFC 1/8] riscv/kaslr: add interface to get kaslr offset Zong Li
2020-04-07  5:08   ` Alex Ghiti
2020-03-24  7:30 ` [PATCH RFC 2/8] riscv/kaslr: introduce functions to clear page table Zong Li
2020-04-07  5:09   ` Alex Ghiti
2020-04-07  9:17     ` Zong Li
2020-03-24  7:30 ` [PATCH RFC 3/8] riscv/kaslr: support KASLR infrastructure Zong Li
2020-04-07  5:10   ` Alex Ghiti
2020-04-07 10:34     ` Zong Li
2020-04-09  5:53       ` Alex Ghiti
2020-04-09 11:08         ` Zong Li
2020-03-24  7:30 ` [PATCH RFC 4/8] riscv/kaslr: randomize the kernel image offset Zong Li
2020-04-07  5:11   ` Alex Ghiti
2020-04-07 10:53     ` Zong Li
2020-04-09  5:51       ` Alex Ghiti
2020-04-09 10:31         ` Zong Li
2020-04-10 15:58           ` Alex Ghiti
2020-04-11  8:20             ` Zong Li
2020-04-12  6:53               ` Alex Ghiti
2020-04-14  2:46                 ` Zong Li
2020-04-14  5:43                   ` Alex Ghiti
2020-04-14  7:00                     ` Zong Li
2020-03-24  7:30 ` [PATCH RFC 5/8] riscv/kaslr: support sparse memory model Zong Li
2020-03-24  7:30 ` [PATCH RFC 6/8] riscv/kaslr: clear the original kernel image Zong Li
2020-04-07  5:11   ` Alex Ghiti
2020-04-07 11:18     ` Zong Li
2020-04-09  5:53       ` Alex Ghiti
2020-04-09  8:14         ` Alex Ghiti
2020-03-24  7:30 ` [PATCH RFC 7/8] riscv/kaslr: add cmdline support to disable KASLR Zong Li
2020-03-24  7:30 ` [PATCH RFC 8/8] riscv/kaslr: dump out kernel offset information on panic Zong Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1584352425.git.zong.li@sifive.com \
    --to=zong.li@sifive.com \
    --cc=alex@ghiti.fr \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome