[PW_SID:1130242] riscv: fix kprobes on minimal kernel configs#2318
[PW_SID:1130242] riscv: fix kprobes on minimal kernel configs#2318linux-riscv-bot wants to merge 3 commits into
Conversation
…_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> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Currently patch_map() always creates a temporary writable mapping via fixmap for kernel text addresses, even when CONFIG_STRICT_MODULE_RWX is disabled and the kernel text is already mapped with _PAGE_WRITE. This is unnecessary overhead at best, and on minimal configurations it can cause page faults. Skip the fixmap path for kernel text when CONFIG_STRICT_MODULE_RWX is not enabled, since the text pages are already writable in this case. Signed-off-by: Xiaofeng Yuan <xiaofengmian@163.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
|
Patch 1: "[v3,1/2] riscv: mm: make EXECMEM_KPROBES writable without CONFIG_STRICT_MODULE_RWX" |
|
Patch 1: "[v3,1/2] riscv: mm: make EXECMEM_KPROBES writable without CONFIG_STRICT_MODULE_RWX" |
|
Patch 1: "[v3,1/2] riscv: mm: make EXECMEM_KPROBES writable without CONFIG_STRICT_MODULE_RWX" |
|
Patch 1: "[v3,1/2] riscv: mm: make EXECMEM_KPROBES writable without CONFIG_STRICT_MODULE_RWX" |
|
Patch 1: "[v3,1/2] riscv: mm: make EXECMEM_KPROBES writable without CONFIG_STRICT_MODULE_RWX" |
|
Patch 1: "[v3,1/2] riscv: mm: make EXECMEM_KPROBES writable without CONFIG_STRICT_MODULE_RWX" |
|
Patch 1: "[v3,1/2] riscv: mm: make EXECMEM_KPROBES writable without CONFIG_STRICT_MODULE_RWX" |
|
Patch 1: "[v3,1/2] riscv: mm: make EXECMEM_KPROBES writable without CONFIG_STRICT_MODULE_RWX" |
|
Patch 1: "[v3,1/2] riscv: mm: make EXECMEM_KPROBES writable without CONFIG_STRICT_MODULE_RWX" |
|
Patch 1: "[v3,1/2] riscv: mm: make EXECMEM_KPROBES writable without CONFIG_STRICT_MODULE_RWX" |
|
Patch 1: "[v3,1/2] riscv: mm: make EXECMEM_KPROBES writable without CONFIG_STRICT_MODULE_RWX" |
|
Patch 1: "[v3,1/2] riscv: mm: make EXECMEM_KPROBES writable without CONFIG_STRICT_MODULE_RWX" |
|
Patch 2: "[v3,2/2] riscv: patch: skip fixmap mapping when kernel text is already writable" |
|
Patch 2: "[v3,2/2] riscv: patch: skip fixmap mapping when kernel text is already writable" |
|
Patch 2: "[v3,2/2] riscv: patch: skip fixmap mapping when kernel text is already writable" |
|
Patch 2: "[v3,2/2] riscv: patch: skip fixmap mapping when kernel text is already writable" |
|
Patch 2: "[v3,2/2] riscv: patch: skip fixmap mapping when kernel text is already writable" |
|
Patch 2: "[v3,2/2] riscv: patch: skip fixmap mapping when kernel text is already writable" |
|
Patch 2: "[v3,2/2] riscv: patch: skip fixmap mapping when kernel text is already writable" |
|
Patch 2: "[v3,2/2] riscv: patch: skip fixmap mapping when kernel text is already writable" |
|
Patch 2: "[v3,2/2] riscv: patch: skip fixmap mapping when kernel text is already writable" |
|
Patch 2: "[v3,2/2] riscv: patch: skip fixmap mapping when kernel text is already writable" |
|
Patch 2: "[v3,2/2] riscv: patch: skip fixmap mapping when kernel text is already writable" |
|
Patch 2: "[v3,2/2] riscv: patch: skip fixmap mapping when kernel text is already writable" |
8ca72ef to
60e0882
Compare
PR for series 1130242 applied to workflow__riscv__fixes
Name: riscv: fix kprobes on minimal kernel configs
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1130242
Version: 3