CVE-2025-38433

Source
https://nvd.nist.gov/vuln/detail/CVE-2025-38433
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-38433.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2025-38433
Downstream
Published
2025-07-25T14:32:07Z
Modified
2025-10-22T13:47:31.900861Z
Summary
riscv: fix runtime constant support for nommu kernels
Details

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

riscv: fix runtime constant support for nommu kernels

the __runtime_fixup_32 function does not handle the case where val is zero correctly (as might occur when patching a nommu kernel and referring to a physical address below the 4GiB boundary whose upper 32 bits are all zero) because nothing in the existing logic prevents the code from taking the else branch of both nop-checks and emitting two nop instructions.

This leaves random garbage in the register that is supposed to receive the upper 32 bits of the pointer instead of zero that when combined with the value for the lower 32 bits yields an invalid pointer and causes a kernel panic when that pointer is eventually accessed.

The author clearly considered the fact that if the lui is converted into a nop that the second instruction needs to be adjusted to become an li instead of an addi, hence introducing the addi_insn_mask variable, but didn't follow that logic through fully to the case where the else branch executes. To fix it just adjust the logic to ensure that the second else branch is not taken if the first instruction will be patched to a nop.

References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
a44fb5722199de8338d991db5ad3d509192179bb
Fixed
0a24b00dcde83934a3cc13e4c6b775522903496b
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
a44fb5722199de8338d991db5ad3d509192179bb
Fixed
8d90d9872edae7e78c3a12b98e239bfaa66f3639

Affected versions

v6.*

v6.14
v6.14-rc2
v6.14-rc3
v6.14-rc4
v6.14-rc5
v6.14-rc6
v6.14-rc7
v6.15
v6.15-rc1
v6.15-rc2
v6.15-rc3
v6.15-rc4
v6.15-rc5
v6.15-rc6
v6.15-rc7
v6.15.1
v6.15.2
v6.15.3
v6.15.4
v6.16-rc1

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
6.15.0
Fixed
6.15.5