Skip to contentSkip to conversation

CVE-2026-90023: usb: gadget: f_mass_storage: fix null pointer dereference in fsg_common_set_num_buffers()

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Sep 16

lore
Share & tools
lore
#0 lore raw

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

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

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

usb: gadget: f_mass_storage: fix null pointer dereference in fsg_common_set_num_buffers()

Previously fsg_num_buffers_validate() was removed as it was not necessary due to Kconfig setting the limits for n from 2 to 256 with default as 2. However, setting the page content in such a way that kstrtou8() reflects n value as either 0 or 1 bypasses these restrictions leading to a null pointer dereference if n is 0. Fix this by adding a check for n < 2 and returning -EINVAL if n is either 0 or 1 consistent with Kconfig logic.

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

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

	Issue introduced in 4.8 with commit fe5a6c48fd954489f51aab151d5dad9254c76419 and fixed in 6.18.52 with commit 9e8dd2a7a8ccbb756771ad985b0ad3387ed3c957
	Issue introduced in 4.8 with commit fe5a6c48fd954489f51aab151d5dad9254c76419 and fixed in 7.2.5 with commit b9b5b5df5b8dd3c1572ed267200276a44cc67d8e
	Issue introduced in 4.8 with commit fe5a6c48fd954489f51aab151d5dad9254c76419 and fixed in 7.3-rc2 with commit 2c0f5ca48674a5b5f9fa4a9c3325aa48053af0bc

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-90023

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:
drivers/usb/gadget/function/f_mass_storage.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/9e8dd2a7a8ccbb756771ad985b0ad3387ed3c957
	https://git.kernel.org/stable/c/b9b5b5df5b8dd3c1572ed267200276a44cc67d8e
	https://git.kernel.org/stable/c/2c0f5ca48674a5b5f9fa4a9c3325aa48053af0bc