CVE-2026-99092: riscv: patch: fix handling of bpf-jit execmem addresses

Published Oct 26, 2026
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

riscv: patch: fix handling of bpf-jit execmem addresses

Commit 8718e5a3090b ("riscv: patch: skip fixmap mapping when kernel text is already writable") gated the corekerneltext() branch of patchmap() on CONFIGSTRICTKERNELRWX, and explicitly left the vmalloc branch unchanged. That branch has a separate problem.

That branch only creates a temporary writable fixmap alias when CONFIGSTRICTMODULERWX is enabled, and otherwise assumes the target is directly writable and returns the address unchanged. That assumption no longer holds: bpfprogpackalloc calls setmemoryrox() on every pack unconditionally in allocnewpack(), independently of any CONFIGSTRICTRWX option, so BPF text in the vmalloc area is read-only regardless of what CONFIGSTRICTMODULERWX says.

With CONFIGSTRICTMODULERWX=n, patchmap() returns the read-only address directly, the subsequent copytokernelnofault() takes a page fault and returns -EFAULT. bpfarchtextcopy() turns that into -EINVAL, which propagates through bpfjitbinarypackfinalize() to the WARNON() in bpfintjitcompile() and leaves the program un-JITed.

Note that BPF cannot be fixed the way kprobes was in commit bdc46e507b59 ("riscv: mm: make EXECMEMKPROBES writable without CONFIGSTRICTMODULERWX"). EXECMEMBPF is already PAGEKERNEL, i.e. writable at allocation time; the read-only mapping is established afterwards by generic code in allocnewpack(), which arch code cannot influence. The only place this can be handled is patchmap().

This is the same problem that was fixed on arm64 by commit b1480ed230ac ("arm64: patching: fix handling of execmem addresses"), and the fix is the same: CONFIGEXECMEM is what actually tracks whether the vmalloc area can hold executable memory that needs a temporary alias to be written. CONFIGBPFJIT, CONFIGKPROBES and CONFIGMODULES all select it.

Note that this is not limited to CONFIGMODULES=n. Unlike arm64, riscv selects CONFIGARCHOPTIONALKERNELRWX, so CONFIGSTRICTMODULERWX can be disabled with CONFIGMODULES=y as well, and the bug is reachable in that configuration too.

The !CONFIGMMU build is unaffected: it has its own patchinsnset() and patchinsnwrite() implementations and never calls patchmap().

Affected Software

1 affected component
Linux Linux kernel

Event History

Oct 26, 2026
CVE Published
via MITRE·02:52 PM
Data Sourced
via MITRE·02:52 PM
Description

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203