GCVE Workshop - 22 September 2026 (14:00-18:00), Luxembourg Before The Vulnopticon Conference - Registration

CVE-2022-50568 (GCVE-0-2022-50568)

Vulnerability from cvelistv5 – Published: 2025-10-22 13:23 – Updated: 2026-05-11 19:21
VLAI
Title
usb: gadget: f_hid: fix f_hidg lifetime vs cdev
Summary
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.
Severity
No CVSS data available.
Impacted products
Vendor Product Version CPE status
Linux Linux Affected: 71adf118946957839a13aa4d1094183e05c6c094 , < 1cd7f156f6389918f760687fbbf133c86da93162 (git)
Affected: 71adf118946957839a13aa4d1094183e05c6c094 , < c78c87c4e389b62f8892af7f59857447aa6d9797 (git)
Affected: 71adf118946957839a13aa4d1094183e05c6c094 , < 1b6a53e447ec3d81623610c8c7ec5082b47dfdce (git)
Affected: 71adf118946957839a13aa4d1094183e05c6c094 , < d3136b79705c2e3bba9c76adc5628af0215d798e (git)
Affected: 71adf118946957839a13aa4d1094183e05c6c094 , < 9e4b85d815b14bd4db2deea2a54264a23de8b896 (git)
Affected: 71adf118946957839a13aa4d1094183e05c6c094 , < 9e08b7f5fa00e9d550851352bd0d1ba74ccffef2 (git)
Affected: 71adf118946957839a13aa4d1094183e05c6c094 , < 89ff3dfac604614287ad5aad9370c3f984ea3f4b (git)
guessed Create a notification for this product.
Linux Linux Affected: 2.6.35
Unaffected: 0 , < 2.6.35 (semver)
Unaffected: 4.19.270 , ≤ 4.19.* (semver)
Unaffected: 5.4.229 , ≤ 5.4.* (semver)
Unaffected: 5.10.163 , ≤ 5.10.* (semver)
Unaffected: 5.15.86 , ≤ 5.15.* (semver)
Unaffected: 6.0.16 , ≤ 6.0.* (semver)
Unaffected: 6.1.2 , ≤ 6.1.* (semver)
Unaffected: 6.2 , ≤ * (original_commit_for_fix)
guessed Create a notification for this product.
Show details on NVD website

