Junglewise Threat Intelligence

CVE-2025-40093: Linux Kernel NULL pointer dereference in USB gadget f_ecm

CVE-2025-40093 · Severity: high · CVSS 7.8 · Published 2025-10-30

Technologies: Linux Kernel. Vendors: Linux.

Executive brief

A vulnerability was identified in the Linux kernel's USB Ethernet (ECM) gadget driver. This component allows a Linux system to act as a USB Ethernet device when connected to a host. An attacker with local access could trigger a system crash or potentially gain unauthorized control by exploiting a flaw in how the system handles USB connection and disconnection cycles.

Technical details

A NULL pointer dereference vulnerability exists in the drivers/usb/gadget/function/f_ecm.c component of the Linux kernel. The issue occurs because the 'ecm->notify_req' pointer is left stale after a bind/unbind cycle. If a subsequent bind operation fails, the error handling path attempts to free this stale request, resulting in a NULL pointer dereference when accessing 'ep->ops->free_request'. The fix refactors the bind path to utilize the '__free()' automatic cleanup mechanism to ensure proper resource management. This is a local vulnerability requiring low privileges to exploit.

Affected products

  • Linux Linux Kernel 2.6.27 to 6.1.157, 6.6.113, 6.12.54, 6.17.4

Timeline

  • 2025-10-17: patched: Initial fix commit authored
  • 2025-10-30: disclosed: CVE published by kernel.org

References

Related threats