linux/arch/riscv/mm
Xiaofeng Yuan bdc46e507b riscv: mm: make EXECMEM_KPROBES writable without CONFIG_STRICT_MODULE_RWX
When CONFIG_STRICT_MODULE_RWX is not set, execmem cannot create
temporary writable mappings for read-only executable pages. In this
case, the execmem ranges must already have writable permissions.

Currently EXECMEM_KPROBES unconditionally uses PAGE_KERNEL_READ_EXEC,
which causes kprobe instruction slot writes to trigger page faults
on systems where CONFIG_STRICT_MODULE_RWX is not enabled.

Fix this by using PAGE_KERNEL_EXEC when CONFIG_STRICT_MODULE_RWX
is not available.

Signed-off-by: Xiaofeng Yuan <xiaofengmian@163.com>
Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Nam Cao <namcao@linutronix.de>
Link: https://patch.msgid.link/20260814082742.148403-2-xiaofengmian@163.com
Signed-off-by: Paul Walmsley <pjw@kernel.org>
2026-08-31 19:11:22 -06:00
..
cache-ops.c riscv: split cache ops out of dma-noncoherent.c 2023-11-07 09:37:42 -08:00
cacheflush.c riscv: fix various typos in comments and code 2026-04-04 18:42:39 -06:00
context.c riscv: Fix a comment typo in set_mm_asid() 2025-03-18 13:02:47 +00:00
dma-noncoherent.c driver core: Replace dev->dma_coherent with dev_dma_coherent() 2026-04-26 23:43:58 +02:00
extable.c riscv: select DCACHE_WORD_ACCESS for efficient unaligned access HW 2024-01-09 20:18:20 -08:00
fault.c riscv: mm: Add page fault trace points 2025-07-09 15:27:01 -04:00
hugetlbpage.c mm, arch: consolidate hugetlb CMA reservation 2026-01-26 20:02:19 -08:00
init.c riscv: mm: make EXECMEM_KPROBES writable without CONFIG_STRICT_MODULE_RWX 2026-08-31 19:11:22 -06:00
kasan_init.c riscv: remove unreachable invalid range check in kasan_init() 2026-07-01 09:22:40 +03:00
Makefile mm: rename GENERIC_PTDUMP and PTDUMP_CORE 2025-03-17 00:05:32 -07:00
pageattr.c mm/pagewalk: split walk_page_range_novma() into kernel/user parts 2025-07-09 22:42:05 -07:00
pgtable.c mm: change to return bool for ptep_test_and_clear_young() 2026-04-05 13:53:35 -07:00
physaddr.c riscv: fix various typos in comments and code 2026-04-04 18:42:39 -06:00
pmem.c RISC-V: capitalise CMO op macros 2023-11-05 09:11:23 -08:00
ptdump.c riscv: ptdump: Replace unbounded sprintf() in dump_prot() 2026-06-06 20:17:52 -06:00
tlbflush.c riscv: mm: Apply Svinval in update_mmu_cache() 2026-08-07 19:24:29 -06:00