U.S. flag   An official website of the United States government
Dot gov

Official websites use .gov
A .gov website belongs to an official government organization in the United States.

Https

Secure .gov websites use HTTPS
A lock (Dot gov) or https:// means you've safely connected to the .gov website. Share sensitive information only on official, secure websites.

CVE-2022-50568 Detail

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.


Metrics

NVD enrichment efforts reference publicly available information to associate vector strings. CVSS information contributed by other sources is also displayed.
CVSS 4.0 Severity and Vector Strings:

NIST CVSS score
NIST: NVD
N/A
NVD assessment not yet provided.

References to Advisories, Solutions, and Tools

By selecting these links, you will be leaving NIST webspace. We have provided these links to other web sites because they may have information that would be of interest to you. No inferences should be drawn on account of other sites being referenced, or not, from this page. There may be other web sites that are more appropriate for your purpose. NIST does not necessarily endorse the views expressed, or concur with the facts presented on these sites. Further, NIST does not endorse any commercial products that may be mentioned on these sites. Please address comments about this page to [email protected].

URL Source(s) Tag(s)
https://git.kernel.org/stable/c/1b6a53e447ec3d81623610c8c7ec5082b47dfdce kernel.org
https://git.kernel.org/stable/c/1cd7f156f6389918f760687fbbf133c86da93162 kernel.org
https://git.kernel.org/stable/c/89ff3dfac604614287ad5aad9370c3f984ea3f4b kernel.org
https://git.kernel.org/stable/c/9e08b7f5fa00e9d550851352bd0d1ba74ccffef2 kernel.org
https://git.kernel.org/stable/c/9e4b85d815b14bd4db2deea2a54264a23de8b896 kernel.org
https://git.kernel.org/stable/c/c78c87c4e389b62f8892af7f59857447aa6d9797 kernel.org
https://git.kernel.org/stable/c/d3136b79705c2e3bba9c76adc5628af0215d798e kernel.org

Weakness Enumeration

CWE-ID CWE Name Source

Change History

1 change records found show changes

Quick Info

CVE Dictionary Entry:
CVE-2022-50568
NVD Published Date:
10/22/2025
NVD Last Modified:
10/22/2025
Source:
kernel.org