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

riscv: Prevent NULL pointer dereference in machine_kexec_prepare()

A NULL pointer dereference issue is noticed in riscv's
machine_kexec_prepare(), where image->segment[i].buf might be NULL and
copied unchecked.

The NULL buf comes from ima_add_kexec_buffer(), where kbuf is added by
kexec_add_buffer(), but kbuf.buffer is NULL, then it is copied without
a check in machine_kexec_prepare():

kexec_file_load
-> kimage_file_alloc_init()
-> kimage_file_prepare_segments()
-> ima_add_kexec_buffer()
-> kexec_add_buffer()
-> machine_kexec_prepare()
-> memcpy()

Address this by adding a check before the data copy attempt.
Published: 2026-08-15
Score: n/a
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

In the RISC‑V implementation of the Linux kernel, the function machine_kexec_prepare() copies data from image->segment[i].buf without verifying that the buffer pointer is not NULL. This occurs when ima_add_kexec_buffer() receives a kbuf whose kbuf.buffer field is NULL. The unchecked memcpy therefore dereferences a null pointer, leading to a kernel panic and a denial of service.

Affected Systems

Affected systems are all Linux kernel builds that execute the vulnerable riscv machine_kexec_prepare() routine prior to the patch. The specific kernel versions are not listed, so any kernel that has not applied the patch from the referenced Git commits is potentially vulnerable.

Risk and Exploitability

The CVSS score is not provided and the EPSS score is unavailable, so the exact severity percentile is unknown. The vulnerability is not listed in KEV. Based on the description, it is inferred that a local attacker with the ability to trigger kexec or manipulate the kexec buffer via ima_add_kexec_buffer() could provoke the null dereference. Because the issue requires privileged manipulation of the kexec buffer, the attack vector is likely local with high privilege. The risk is a potential kernel crash, which may allow an attacker to disrupt service or perform privilege escalation if additional conditions are met.

Generated by OpenCVE AI on August 15, 2026 at 21:01 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Apply a kernel update that contains the fix adding a null pointer check to machine_kexec_prepare()
  • If using a custom kernel, manually apply the patch from the referenced Git commits (e.g., 606cc45e871e34b80a2f63874f069387a5b44176 and related), then rebuild and install the kernel
  • Verify that kexec and ima_add_kexec_buffer() no longer cause a crash by reproducing the failure scenario in a controlled environment

Generated by OpenCVE AI on August 15, 2026 at 21:01 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Sat, 15 Aug 2026 21:30:00 +0000

Type Values Removed Values Added
Weaknesses CWE-476

Sat, 15 Aug 2026 06:00:00 +0000

Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: riscv: Prevent NULL pointer dereference in machine_kexec_prepare() A NULL pointer dereference issue is noticed in riscv's machine_kexec_prepare(), where image->segment[i].buf might be NULL and copied unchecked. The NULL buf comes from ima_add_kexec_buffer(), where kbuf is added by kexec_add_buffer(), but kbuf.buffer is NULL, then it is copied without a check in machine_kexec_prepare(): kexec_file_load -> kimage_file_alloc_init() -> kimage_file_prepare_segments() -> ima_add_kexec_buffer() -> kexec_add_buffer() -> machine_kexec_prepare() -> memcpy() Address this by adding a check before the data copy attempt.
Title riscv: Prevent NULL pointer dereference in machine_kexec_prepare()
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References

Subscriptions

Linux Linux Kernel
cve-icon MITRE

Status: PUBLISHED

Assigner: Linux

Published:

Updated: 2026-08-15T05:51:41.982Z

Reserved: 2026-08-09T03:40:39.899Z

Link: CVE-2026-72013

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-08-15T06:21:00.033

Modified: 2026-08-15T06:21:00.033

Link: CVE-2026-72013

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-15T21:15:03Z

Weaknesses