[PATCH v4 0/2] riscv: fix kprobes on minimal kernel configs

Xiaofeng Yuan posted 2 patches 4 days, 23 hours ago
arch/riscv/kernel/patch.c | 4 ++--
arch/riscv/mm/init.c      | 4 +++-
2 files changed, 6 insertions(+), 2 deletions(-)
[PATCH v4 0/2] riscv: fix kprobes on minimal kernel configs
Posted by Xiaofeng Yuan 4 days, 23 hours ago
When building with an allnoconfig-derived minimal configuration
(without CONFIG_STRICT_MODULE_RWX), kprobes fails because
instruction slot pages from EXECMEM_KPROBES are read-only and
patch_map() bypasses the fixmap writable alias.

These two patches fix the infrastructure.

PATCH 1/2 changelog:
  v2: use CONFIG_STRICT_MODULE_RWX instead of ARCH_HAS_EXECMEM_ROX
  v3: add commit description
  v4: fix indent alignment

PATCH 2/2 changelog:
  v2: add commit description
  v3: early return when !CONFIG_STRICT_MODULE_RWX

Xiaofeng Yuan (2):
  riscv: mm: make EXECMEM_KPROBES writable without
    CONFIG_STRICT_MODULE_RWX
  riscv: patch: skip fixmap mapping when kernel text is already
    writable

 arch/riscv/kernel/patch.c | 4 ++--
 arch/riscv/mm/init.c      | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

--
2.43.0
Re: [PATCH v4 0/2] riscv: fix kprobes on minimal kernel configs
Posted by Nam Cao 4 days, 19 hours ago
Xiaofeng Yuan <xiaofengmian@163.com> writes:
> When building with an allnoconfig-derived minimal configuration
> (without CONFIG_STRICT_MODULE_RWX), kprobes fails because
> instruction slot pages from EXECMEM_KPROBES are read-only and
> patch_map() bypasses the fixmap writable alias.
>
> These two patches fix the infrastructure.

Reviewed-by: Nam Cao <namcao@linutronix.de>