CVE-2025-40315 - CVE House
Back to Database
Status published Unknown CVE-2025-40315

usb: gadget: f_fs: Fix epfile null pointer access after ep enable.

Vulnerability Description

In the Linux kernel, the following vulnerability has been resolved: usb: gadget: f_fs: Fix epfile null pointer access after ep enable. A race condition occurs when ffs_func_eps_enable() runs concurrently with ffs_data_reset(). The ffs_data_clear() called in ffs_data_reset() sets ffs->epfiles to NULL before resetting ffs->eps_count to 0, leading to a NULL pointer dereference when accessing epfile->ep in ffs_func_eps_enable() after successful usb_ep_enable(). The ffs->epfiles pointer is set to NULL in both ffs_data_clear() and ffs_data_close() functions, and its modification is protected by the spinlock ffs->eps_lock. And the whole ffs_func_eps_enable() function is also protected by ffs->eps_lock. Thus, add NULL pointer handling for ffs->epfiles in the ffs_func_eps_enable() function to fix issues

Impact Analysis

Refer to official advisory for detailed impact metrics.

Remediation

Ensure systems are updated to the latest vendor-supplied patch levels.

THREAT MONITOR

Am I Vulnerable?

Launch our assessment wizard to check if your infrastructure is exposed to • CVE-2025-40315

Credits & Attribution

No credits recorded in the NVD database.

Affected Vendor

Affected Software

Linux
Vulnerable Versions:
c9fc422c9a43e3d58d246334a71f3390401781dc, 0042178a69eb77a979e36a50dcce9794a3140ef8, 72a8aee863af099d4434314c4536d6c9a61dcf3c, ebe2b1add1055b903e2acd86b290a85297edc0b3, 32048f4be071f9a6966744243f1786f45bb22dc2, cfe5f6fd335d882bcc829a1c8a7d462a455c626e, 3e078b18753669615301d946297bafd69294ad2c, 5.4.180, 5.10.101, 5.15.24, 4.14.267, 4.19.230, 5.16.10, 5.17, 0, 5.4.302, 5.10.247, 5.15.197, 6.1.159, 6.6.117, 6.12.58, 6.17.8, 6.18

Timeline

Official Publish: December 8th, 2025
Last Modified: May 23rd, 2026
Added to House: July 22nd, 2026

CVSS Vectors

No vector data available

Weaknesses (CWE)

No CWE data available

MITRE ATT&CK TTPs

No associated TTPs found for this vulnerability.