bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/9] riscv: improve self-protection
@ 2021-03-31 16:24 Jisheng Zhang
  2021-03-31 16:25 ` [PATCH v2 1/9] riscv: add __init section marker to some functions Jisheng Zhang
                   ` (8 more replies)
  0 siblings, 9 replies; 18+ messages in thread
From: Jisheng Zhang @ 2021-03-31 16:24 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou, Andrey Ryabinin,
	Alexander Potapenko, Andrey Konovalov, Dmitry Vyukov,
	 Björn Töpel, Alexei Starovoitov, Daniel Borkmann,
	Andrii Nakryiko, Song Liu, Yonghong Song, John Fastabend,
	KP Singh, Luke Nelson, Xi Wang
  Cc: linux-riscv, linux-kernel, kasan-dev, netdev, bpf

From: Jisheng Zhang <jszhang@kernel.org>

patch1 is a trivial improvement patch to move some functions to .init
section

Then following patches improve self-protection by:

Marking some variables __ro_after_init
Constifing some variables
Enabling ARCH_HAS_STRICT_MODULE_RWX


Since v1:
  - no need to move bpf_jit_alloc_exec() and bpf_jit_free_exec() to core
    because RV32 uses the default module_alloc() for jit code which also
    meets W^X after patch8
  - fix a build error caused by local debug code clean up

Jisheng Zhang (9):
  riscv: add __init section marker to some functions
  riscv: Mark some global variables __ro_after_init
  riscv: Constify sys_call_table
  riscv: Constify sbi_ipi_ops
  riscv: kprobes: Implement alloc_insn_page()
  riscv: bpf: Write protect JIT code
  riscv: bpf: Avoid breaking W^X on RV64
  riscv: module: Create module allocations without exec permissions
  riscv: Set ARCH_HAS_STRICT_MODULE_RWX if MMU

 arch/riscv/Kconfig                 |  1 +
 arch/riscv/include/asm/smp.h       |  4 ++--
 arch/riscv/include/asm/syscall.h   |  2 +-
 arch/riscv/kernel/module.c         | 10 ++++++++--
 arch/riscv/kernel/probes/kprobes.c |  8 ++++++++
 arch/riscv/kernel/sbi.c            | 10 +++++-----
 arch/riscv/kernel/smp.c            |  6 +++---
 arch/riscv/kernel/syscall_table.c  |  2 +-
 arch/riscv/kernel/time.c           |  2 +-
 arch/riscv/kernel/traps.c          |  2 +-
 arch/riscv/kernel/vdso.c           |  4 ++--
 arch/riscv/mm/init.c               | 12 ++++++------
 arch/riscv/mm/kasan_init.c         |  6 +++---
 arch/riscv/mm/ptdump.c             |  2 +-
 arch/riscv/net/bpf_jit_comp64.c    |  2 +-
 arch/riscv/net/bpf_jit_core.c      |  1 +
 16 files changed, 45 insertions(+), 29 deletions(-)

-- 
2.31.0



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

end of thread, other threads:[~2021-04-12  5:37 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-31 16:24 [PATCH v2 0/9] riscv: improve self-protection Jisheng Zhang
2021-03-31 16:25 ` [PATCH v2 1/9] riscv: add __init section marker to some functions Jisheng Zhang
2021-04-02  4:08   ` Anup Patel
2021-04-12  5:37     ` Jisheng Zhang
2021-03-31 16:25 ` [PATCH v2 2/9] riscv: Mark some global variables __ro_after_init Jisheng Zhang
2021-04-02  4:09   ` Anup Patel
2021-03-31 16:26 ` [PATCH v2 3/9] riscv: Constify sys_call_table Jisheng Zhang
2021-04-02  4:11   ` Anup Patel
2021-03-31 16:26 ` [PATCH v2 4/9] riscv: Constify sbi_ipi_ops Jisheng Zhang
2021-04-02  4:12   ` Anup Patel
2021-03-31 16:27 ` [PATCH v2 5/9] riscv: kprobes: Implement alloc_insn_page() Jisheng Zhang
2021-04-02  4:16   ` Anup Patel
2021-03-31 16:27 ` [PATCH v2 6/9] riscv: bpf: Write protect JIT code Jisheng Zhang
2021-03-31 16:28 ` [PATCH v2 7/9] riscv: bpf: Avoid breaking W^X on RV64 Jisheng Zhang
2021-03-31 16:29 ` [PATCH v2 8/9] riscv: module: Create module allocations without exec permissions Jisheng Zhang
2021-04-02  4:18   ` Anup Patel
2021-03-31 16:29 ` [PATCH v2 9/9] riscv: Set ARCH_HAS_STRICT_MODULE_RWX if MMU Jisheng Zhang
2021-04-02  4:14   ` Anup Patel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).