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

netfs: Fix NULL pointer dereference in netfs_unbuffered_write() on retry

When a write subrequest is marked NETFS_SREQ_NEED_RETRY, the retry path
in netfs_unbuffered_write() unconditionally calls stream->prepare_write()
without checking if it is NULL.

Filesystems such as 9P do not set the prepare_write operation, so
stream->prepare_write remains NULL. When get_user_pages() fails with
-EFAULT and the subrequest is flagged for retry, this results in a NULL
pointer dereference at fs/netfs/direct_write.c:189.

Fix this by mirroring the pattern already used in write_retry.c: if
stream->prepare_write is NULL, skip renegotiation and directly reissue
the subrequest via netfs_reissue_write(), which handles iterator reset,
IN_PROGRESS flag, stats update and reissue internally.
Published: 2026-04-22
Score: 5.5 Medium
EPSS: < 1% Very Low
KEV: No
Impact: Kernel crash leading to denial‑of‑service
Action: Apply Patch
AI Analysis

Impact

In the Linux kernel, netfs_unbuffered_write() contains an unconditional call to stream->prepare_write when a write subrequest is marked NETFS_SREQ_NEED_RETRY. Filesystems such as 9P do not implement prepare_write, leaving the function pointer NULL. When get_user_pages() fails with –EFAULT and the subrequest is flagged for retry, this results in a NULL pointer dereference at fs/netfs/direct_write.c:189, causing a kernel OOPS. This indicates a classic null pointer dereference weakness (CWE‑476) and can lead to an unprivileged kernel crash, providing a denial‑of‑service and a potential escalation surface if the fault is leveraged further.

Affected Systems

All Linux kernel versions prior to the commit that introduces the NULL check are vulnerable. The issue affects any system that mounts a netfs implementation that does not provide a prepare_write function, notably the 9P filesystem. The vulnerability is present in every pre‑patch kernel revision and is fixed in kernels that incorporate the referenced commit URLs.

Risk and Exploitability

The CVSS score of 5.5 indicates a medium severity, while the EPSS score of < 1 % suggests a low exploitation probability. The vulnerability is not listed in the CISA KEV catalog. Based on the description, it is inferred that a local attacker with write access to a netfs file can trigger the crash by causing a write failure and retry. The risk is therefore a local denial‑of‑service that could be exploited to destabilize the system or, in some circumstances, enable privilege escalation.

Generated by OpenCVE AI on April 28, 2026 at 08:23 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade the kernel to a version that includes the commit adding a NULL check for stream->prepare_write in netfs_unbuffered_write.
  • Reboot the system so that the updated kernel and modules are loaded.
  • If an official patch is not yet available, avoid mounting 9P or other netfs filesystems that lack a prepare_write implementation until a fix is applied.

Generated by OpenCVE AI on April 28, 2026 at 08:23 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Thu, 23 Apr 2026 00:15:00 +0000

Type Values Removed Values Added
Weaknesses CWE-476
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


Wed, 22 Apr 2026 14:15:00 +0000

Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: netfs: Fix NULL pointer dereference in netfs_unbuffered_write() on retry When a write subrequest is marked NETFS_SREQ_NEED_RETRY, the retry path in netfs_unbuffered_write() unconditionally calls stream->prepare_write() without checking if it is NULL. Filesystems such as 9P do not set the prepare_write operation, so stream->prepare_write remains NULL. When get_user_pages() fails with -EFAULT and the subrequest is flagged for retry, this results in a NULL pointer dereference at fs/netfs/direct_write.c:189. Fix this by mirroring the pattern already used in write_retry.c: if stream->prepare_write is NULL, skip renegotiation and directly reissue the subrequest via netfs_reissue_write(), which handles iterator reset, IN_PROGRESS flag, stats update and reissue internally.
Title netfs: Fix NULL pointer dereference in netfs_unbuffered_write() on retry
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-05-11T22:08:41.432Z

Reserved: 2026-03-09T15:48:24.090Z

Link: CVE-2026-31437

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Analyzed

Published: 2026-04-22T14:16:36.980

Modified: 2026-05-19T22:09:14.920

Link: CVE-2026-31437

cve-icon Redhat

Severity : Moderate

Publid Date: 2026-04-22T00:00:00Z

Links: CVE-2026-31437 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-04-28T08:30:13Z

Weaknesses