CVE-2026-31437

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

Published Apr 22, 2026 CVSS 3.1 · 5.5 Medium EPSS < 1% KEV · Not listed
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.

Analysis

AI-generated

Technical 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.

Remediation

No solution or workaround provided in the CVE record.

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 available
History
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

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
Weaknesses

Sources

Status
PUBLISHED
Assigner
Linux
Published
Updated
May 11, 2026, 10:08 PM
Reserved
Mar 9, 2026, 3:48 PM
Status
Analyzed
Published
Apr 22, 2026, 2:16 PM
Modified
Nov 11, 2026, 11:10 PM
Severity
Moderate
Public date
Apr 22, 2026, 12:00 AM