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: 5.5 Medium
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 of 5.5 indicates moderate severity, and the EPSS score is less than 1%, indicating a low probability of exploitation. 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 18, 2026 at 04:23 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
  • Restrict or disable kexec usage for non‑privileged users by configuring the kernel or system services to prevent malicious buffer injection

Generated by OpenCVE AI on August 18, 2026 at 04:23 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Tue, 18 Aug 2026 00:15:00 +0000

Type Values Removed Values Added
References
Metrics threat_severity

None

cvssV3_1

{'score': 5.5, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H'}

threat_severity

Moderate


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-17T05:06:35.378Z

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-17T06:17:58.763

Link: CVE-2026-72013

cve-icon Redhat

Severity : Moderate

Publid Date: 2026-08-15T00:00:00Z

Links: CVE-2026-72013 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-08-18T04:30:06Z

Weaknesses