VDB

CVE-2025-40315

CVE-2025-40315 PUBLISHED

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

Reported by linux · Published December 8, 2025

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

EPSS 0.22% · 12.0th percentile

Fixed versions

Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.

PackageEcosystemFixed in
linux_kernellinux6.18, 6.17.8, 6.12.58, 6.6.117, 6.1.159, 5.15.197, 5.10.247, 5.4.302
LinuxLinuxfc1141a530dfc91f0ee19b7f422a2d24829584bc, d62b808d5c68a931ad0849a00a5e3be3dd7e0019, cfd6f1a7b42f62523c96d9703ef32b0dbc495ba4, c53e90563bc148e4e0ad09fe130ba2246d426ea6, b00d2572c16e8e59e979960d3383c2ae9cebd195, 1c0dbd240be3f87cac321b14e17979b7e9cb6a8f

Risk scores

EPSS Score
0.22%
12.0th percentile

Affected products

VendorProductVersions
LinuxLinuxc9fc422c9a43e3d58d246334a71f3390401781dc, 0042178a69eb77a979e36a50dcce9794a3140ef8, 72a8aee863af099d4434314c4536d6c9a61dcf3c
LinuxLinux5.17, 0, 5.4.302
linuxlinux_kernel5.4.180, 5.15.24, 5.17
LinuxLinux72a8aee863af099d4434314c4536d6c9a61dcf3c, 32048f4be071f9a6966744243f1786f45bb22dc2, 3e078b18753669615301d946297bafd69294ad2c

Timeline

  • Dec 7, 2025 CVE Published
  • Dec 8, 2025 EPSS Score (30 in total, the first dated here)
  • Mar 29, 2026 Distribution Patch (182 in total, the first dated here)
  • Mar 29, 2026 Security Advisory (186 in total, the first dated here)
  • Jun 8, 2026 Coalition ESS Score
  • Oct 7, 2026 CVE Updated

Query this with the API

The same record, from the CLI:

vulnetix vdb vuln CVE-2025-40315
vulnetix vdb fixes CVE-2025-40315

Or with curl, using the org id and key from your account page:

curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
  "https://api.vdb.vulnetix.com/v2/vuln/CVE-2025-40315/fixes/registry"

The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart

References

Look up in the Resolve Platform →
$ Lookup Community · 50/day Open Lookup ›