Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2025-68282— usb: gadget: udc: fix use-after-free in usb_gadget_state_work

EPSS 0.07% · P21
Get alerts for future matching vulnerabilitiesLog in to subscribe

I. Basic Information for CVE-2025-68282

Vulnerability Information

Have questions about the vulnerability? See if Shenlong's analysis helps!
View Shenlong Deep Dive ↗

Although we use advanced large model technology, its output may still contain inaccurate or outdated information.Shenlong tries to ensure data accuracy, but please verify and judge based on the actual situation.

Vulnerability Title
usb: gadget: udc: fix use-after-free in usb_gadget_state_work
Source: NVD (National Vulnerability Database)
Vulnerability Description
In the Linux kernel, the following vulnerability has been resolved: usb: gadget: udc: fix use-after-free in usb_gadget_state_work A race condition during gadget teardown can lead to a use-after-free in usb_gadget_state_work(), as reported by KASAN: BUG: KASAN: invalid-access in sysfs_notify+0x2c/0xd0 Workqueue: events usb_gadget_state_work The fundamental race occurs because a concurrent event (e.g., an interrupt) can call usb_gadget_set_state() and schedule gadget->work at any time during the cleanup process in usb_del_gadget(). Commit 399a45e5237c ("usb: gadget: core: flush gadget workqueue after device removal") attempted to fix this by moving flush_work() to after device_del(). However, this does not fully solve the race, as a new work item can still be scheduled *after* flush_work() completes but before the gadget's memory is freed, leading to the same use-after-free. This patch fixes the race condition robustly by introducing a 'teardown' flag and a 'state_lock' spinlock to the usb_gadget struct. The flag is set during cleanup in usb_del_gadget() *before* calling flush_work() to prevent any new work from being scheduled once cleanup has commenced. The scheduling site, usb_gadget_set_state(), now checks this flag under the lock before queueing the work, thus safely closing the race window.
Source: NVD (National Vulnerability Database)
CVSS Information
N/A
Source: NVD (National Vulnerability Database)
Vulnerability Type
N/A
Source: NVD (National Vulnerability Database)
Vulnerability Title
Linux kernel 安全漏洞
Source: CNNVD (China National Vulnerability Database)
Vulnerability Description
Linux kernel是美国Linux基金会的开源操作系统Linux所使用的内核。 Linux kernel存在安全漏洞,该漏洞源于usb_gadget_state_work存在释放后重用问题,可能导致系统不稳定。
Source: CNNVD (China National Vulnerability Database)
CVSS Information
N/A
Source: CNNVD (China National Vulnerability Database)
Vulnerability Type
N/A
Source: CNNVD (China National Vulnerability Database)

Affected Products

VendorProductAffected VersionsCPESubscribe
LinuxLinux 5702f75375aa9ecf8ad3431aef3fe6ce8c8dbd15 ~ dddc944d65169b552e09cb54e3ed4fbb9ea26416 -
LinuxLinux 3.12 -

II. Public POCs for CVE-2025-68282

#POC DescriptionSource LinkShenlong Link
AI-Generated POCPremium

No public POC found.

Login to generate AI POC

III. Intelligence Information for CVE-2025-68282

登录查看更多情报信息。

Same Patch Batch · Linux · 2025-12-16 · 157 CVEs total

CVE-2025-682639.8 CRITICALksmbd: ipc: fix use-after-free in ipc_msg_send_request
CVE-2025-68259KVM: SVM: Don't skip unrelated instruction if INT3/INTO is replaced
CVE-2025-68250hung_task: fix warnings caused by unaligned lock pointers
CVE-2025-68251erofs: avoid infinite loops due to corrupted subpage compact indexes
CVE-2025-68252misc: fastrpc: Fix dma_buf object leak in fastrpc_map_lookup
CVE-2025-68253mm: don't spin in add_stack_record when gfp flags don't allow
CVE-2025-68254staging: rtl8723bs: fix out-of-bounds read in OnBeacon ESR IE parsing
CVE-2025-68255staging: rtl8723bs: fix stack buffer overflow in OnAssocReq IE parsing
CVE-2025-68256staging: rtl8723bs: fix out-of-bounds read in rtw_get_ie() parser
CVE-2025-68257comedi: check device's attached status in compat ioctls
CVE-2025-68258comedi: multiq3: sanitize config options in multiq3_attach()
CVE-2025-68264ext4: refresh inline data size before write operations
CVE-2025-68283libceph: replace BUG_ON with bounds check for map->max_osd
CVE-2025-68281ASoC: SDCA: bug fix while parsing mipi-sdca-control-cn-list
CVE-2025-68266bfs: Reconstruct file type when loading from disk
CVE-2025-68265nvme: fix admin request_queue lifetime
CVE-2025-68261ext4: add i_data_sem protection in ext4_destroy_inline_data_nolock()
CVE-2025-68260rust_binder: fix race condition on death_list
CVE-2025-68249most: usb: hdm_probe: Fix calling put_device() before device initialization
CVE-2025-68262crypto: zstd - fix double-free in per-CPU stream cleanup

Showing top 20 of 157 CVEs. View all on vendor page → →

IV. Related Vulnerabilities

V. Comments for CVE-2025-68282

No comments yet


Leave a comment