# CVE-2022-50568: usb: gadget: f\_hid: fix f\_hidg lifetime vs cdev

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** UNSCORED
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Unknown
- **EPSS:** 0.29% (percentile 14, 2026-11-26)
- **Published:** 2025-10-22T13:23:25.136Z
- **Modified:** 2026-06-17T05:23:48.470Z

## 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

## 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

- Linux: \>= 71adf118946957839a13aa4d1094183e05c6c094, \< 1cd7f156f6389918f760687fbbf133c86da93162; \>= 71adf118946957839a13aa4d1094183e05c6c094, \< c78c87c4e389b62f8892af7f59857447aa6d9797; \>= 71adf118946957839a13aa4d1094183e05c6c094, \< 1b6a53e447ec3d81623610c8c7ec5082b47dfdce; \>= 71adf118946957839a13aa4d1094183e05c6c094, \< d3136b79705c2e3bba9c76adc5628af0215d798e; \>= 71adf118946957839a13aa4d1094183e05c6c094, \< 9e4b85d815b14bd4db2deea2a54264a23de8b896; \>= 71adf118946957839a13aa4d1094183e05c6c094, \< 9e08b7f5fa00e9d550851352bd0d1ba74ccffef2; \>= 71adf118946957839a13aa4d1094183e05c6c094, \< 89ff3dfac604614287ad5aad9370c3f984ea3f4b (cvelist)
- Linux: 2.6.35 (cvelist)

## Mitigation

- Upgrade Linux to 89ff3dfac604614287ad5aad9370c3f984ea3f4b or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
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.
```

## 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.

## References

- other: <https://git.kernel.org/stable/c/1cd7f156f6389918f760687fbbf133c86da93162>
- other: <https://git.kernel.org/stable/c/c78c87c4e389b62f8892af7f59857447aa6d9797>
- other: <https://git.kernel.org/stable/c/1b6a53e447ec3d81623610c8c7ec5082b47dfdce>
- other: <https://git.kernel.org/stable/c/d3136b79705c2e3bba9c76adc5628af0215d798e>
- other: <https://git.kernel.org/stable/c/9e4b85d815b14bd4db2deea2a54264a23de8b896>
- other: <https://git.kernel.org/stable/c/9e08b7f5fa00e9d550851352bd0d1ba74ccffef2>
- other: <https://git.kernel.org/stable/c/89ff3dfac604614287ad5aad9370c3f984ea3f4b>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2022-50568>

HTML: <https://flawdb.com/CVE-2022-50568> · JSON: <https://flawdb.com/api/v1/entries/CVE-2022-50568>
