CVE-2026-31437

Source
https://cve.org/CVERecord?id=CVE-2026-31437
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-31437.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2026-31437
Downstream
Published
2026-04-22T13:53:36.361Z
Modified
2026-08-12T03:51:13.999742882Z
Summary
netfs: Fix NULL pointer dereference in netfs_unbuffered_write() on retry
Details

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

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

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

Filesystems such as 9P do not set the preparewrite operation, so stream->preparewrite remains NULL. When getuserpages() 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 writeretry.c: if stream->preparewrite is NULL, skip renegotiation and directly reissue the subrequest via netfsreissuewrite(), which handles iterator reset, IN_PROGRESS flag, stats update and reissue internally.

Database specific
{
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/31xxx/CVE-2026-31437.json",
    "cna_assigner": "Linux"
}
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
72d08d2839649d1c5efbe375751f4473fa4486af
Fixed
a4d1b4ba9754bac3efebd06f583a44a7af52c0ab
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
0c29f6d63122a0168d67cb8ecde5b4cf7fe4acb0
Fixed
7a5482f5ce891decbf36f2e6fab1e9fc4a76a684
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
a0b4c7a49137ed21279f354eb59f49ddae8dffc2
Fixed
e9075e420a1eb3b52c60f3b95893a55e77419ce8

Affected versions

v6.*
v6.18.17
v6.18.18
v6.18.19
v6.18.20
v6.19.10
v6.19.7
v6.19.8
v6.19.9

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-31437.json"

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
6.18.17
Fixed
6.18.21
Type
ECOSYSTEM
Events
Introduced
6.19.7
Fixed
6.19.11

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-31437.json"