{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2022-50568","id":"CVE-2022-50568","title":"usb: gadget: f_hid: fix f_hidg lifetime vs cdev","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nusb: gadget: f_hid: fix f_hidg lifetime vs cdev\n\nThe embedded struct cdev does not have its lifetime correctly tied to\nthe enclosing struct f_hidg, so there is a use-after-free if /dev/hidgN\nis held open while the gadget is deleted.\n\nThis can readily be replicated with libusbgx's example programs (for\nconciseness - operating dire","descriptionLong":"In the Linux kernel, the following vulnerability has been resolved:\n\nusb: gadget: f_hid: fix f_hidg lifetime vs cdev\n\nThe embedded struct cdev does not have its lifetime correctly tied to\nthe enclosing struct f_hidg, so there is a use-after-free if /dev/hidgN\nis held open while the gadget is deleted.\n\nThis can readily be replicated with libusbgx's example programs (for\nconciseness - operating directly via configfs is equivalent):\n\n\tgadget-hid\n\texec 3<> /dev/hidg0\n\tgadget-vid-pid-remove\n\texec 3<&-\n\nPull the existing device up in to struct f_hidg and make use of the\ncdev_device_{add,del}() helpers.  This changes the lifetime of the\ndevice object to match struct f_hidg, but note that it is still added\nand deleted at the same time.","published":"2025-10-22T13:23:25.136Z","updated":"2026-10-28T02:30:54.260866108Z","reserved":"2025-10-22T13:20:23.760Z","status":"Deferred","rejected":false,"assigner":"Linux","metric":null,"metrics":[],"rating":"unrated","products":["Linux"],"affectedProducts":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"71adf118946957839a13aa4d1094183e05c6c094","lessThan":"1cd7f156f6389918f760687fbbf133c86da93162","status":"affected","versionType":"git"},{"version":"71adf118946957839a13aa4d1094183e05c6c094","lessThan":"c78c87c4e389b62f8892af7f59857447aa6d9797","status":"affected","versionType":"git"},{"version":"71adf118946957839a13aa4d1094183e05c6c094","lessThan":"1b6a53e447ec3d81623610c8c7ec5082b47dfdce","status":"affected","versionType":"git"},{"version":"71adf118946957839a13aa4d1094183e05c6c094","lessThan":"d3136b79705c2e3bba9c76adc5628af0215d798e","status":"affected","versionType":"git"},{"version":"71adf118946957839a13aa4d1094183e05c6c094","lessThan":"9e4b85d815b14bd4db2deea2a54264a23de8b896","status":"affected","versionType":"git"},{"version":"71adf118946957839a13aa4d1094183e05c6c094","lessThan":"9e08b7f5fa00e9d550851352bd0d1ba74ccffef2","status":"affected","versionType":"git"},{"version":"71adf118946957839a13aa4d1094183e05c6c094","lessThan":"89ff3dfac604614287ad5aad9370c3f984ea3f4b","status":"affected","versionType":"git"}],"platforms":[]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"2.6.35","status":"affected"},{"version":"0","lessThan":"2.6.35","status":"unaffected","versionType":"semver"},{"version":"4.19.270","lessThanOrEqual":"4.19.*","status":"unaffected","versionType":"semver"},{"version":"5.4.229","lessThanOrEqual":"5.4.*","status":"unaffected","versionType":"semver"},{"version":"5.10.163","lessThanOrEqual":"5.10.*","status":"unaffected","versionType":"semver"},{"version":"5.15.86","lessThanOrEqual":"5.15.*","status":"unaffected","versionType":"semver"},{"version":"6.0.16","lessThanOrEqual":"6.0.*","status":"unaffected","versionType":"semver"},{"version":"6.1.2","lessThanOrEqual":"6.1.*","status":"unaffected","versionType":"semver"},{"version":"6.2","lessThanOrEqual":"*","status":"unaffected","versionType":"original_commit_for_fix"}],"platforms":[]}],"packages":[],"cwes":[],"aliases":[],"references":[{"url":"https://git.kernel.org/stable/c/1cd7f156f6389918f760687fbbf133c86da93162","tags":["web"]},{"url":"https://git.kernel.org/stable/c/c78c87c4e389b62f8892af7f59857447aa6d9797","tags":["web"]},{"url":"https://git.kernel.org/stable/c/1b6a53e447ec3d81623610c8c7ec5082b47dfdce","tags":["web"]},{"url":"https://git.kernel.org/stable/c/d3136b79705c2e3bba9c76adc5628af0215d798e","tags":["web"]},{"url":"https://git.kernel.org/stable/c/9e4b85d815b14bd4db2deea2a54264a23de8b896","tags":["web"]},{"url":"https://git.kernel.org/stable/c/9e08b7f5fa00e9d550851352bd0d1ba74ccffef2","tags":["web"]},{"url":"https://git.kernel.org/stable/c/89ff3dfac604614287ad5aad9370c3f984ea3f4b","tags":["web"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/50xxx/CVE-2022-50568.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-50568","tags":["advisory"]},{"url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","tags":["package"]}],"patchReferenced":false,"fixAvailable":false,"exploitReferenced":false,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":null,"epss":0.0022,"epssPercentile":0.12649,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2022-50568","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-50568","ok":true,"note":"Deferred"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2022-50568","ok":true,"note":"0 packages"},{"name":"CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","ok":true,"note":"not listed"},{"name":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2022-50568","ok":true,"note":"scored 2026-11-19"}],"aiTitle":false,"tech":[],"critical":[],"attention":null}