CVE-2025-40092
kernel: usb: gadget: f_ncm: Refactor bind path to use __free()
Severity
LowRed Hat Product Security
CVSS 3.1
Review impact separately from score.
Published · October 30, 2025
Updated · October 17, 2026
Description
In the Linux kernel, the following vulnerability has been resolved:
usb: gadget: f_ncm: Refactor bind path to use __free()
After an bind/unbind cycle, the ncm->notify_req is left stale. If a subsequent bind fails, the unified error label attempts to free this stale request, leading to a NULL pointer dereference when accessing ep->ops->free_request.
Refactor the error handling in the bind path to use the __free() automatic cleanup mechanism.
Unable to handle kernel NULL pointer dereference at virtual address 0000000000000020 Call trace: usb_ep_free_request+0x2c/0xec ncm_bind+0x39c/0x3dc usb_add_function+0xcc/0x1f0 configfs_composite_bind+0x468/0x588 gadget_bind_driver+0x104/0x270 really_probe+0x190/0x374 __driver_probe_device+0xa0/0x12c driver_probe_device+0x3c/0x218 __device_attach_driver+0x14c/0x188 bus_for_each_drv+0x10c/0x168 __device_attach+0xfc/0x198 device_initial_probe+0x14/0x24 bus_probe_device+0x94/0x11c device_add+0x268/0x48c usb_add_gadget+0x198/0x28c dwc3_gadget_init+0x700/0x858 __dwc3_set_mode+0x3cc/0x664 process_scheduled_works+0x1d8/0x488 worker_thread+0x244/0x334 kthread+0x114/0x1bc ret_from_fork+0x10/0x20
Statement
A low severity NULL pointer dereference flaw was found in the Linux kernel's USB gadget Network Control Model (NCM) function driver (f_ncm). After a bind/unbind cycle, the ncm->notify_req pointer is left stale; if a subsequent bind of the function fails, the unified error-handling path attempts to free this stale request, causing a NULL pointer dereference when accessing ep->ops->free_request in usb_ep_free_request(), which results in a kernel crash (denial of service). Red Hat Product Security rated this flaw LOW severity with a CVSS3 base score of 5.5 (AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H), because exploitation requires local privileged access to trigger the affected error path and the impact is limited to system availability. This differs from the upstream CVEORG score of 7.8, which assigns high confidentiality and integrity impacts; the technical evidence supports only a denial of service from the NULL pointer dereference, with no confidentiality or integrity impact. Red Hat Enterprise Linux 6, 7, 8, and 9 (kernel and kernel-rt) are not affected because the vulnerable code is not present in those streams. The Red Hat Enterprise Linux 10 kernel and the Red Hat In-Vehicle OS 1 kernel are affected; the fix is deferred to a future update because this is a low-severity flaw in a configuration-dependent error handling path, and the residual risk is limited to a kernel panic (denial of service) on systems using the USB NCM gadget function.
CVSS score applicability
The CVSS score(s) listed for this vulnerability do not reflect the associated product's status, and are included for informational purposes to better understand the severity of this vulnerability.
Mitigation
Mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base, or stability.
CVSS / CWE
CVSS 3.1 · 5.5CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
CWE-476 · NULL Pointer Dereference