{
  "containers": {
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "drivers/usb/gadget/function/f_hid.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "1cd7f156f6389918f760687fbbf133c86da93162",
              "status": "affected",
              "version": "71adf118946957839a13aa4d1094183e05c6c094",
              "versionType": "git"
            },
            {
              "lessThan": "c78c87c4e389b62f8892af7f59857447aa6d9797",
              "status": "affected",
              "version": "71adf118946957839a13aa4d1094183e05c6c094",
              "versionType": "git"
            },
            {
              "lessThan": "1b6a53e447ec3d81623610c8c7ec5082b47dfdce",
              "status": "affected",
              "version": "71adf118946957839a13aa4d1094183e05c6c094",
              "versionType": "git"
            },
            {
              "lessThan": "d3136b79705c2e3bba9c76adc5628af0215d798e",
              "status": "affected",
              "version": "71adf118946957839a13aa4d1094183e05c6c094",
              "versionType": "git"
            },
            {
              "lessThan": "9e4b85d815b14bd4db2deea2a54264a23de8b896",
              "status": "affected",
              "version": "71adf118946957839a13aa4d1094183e05c6c094",
              "versionType": "git"
            },
            {
              "lessThan": "9e08b7f5fa00e9d550851352bd0d1ba74ccffef2",
              "status": "affected",
              "version": "71adf118946957839a13aa4d1094183e05c6c094",
              "versionType": "git"
            },
            {
              "lessThan": "89ff3dfac604614287ad5aad9370c3f984ea3f4b",
              "status": "affected",
              "version": "71adf118946957839a13aa4d1094183e05c6c094",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "drivers/usb/gadget/function/f_hid.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "2.6.35"
            },
            {
              "lessThan": "2.6.35",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "4.19.*",
              "status": "unaffected",
              "version": "4.19.270",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.4.*",
              "status": "unaffected",
              "version": "5.4.229",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.10.*",
              "status": "unaffected",
              "version": "5.10.163",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.15.*",
              "status": "unaffected",
              "version": "5.15.86",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.0.*",
              "status": "unaffected",
              "version": "6.0.16",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.1.*",
              "status": "unaffected",
              "version": "6.1.2",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.2",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "4.19.270",
                  "versionStartIncluding": "2.6.35",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.4.229",
                  "versionStartIncluding": "2.6.35",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.10.163",
                  "versionStartIncluding": "2.6.35",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.15.86",
                  "versionStartIncluding": "2.6.35",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.0.16",
                  "versionStartIncluding": "2.6.35",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.1.2",
                  "versionStartIncluding": "2.6.35",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.2",
                  "versionStartIncluding": "2.6.35",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "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\u0027s example programs (for\nconciseness - operating directly via configfs is equivalent):\n\n\tgadget-hid\n\texec 3\u003c\u003e /dev/hidg0\n\tgadget-vid-pid-remove\n\texec 3\u003c\u0026-\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."
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-05-11T19:21:56.354Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/1cd7f156f6389918f760687fbbf133c86da93162"
        },
        {
          "url": "https://git.kernel.org/stable/c/c78c87c4e389b62f8892af7f59857447aa6d9797"
        },
        {
          "url": "https://git.kernel.org/stable/c/1b6a53e447ec3d81623610c8c7ec5082b47dfdce"
        },
        {
          "url": "https://git.kernel.org/stable/c/d3136b79705c2e3bba9c76adc5628af0215d798e"
        },
        {
          "url": "https://git.kernel.org/stable/c/9e4b85d815b14bd4db2deea2a54264a23de8b896"
        },
        {
          "url": "https://git.kernel.org/stable/c/9e08b7f5fa00e9d550851352bd0d1ba74ccffef2"
        },
        {
          "url": "https://git.kernel.org/stable/c/89ff3dfac604614287ad5aad9370c3f984ea3f4b"
        }
      ],
      "title": "usb: gadget: f_hid: fix f_hidg lifetime vs cdev",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2022-50568",
    "datePublished": "2025-10-22T13:23:25.136Z",
    "dateReserved": "2025-10-22T13:20:23.760Z",
    "dateUpdated": "2026-05-11T19:21:56.354Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "vulnerability-lookup:meta": {
    "epss": {
      "cve": "CVE-2022-50568",
      "date": "2026-09-19",
      "epss": "0.00205",
      "percentile": "0.10834"
    },
    "nvd": {
      "cve": {
        "affected": [
          {
            "affectedData": [
              {
                "defaultStatus": "unaffected",
                "product": "Linux",
                "programFiles": [
                  "drivers/usb/gadget/function/f_hid.c"
                ],
                "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                "vendor": "Linux",
                "versions": [
                  {
                    "lessThan": "1cd7f156f6389918f760687fbbf133c86da93162",
                    "status": "affected",
                    "version": "71adf118946957839a13aa4d1094183e05c6c094",
                    "versionType": "git"
                  },
                  {
                    "lessThan": "c78c87c4e389b62f8892af7f59857447aa6d9797",
                    "status": "affected",
                    "version": "71adf118946957839a13aa4d1094183e05c6c094",
                    "versionType": "git"
                  },
                  {
                    "lessThan": "1b6a53e447ec3d81623610c8c7ec5082b47dfdce",
                    "status": "affected",
                    "version": "71adf118946957839a13aa4d1094183e05c6c094",
                    "versionType": "git"
                  },
                  {
                    "lessThan": "d3136b79705c2e3bba9c76adc5628af0215d798e",
                    "status": "affected",
                    "version": "71adf118946957839a13aa4d1094183e05c6c094",
                    "versionType": "git"
                  },
                  {
                    "lessThan": "9e4b85d815b14bd4db2deea2a54264a23de8b896",
                    "status": "affected",
                    "version": "71adf118946957839a13aa4d1094183e05c6c094",
                    "versionType": "git"
                  },
                  {
                    "lessThan": "9e08b7f5fa00e9d550851352bd0d1ba74ccffef2",
                    "status": "affected",
                    "version": "71adf118946957839a13aa4d1094183e05c6c094",
                    "versionType": "git"
                  },
                  {
                    "lessThan": "89ff3dfac604614287ad5aad9370c3f984ea3f4b",
                    "status": "affected",
                    "version": "71adf118946957839a13aa4d1094183e05c6c094",
                    "versionType": "git"
                  }
                ]
              },
              {
                "defaultStatus": "affected",
                "product": "Linux",
                "programFiles": [
                  "drivers/usb/gadget/function/f_hid.c"
                ],
                "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                "vendor": "Linux",
                "versions": [
                  {
                    "status": "affected",
                    "version": "2.6.35"
                  },
                  {
                    "lessThan": "2.6.35",
                    "status": "unaffected",
                    "version": "0",
                    "versionType": "semver"
                  },
                  {
                    "lessThanOrEqual": "4.19.*",
                    "status": "unaffected",
                    "version": "4.19.270",
                    "versionType": "semver"
                  },
                  {
                    "lessThanOrEqual": "5.4.*",
                    "status": "unaffected",
                    "version": "5.4.229",
                    "versionType": "semver"
                  },
                  {
                    "lessThanOrEqual": "5.10.*",
                    "status": "unaffected",
                    "version": "5.10.163",
                    "versionType": "semver"
                  },
                  {
                    "lessThanOrEqual": "5.15.*",
                    "status": "unaffected",
                    "version": "5.15.86",
                    "versionType": "semver"
                  },
                  {
                    "lessThanOrEqual": "6.0.*",
                    "status": "unaffected",
                    "version": "6.0.16",
                    "versionType": "semver"
                  },
                  {
                    "lessThanOrEqual": "6.1.*",
                    "status": "unaffected",
                    "version": "6.1.2",
                    "versionType": "semver"
                  },
                  {
                    "lessThanOrEqual": "*",
                    "status": "unaffected",
                    "version": "6.2",
                    "versionType": "original_commit_for_fix"
                  }
                ]
              }
            ],
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67"
          }
        ],
        "cveTags": [],
        "descriptions": [
          {
            "lang": "en",
            "value": "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\u0027s example programs (for\nconciseness - operating directly via configfs is equivalent):\n\n\tgadget-hid\n\texec 3\u003c\u003e /dev/hidg0\n\tgadget-vid-pid-remove\n\texec 3\u003c\u0026-\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."
          }
        ],
        "id": "CVE-2022-50568",
        "lastModified": "2026-06-17T05:23:48.470",
        "metrics": {},
        "published": "2025-10-22T14:15:41.657",
        "references": [
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "url": "https://git.kernel.org/stable/c/1b6a53e447ec3d81623610c8c7ec5082b47dfdce"
          },
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "url": "https://git.kernel.org/stable/c/1cd7f156f6389918f760687fbbf133c86da93162"
          },
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "url": "https://git.kernel.org/stable/c/89ff3dfac604614287ad5aad9370c3f984ea3f4b"
          },
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "url": "https://git.kernel.org/stable/c/9e08b7f5fa00e9d550851352bd0d1ba74ccffef2"
          },
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "url": "https://git.kernel.org/stable/c/9e4b85d815b14bd4db2deea2a54264a23de8b896"
          },
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "url": "https://git.kernel.org/stable/c/c78c87c4e389b62f8892af7f59857447aa6d9797"
          },
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "url": "https://git.kernel.org/stable/c/d3136b79705c2e3bba9c76adc5628af0215d798e"
          }
        ],
        "sourceIdentifier": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "vulnStatus": "Deferred"
      }
    },
    "redhat_vex": {
      "aggregate_severity": "None",
      "current_release_date": "2026-06-30T10:18:57+00:00",
      "cve": "CVE-2022-50568",
      "id": "CVE-2022-50568",
      "initial_release_date": "2022-01-01T00:00:00+00:00",
      "product_status:known_not_affected": "274",
      "source": "Red Hat CSAF VEX",
      "status": "final",
      "title": "kernel: usb: gadget: f_hid: fix f_hidg lifetime vs cdev",
      "url": "https://security.access.redhat.com/data/csaf/v2/vex/2022/cve-2022-50568.json",
      "version": "3"
    },
    "suse_vex": {
      "aggregate_severity": "moderate",
      "current_release_date": "2026-09-05T17:05:46Z",
      "cve": "CVE-2022-50568",
      "id": "CVE-2022-50568",
      "initial_release_date": "2025-10-25T00:14:51Z",
      "product_status:known_affected": "507",
      "product_status:known_not_affected": "233",
      "product_status:recommended": "196",
      "source": "SUSE CSAF VEX",
      "status": "interim",
      "title": "SUSE CVE CVE-2022-50568",
      "url": "https://ftp.suse.com/pub/projects/security/csaf-vex/cve-2022-50568.json",
      "version": "27"
    }
  }
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.

Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…

Related by attack behaviour

Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.


Loading…