CVE-2022-50568 in Kernel products
In the Linux kernel, the following vulnerability has been resolved: usb: gadget: f_hid: fix f_hidg lifetime vs cdev The embedded struct cdev does not have its lifetime correctly tied to the enclosing struct f_hidg, so there is a use-after-free if /dev/hidgN is held open while the gadget is deleted. This can readi...
Affects 1 product from 3 vendors. Facts below cite their sources.
Affected products and versions
| Vendor | Product | Affected versions |
|---|---|---|
| Kernel | — | — |
| Linux | Linux | 2.6.35 |
| Replicated | — | — |
A product listed here is affected only at the versions shown. Use the free check to test the exact version you run.
Fix and vendor advisory
No official vendor advisory link on record. See the CVE record.
Exploitation
| CISA known-exploited | Not in the CISA KEV catalog |
|---|---|
| Public exploit | Not confirmed |
Official description
In the Linux kernel, the following vulnerability has been resolved: usb: gadget: f_hid: fix f_hidg lifetime vs cdev The embedded struct cdev does not have its lifetime correctly tied to the enclosing struct f_hidg, so there is a use-after-free if /dev/hidgN is held open while the gadget is deleted. This can readily be replicated with libusbgx's example programs (for conciseness - operating directly via configfs is equivalent): gadget-hid exec 3<> /dev/hidg0 gadget-vid-pid-remove exec 3<&- Pull the existing device up in to struct f_hidg and make use of the cdev_device_{add,del}() helpers. This changes the lifetime of the device object to match struct f_hidg, but note that it is still added and deleted at the same time.
Source: NIST NVD / MITRE CVE.
Record details
| CVE ID | CVE-2022-50568 |
|---|---|
| BreachSpider ID | BS-2025-GLOBAL-340836-I |
| Published | 2025-10-22 |
| Last modified | 2026-06-17 |
| Source | NVD |
Analysis AI-written, not human-reviewed
A use-after-free vulnerability exists in the Linux kernel's USB gadget f_hid module due to incorrect lifetime management of the embedded struct cdev relative to the enclosing struct f_hidg. This can be exploited if /dev/hidgN is held open while the gadget is deleted.
The vulnerability can be exploited by holding /dev/hidgN open while the gadget is deleted, leading to a use-after-free condition. This could potentially allow an attacker to execute arbitrary code or cause a denial of service.
Questions
What is CVE-2022-50568?
A use-after-free vulnerability exists in the Linux kernel's USB gadget f_hid module due to incorrect lifetime management of the embedded struct cdev relative to the enclosing struct f_hidg. This can be exploited if /dev/hidgN is held open while the gadget is deleted.
Is CVE-2022-50568 actively exploited?
No confirmed active exploitation of CVE-2022-50568 as of 2026-09-25.
How do I remediate CVE-2022-50568?
Priority: MEDIUM.
What systems are affected by CVE-2022-50568?
CVE-2022-50568 affects Kernel; Linux Linux; Replicated.
For developers and AI agents
Run this check from your own code or agent
REST API
curl -s https://breachspider.com/api/v1/assets/correlate-cves \
-H "Authorization: Bearer $BREACHSPIDER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"assets":[{"asset_id":"dev-1","vendor":"Kernel","product":"EDS-518A","version":"1.0"}]}'
MCP for AI agents
# hosted: add as a connector
https://mcp.breachspider.com/mcp
# local
pipx install breachspider-mcp
Free trial: 14 days, 750 device checks, no card.
Page facts from NVD, MITRE, CISA and vendor advisories, record last modified 2026-06-17.