Skip to contentSkip to conversation

CVE-2026-31438: netfs: Fix kernel BUG in netfs_limit_iter() for ITER_KVEC iterators

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Apr 22

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

Description
===========

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

netfs: Fix kernel BUG in netfs_limit_iter() for ITER_KVEC iterators

When a process crashes and the kernel writes a core dump to a 9P filesystem, __kernel_write() creates an ITER_KVEC iterator. This iterator reaches netfs_limit_iter() via netfs_unbuffered_write(), which only handles ITER_FOLIOQ, ITER_BVEC and ITER_XARRAY iterator types, hitting the BUG() for any other type.

Fix this by adding netfs_limit_kvec() following the same pattern as netfs_limit_bvec(), since both kvec and bvec are simple segment arrays with pointer and length fields. Dispatch it from netfs_limit_iter() when the iterator type is ITER_KVEC.

The Linux kernel CVE team has assigned CVE-2026-31438 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 6.8 with commit cae932d3aee55035a54415dcea8e7ecf2ec469b5 and fixed in 6.12.80 with commit 18c2e20b42dd21db599e42d05ddaeeb647b2bb6d
	Issue introduced in 6.8 with commit cae932d3aee55035a54415dcea8e7ecf2ec469b5 and fixed in 6.18.21 with commit 4bc2d72c7695cedf6d4e1a558924903c2b28a78e
	Issue introduced in 6.8 with commit cae932d3aee55035a54415dcea8e7ecf2ec469b5 and fixed in 6.19.11 with commit 00d6df7115f6972370974212de9088087820802e
	Issue introduced in 6.8 with commit cae932d3aee55035a54415dcea8e7ecf2ec469b5 and fixed in 7.0 with commit 67e467a11f62ff64ad219dc6aa5459e132c79d14

Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at

	https://cve.org/CVERecord/?id=CVE-2026-31438

will be updated if fixes are backported, please check that for the most up to date information about this issue.

Affected files
==============

The file(s) affected by this issue are:
fs/netfs/iterator.c

Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:

	https://git.kernel.org/stable/c/18c2e20b42dd21db599e42d05ddaeeb647b2bb6d
	https://git.kernel.org/stable/c/4bc2d72c7695cedf6d4e1a558924903c2b28a78e
	https://git.kernel.org/stable/c/00d6df7115f6972370974212de9088087820802e
	https://git.kernel.org/stable/c/67e467a11f62ff64ad219dc6aa5459e132c79d14