CVE-2022-50568
usb: gadget: f_hid: fix f_hidg lifetime vs cdev
Mitigation
- Upgrade Linux to 89ff3dfac604614287ad5aad9370c3f984ea3f4b or later.
Who should check
- Anyone running Linux >= 71adf118946957839a13aa4d1094183e05c6c094, < 1cd7f156f6389918f760687fbbf133c86da93162; >= 71adf118946957839a13aa4d1094183e05c6c094, < c78c87c4e389b62f8892af7f59857447aa6d9797; >= 71adf118946957839a13aa4d1094183e05c6c094, < 1b6a53e447ec3d81623610c8c7ec5082b47dfdce; >= 71adf118946957839a13aa4d1094183e05c6c094, < d3136b79705c2e3bba9c76adc5628af0215d798e; >= 71adf118946957839a13aa4d1094183e05c6c094, < 9e4b85d815b14bd4db2deea2a54264a23de8b896; >= 71adf118946957839a13aa4d1094183e05c6c094, < 9e08b7f5fa00e9d550851352bd0d1ba74ccffef2; >= 71adf118946957839a13aa4d1094183e05c6c094, < 89ff3dfac604614287ad5aad9370c3f984ea3f4b
- Anyone running Linux 2.6.35
Vulnerability facts
- Affected
- Linux >= 71adf118946957839a13aa4d1094183e05c6c094, < 1cd7f156f6389918f760687fbbf133c86da93162; >= 71adf118946957839a13aa4d1094183e05c6c094, < c78c87c4e389b62f8892af7f59857447aa6d9797; >= 71adf118946957839a13aa4d1094183e05c6c094, < 1b6a53e447ec3d81623610c8c7ec5082b47dfdce; >= 71adf118946957839a13aa4d1094183e05c6c094, < d3136b79705c2e3bba9c76adc5628af0215d798e; >= 71adf118946957839a13aa4d1094183e05c6c094, < 9e4b85d815b14bd4db2deea2a54264a23de8b896; >= 71adf118946957839a13aa4d1094183e05c6c094, < 9e08b7f5fa00e9d550851352bd0d1ba74ccffef2; >= 71adf118946957839a13aa4d1094183e05c6c094, < 89ff3dfac604614287ad5aad9370c3f984ea3f4b; Linux 2.6.35
- Fixed in
- Linux 1cd7f156f6389918f760687fbbf133c86da93162, Linux 1b6a53e447ec3d81623610c8c7ec5082b47dfdce, Linux 9e4b85d815b14bd4db2deea2a54264a23de8b896, Linux 9e08b7f5fa00e9d550851352bd0d1ba74ccffef2, Linux 89ff3dfac604614287ad5aad9370c3f984ea3f4b
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Unknown
- CVSS
- Not scored yet
- EPSS
- 0.29% chance of exploitation in 30 days (percentile 14, 2026-11-26)
- Modified
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.
Affected and fixed versions
| Package / product | Affected | Fixed | Source |
|---|---|---|---|
| Linux | >= 71adf118946957839a13aa4d1094183e05c6c094, < 1cd7f156f6389918f760687fbbf133c86da93162; >= 71adf118946957839a13aa4d1094183e05c6c094, < c78c87c4e389b62f8892af7f59857447aa6d9797; >= 71adf118946957839a13aa4d1094183e05c6c094, < 1b6a53e447ec3d81623610c8c7ec5082b47dfdce; >= 71adf118946957839a13aa4d1094183e05c6c094, < d3136b79705c2e3bba9c76adc5628af0215d798e; >= 71adf118946957839a13aa4d1094183e05c6c094, < 9e4b85d815b14bd4db2deea2a54264a23de8b896; >= 71adf118946957839a13aa4d1094183e05c6c094, < 9e08b7f5fa00e9d550851352bd0d1ba74ccffef2; >= 71adf118946957839a13aa4d1094183e05c6c094, < 89ff3dfac604614287ad5aad9370c3f984ea3f4b | — | cvelist |
| Linux | 2.6.35 | — | cvelist |
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2022-50568. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2022-50568.md Affected: Linux >= 71adf118946957839a13aa4d1094183e05c6c094, < 1cd7f156f6389918f760687fbbf133c86da93162; >= 71adf118946957839a13aa4d1094183e05c6c094, < c78c87c4e389b62f8892af7f59857447aa6d9797; >= 71adf118946957839a13aa4d1094183e05c6c094, < 1b6a53e447ec3d81623610c8c7ec5082b47dfdce; >= 71adf118946957839a13aa4… Fixed in: Linux 1cd7f156f6389918f760687fbbf133c86da93162, Linux 1b6a53e447ec3d81623610c8c7ec5082b47dfdce, Linux 9e4b85d815b14bd4db2deea2a54264a23de8b896, Linux 9e08b7f5fa00e9d550851352bd0d1ba74ccffef2, Linux 89ff3dfac604614287ad5aad9370c3f984ea3f4b Steps: 1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
References
Other
- https://git.kernel.org/stable/c/1cd7f156f6389918f760687fbbf133c86da93162
- https://git.kernel.org/stable/c/c78c87c4e389b62f8892af7f59857447aa6d9797
- https://git.kernel.org/stable/c/1b6a53e447ec3d81623610c8c7ec5082b47dfdce
- https://git.kernel.org/stable/c/d3136b79705c2e3bba9c76adc5628af0215d798e
- https://git.kernel.org/stable/c/9e4b85d815b14bd4db2deea2a54264a23de8b896
- https://git.kernel.org/stable/c/9e08b7f5fa00e9d550851352bd0d1ba74ccffef2
- https://git.kernel.org/stable/c/89ff3dfac604614287ad5aad9370c3f984ea3f4b
FAQ
Is CVE-2022-50568 being exploited?
There is no confirmed exploitation: CVE-2022-50568 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.29% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2022-50568?
It has no CVSS score yet. Unknown.
Which versions are affected by CVE-2022-50568?
Linux >= 71adf118946957839a13aa4d1094183e05c6c094, < 1cd7f156f6389918f760687fbbf133c86da93162; >= 71adf118946957839a13aa4d1094183e05c6c094, < c78c87c4e389b62f8892af7f59857447aa6d9797; >= 71adf118946957839a13aa4d1094183e05c6c094, < 1b6a53e447ec3d81623610c8c7ec5082b47dfdce; >= 71adf118946957839a13aa4d1094183e05c6c094, < d3136b79705c2e3bba9c76adc5628af0215d798e; >= 71adf118946957839a13aa4d1094183e05c6c094, < 9e4b85d815b14bd4db2deea2a54264a23de8b896; >= 71adf118946957839a13aa4d1094183e05c6c094, < 9e08b7f5fa00e9d550851352bd0d1ba74ccffef2; >= 71adf118946957839a13aa4d1094183e05c6c094, < 89ff3dfac604614287ad5aad9370c3f984ea3f4b; Linux 2.6.35.
Is there a fix for CVE-2022-50568?
Yes. Fixed in Linux 1cd7f156f6389918f760687fbbf133c86da93162, Linux 1b6a53e447ec3d81623610c8c7ec5082b47dfdce, Linux 9e4b85d815b14bd4db2deea2a54264a23de8b896, Linux 9e08b7f5fa00e9d550851352bd0d1ba74ccffef2, Linux 89ff3dfac604614287ad5aad9370c3f984ea3f4b. Upgrade Linux to 89ff3dfac604614287ad5aad9370c3f984ea3f4b or later.
How do I check if I'm affected by CVE-2022-50568?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.