Skip to contentSkip to conversation

CVE-2025-37879: 9p/net: fix improper handling of bogus negative read/write replies

DISCUSSION Greg Kroah-Hartman 1 participant 1 message May 9, 2025

lore
Share & tools
lore
#0 lore raw

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

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

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

9p/net: fix improper handling of bogus negative read/write replies

In p9_client_write() and p9_client_read_once(), if the server incorrectly replies with success but a negative write/read count then we would consider written (negative) <= rsize (positive) because both variables were signed.

Make variables unsigned to avoid this problem.

The reproducer linked below now fails with the following error instead of a null pointer deref:
9pnet: bogus RWRITE count (4294967295 > 3)

The Linux kernel CVE team has assigned CVE-2025-37879 to this issue.

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

	Fixed in 6.1.136 with commit 468ff4a7c61fb811c596a7c44b6a5455e40fd12b
	Fixed in 6.6.89 with commit a68768e280b7d0c967ea509e791bb9b90adc94a5
	Fixed in 6.12.26 with commit c548f95688e2b5ae0e2ae43d53cf717156c7d034
	Fixed in 6.14.5 with commit 374e4cd75617c8c2552f562f39dd989583f5c330
	Fixed in 6.15-rc1 with commit d0259a856afca31d699b706ed5e2adf11086c73b

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-2025-37879

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:

	net/9p/client.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/468ff4a7c61fb811c596a7c44b6a5455e40fd12b
	https://git.kernel.org/stable/c/a68768e280b7d0c967ea509e791bb9b90adc94a5
	https://git.kernel.org/stable/c/c548f95688e2b5ae0e2ae43d53cf717156c7d034
	https://git.kernel.org/stable/c/374e4cd75617c8c2552f562f39dd989583f5c330
	https://git.kernel.org/stable/c/d0259a856afca31d699b706ed5e2adf11086c73b