Skip to content

[PW_SID:1119627] riscv: fix kprobes on minimal kernel configs#2189

Closed
linux-riscv-bot wants to merge 3 commits into
workflow__riscv__fixesfrom
pw1119627
Closed

[PW_SID:1119627] riscv: fix kprobes on minimal kernel configs#2189
linux-riscv-bot wants to merge 3 commits into
workflow__riscv__fixesfrom
pw1119627

Conversation

@linux-riscv-bot

Copy link
Copy Markdown

PR for series 1119627 applied to workflow__riscv__fixes

Name: riscv: fix kprobes on minimal kernel configs
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1119627
Version: 1

Linux RISC-V bot and others added 3 commits July 1, 2026 03:48
When CONFIG_ARCH_HAS_EXECMEM_ROX 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_ARCH_HAS_EXECMEM_ROX
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_KERNEL_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_KERNEL_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>
@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[1/2] riscv: mm: make EXECMEM_KPROBES writable without ARCH_HAS_EXECMEM_ROX"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 119.76 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[1/2] riscv: mm: make EXECMEM_KPROBES writable without ARCH_HAS_EXECMEM_ROX"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1367.68 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[1/2] riscv: mm: make EXECMEM_KPROBES writable without ARCH_HAS_EXECMEM_ROX"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1706.93 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[1/2] riscv: mm: make EXECMEM_KPROBES writable without ARCH_HAS_EXECMEM_ROX"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 21.92 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[1/2] riscv: mm: make EXECMEM_KPROBES writable without ARCH_HAS_EXECMEM_ROX"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 23.81 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[1/2] riscv: mm: make EXECMEM_KPROBES writable without ARCH_HAS_EXECMEM_ROX"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 0.61 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[1/2] riscv: mm: make EXECMEM_KPROBES writable without ARCH_HAS_EXECMEM_ROX"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 78.79 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[1/2] riscv: mm: make EXECMEM_KPROBES writable without ARCH_HAS_EXECMEM_ROX"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[1/2] riscv: mm: make EXECMEM_KPROBES writable without ARCH_HAS_EXECMEM_ROX"
kdoc
Desc: Detects for kdoc errors
Duration: 0.72 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[1/2] riscv: mm: make EXECMEM_KPROBES writable without ARCH_HAS_EXECMEM_ROX"
module-param
Desc: Detect module_param changes
Duration: 0.25 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[1/2] riscv: mm: make EXECMEM_KPROBES writable without ARCH_HAS_EXECMEM_ROX"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[1/2] riscv: mm: make EXECMEM_KPROBES writable without ARCH_HAS_EXECMEM_ROX"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.27 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[2/2] riscv: patch: skip fixmap mapping when kernel text is already writable"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 119.31 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[2/2] riscv: patch: skip fixmap mapping when kernel text is already writable"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1451.22 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[2/2] riscv: patch: skip fixmap mapping when kernel text is already writable"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1688.40 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[2/2] riscv: patch: skip fixmap mapping when kernel text is already writable"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 21.96 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[2/2] riscv: patch: skip fixmap mapping when kernel text is already writable"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 23.52 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[2/2] riscv: patch: skip fixmap mapping when kernel text is already writable"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 0.61 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[2/2] riscv: patch: skip fixmap mapping when kernel text is already writable"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 78.47 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[2/2] riscv: patch: skip fixmap mapping when kernel text is already writable"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[2/2] riscv: patch: skip fixmap mapping when kernel text is already writable"
kdoc
Desc: Detects for kdoc errors
Duration: 0.72 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[2/2] riscv: patch: skip fixmap mapping when kernel text is already writable"
module-param
Desc: Detect module_param changes
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[2/2] riscv: patch: skip fixmap mapping when kernel text is already writable"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.22 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[2/2] riscv: patch: skip fixmap mapping when kernel text is already writable"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.26 seconds
Result: PASS

@linux-riscv-bot
linux-riscv-bot force-pushed the workflow__riscv__fixes branch 3 times, most recently from a50938c to 40ba5ca Compare July 8, 2026 17:32
@linux-riscv-bot
linux-riscv-bot deleted the pw1119627 branch July 9, 2026 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants