{"id":"CVE-2025-40315","summary":"usb: gadget: f_fs: Fix epfile null pointer access after ep enable.","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nusb: gadget: f_fs: Fix epfile null pointer access after ep enable.\n\nA race condition occurs when ffs_func_eps_enable() runs concurrently\nwith ffs_data_reset(). The ffs_data_clear() called in ffs_data_reset()\nsets ffs-\u003eepfiles to NULL before resetting ffs-\u003eeps_count to 0, leading\nto a NULL pointer dereference when accessing epfile-\u003eep in\nffs_func_eps_enable() after successful usb_ep_enable().\n\nThe ffs-\u003eepfiles pointer is set to NULL in both ffs_data_clear() and\nffs_data_close() functions, and its modification is protected by the\nspinlock ffs-\u003eeps_lock. And the whole ffs_func_eps_enable() function\nis also protected by ffs-\u003eeps_lock.\n\nThus, add NULL pointer handling for ffs-\u003eepfiles in the\nffs_func_eps_enable() function to fix issues","modified":"2026-04-16T04:36:53.707716441Z","published":"2025-12-08T00:46:41.896Z","related":["SUSE-SU-2026:0278-1","SUSE-SU-2026:0281-1","SUSE-SU-2026:0293-1","SUSE-SU-2026:0315-1","SUSE-SU-2026:20207-1","SUSE-SU-2026:20220-1","SUSE-SU-2026:20228-1","SUSE-SU-2026:20477-1","SUSE-SU-2026:20498-1","SUSE-SU-2026:20845-1","SUSE-SU-2026:20876-1","openSUSE-SU-2026:20145-1"],"database_specific":{"cna_assigner":"Linux","osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/40xxx/CVE-2025-40315.json"},"references":[{"type":"WEB","url":"https://git.kernel.org/stable/c/1c0dbd240be3f87cac321b14e17979b7e9cb6a8f"},{"type":"WEB","url":"https://git.kernel.org/stable/c/30880e9df27332403dd638a82c27921134b3630b"},{"type":"WEB","url":"https://git.kernel.org/stable/c/9ec40fba7357df2d36f4c2e2f3b9b1a4fba0a272"},{"type":"WEB","url":"https://git.kernel.org/stable/c/b00d2572c16e8e59e979960d3383c2ae9cebd195"},{"type":"WEB","url":"https://git.kernel.org/stable/c/c53e90563bc148e4e0ad09fe130ba2246d426ea6"},{"type":"WEB","url":"https://git.kernel.org/stable/c/cfd6f1a7b42f62523c96d9703ef32b0dbc495ba4"},{"type":"WEB","url":"https://git.kernel.org/stable/c/d62b808d5c68a931ad0849a00a5e3be3dd7e0019"},{"type":"WEB","url":"https://git.kernel.org/stable/c/fc1141a530dfc91f0ee19b7f422a2d24829584bc"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/40xxx/CVE-2025-40315.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-40315"},{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"c9fc422c9a43e3d58d246334a71f3390401781dc"},{"fixed":"b00d2572c16e8e59e979960d3383c2ae9cebd195"}]},{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"0042178a69eb77a979e36a50dcce9794a3140ef8"},{"fixed":"1c0dbd240be3f87cac321b14e17979b7e9cb6a8f"}]},{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"72a8aee863af099d4434314c4536d6c9a61dcf3c"},{"fixed":"9ec40fba7357df2d36f4c2e2f3b9b1a4fba0a272"}]},{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"ebe2b1add1055b903e2acd86b290a85297edc0b3"},{"fixed":"c53e90563bc148e4e0ad09fe130ba2246d426ea6"},{"fixed":"fc1141a530dfc91f0ee19b7f422a2d24829584bc"},{"fixed":"d62b808d5c68a931ad0849a00a5e3be3dd7e0019"},{"fixed":"30880e9df27332403dd638a82c27921134b3630b"},{"fixed":"cfd6f1a7b42f62523c96d9703ef32b0dbc495ba4"}]},{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"0"},{"last_affected":"32048f4be071f9a6966744243f1786f45bb22dc2"},{"last_affected":"cfe5f6fd335d882bcc829a1c8a7d462a455c626e"},{"last_affected":"3e078b18753669615301d946297bafd69294ad2c"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-40315.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.4.302"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.5.0"},{"fixed":"5.10.247"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.11.0"},{"fixed":"5.15.197"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.16.0"},{"fixed":"6.1.159"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.17.0"},{"fixed":"6.6.117"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.2.0"},{"fixed":"6.12.58"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.7.0"},{"fixed":"6.17.8"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-40315.json"}}],"schema_version":"1.7.5"}