CVE-2026-31732 (GCVE-0-2026-31732)
Vulnerability from cvelistv5
Published
2026-05-01 14:14
Modified
2026-07-04 11:50
Severity ?
Summary
In the Linux kernel, the following vulnerability has been resolved: gpio: Fix resource leaks on errors in gpiochip_add_data_with_key() Since commit aab5c6f20023 ("gpio: set device type for GPIO chips"), `gdev->dev.release` is unset. As a result, the reference count to `gdev->dev` isn't dropped on the error handling paths. Drop the reference on errors. Also reorder the instructions to make the error handling simpler. Now gpiochip_add_data_with_key() roughly looks like: >>> Some memory allocation. Go to ERR ZONE 1 on errors. >>> device_initialize(). gpiodev_release() takes over the responsibility for freeing the resources of `gdev->dev`. The subsequent error handling paths shouldn't go through ERR ZONE 1 again which leads to double free. >>> Some initialization mainly on `gdev`. >>> The rest of initialization. Go to ERR ZONE 2 on errors. >>> Chip registration success and exit. >>> ERR ZONE 2. gpio_device_put() and exit. >>> ERR ZONE 1.
Impacted products
Vendor Product Version
Linux Linux Version: aab5c6f200238ac45001bec3d5494fff8438a8dc
Version: aab5c6f200238ac45001bec3d5494fff8438a8dc
Version: aab5c6f200238ac45001bec3d5494fff8438a8dc
Version: aab5c6f200238ac45001bec3d5494fff8438a8dc
Create a notification for this product.
Show details on NVD website


{
  "containers": {
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "drivers/gpio/gpiolib.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "a500e1837c4266ddb05b39b3e1cc71f49a43ffa5",
              "status": "affected",
              "version": "aab5c6f200238ac45001bec3d5494fff8438a8dc",
              "versionType": "git"
            },
            {
              "lessThan": "f0cf9c7b7c281956cc0dec163132cd96f76e1d60",
              "status": "affected",
              "version": "aab5c6f200238ac45001bec3d5494fff8438a8dc",
              "versionType": "git"
            },
            {
              "lessThan": "fb4584d2b324c522404c733c65840a1a6519ada8",
              "status": "affected",
              "version": "aab5c6f200238ac45001bec3d5494fff8438a8dc",
              "versionType": "git"
            },
            {
              "lessThan": "16fdabe143fce2cbf89139677728e17e21b46c28",
              "status": "affected",
              "version": "aab5c6f200238ac45001bec3d5494fff8438a8dc",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "drivers/gpio/gpiolib.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "6.9"
            },
            {
              "lessThan": "6.9",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.12.*",
              "status": "unaffected",
              "version": "6.12.95",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.18.*",
              "status": "unaffected",
              "version": "6.18.22",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.19.*",
              "status": "unaffected",
              "version": "6.19.12",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "7.0",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.12.95",
                  "versionStartIncluding": "6.9",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.18.22",
                  "versionStartIncluding": "6.9",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.19.12",
                  "versionStartIncluding": "6.9",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "7.0",
                  "versionStartIncluding": "6.9",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\ngpio: Fix resource leaks on errors in gpiochip_add_data_with_key()\n\nSince commit aab5c6f20023 (\"gpio: set device type for GPIO chips\"),\n`gdev-\u003edev.release` is unset.  As a result, the reference count to\n`gdev-\u003edev` isn\u0027t dropped on the error handling paths.\n\nDrop the reference on errors.\n\nAlso reorder the instructions to make the error handling simpler.\nNow gpiochip_add_data_with_key() roughly looks like:\n\n   \u003e\u003e\u003e Some memory allocation.  Go to ERR ZONE 1 on errors.\n   \u003e\u003e\u003e device_initialize().\n\n   gpiodev_release() takes over the responsibility for freeing the\n   resources of `gdev-\u003edev`.  The subsequent error handling paths\n   shouldn\u0027t go through ERR ZONE 1 again which leads to double free.\n\n   \u003e\u003e\u003e Some initialization mainly on `gdev`.\n   \u003e\u003e\u003e The rest of initialization.  Go to ERR ZONE 2 on errors.\n   \u003e\u003e\u003e Chip registration success and exit.\n\n   \u003e\u003e\u003e ERR ZONE 2.  gpio_device_put() and exit.\n   \u003e\u003e\u003e ERR ZONE 1."
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-07-04T11:50:32.706Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/a500e1837c4266ddb05b39b3e1cc71f49a43ffa5"
        },
        {
          "url": "https://git.kernel.org/stable/c/f0cf9c7b7c281956cc0dec163132cd96f76e1d60"
        },
        {
          "url": "https://git.kernel.org/stable/c/fb4584d2b324c522404c733c65840a1a6519ada8"
        },
        {
          "url": "https://git.kernel.org/stable/c/16fdabe143fce2cbf89139677728e17e21b46c28"
        }
      ],
      "title": "gpio: Fix resource leaks on errors in gpiochip_add_data_with_key()",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2026-31732",
    "datePublished": "2026-05-01T14:14:30.844Z",
    "dateReserved": "2026-03-09T15:48:24.137Z",
    "dateUpdated": "2026-07-04T11:50:32.706Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2"
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
  • Confirmed: The vulnerability is confirmed from an analyst perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
  • Patched: This vulnerability was successfully patched by the user reporting the sighting.
  • Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
  • Not confirmed: The user expresses doubt about the veracity of the vulnerability.
  • Not patched: This vulnerability was not successfully patched by the user reporting the sighting.


Loading…

Loading…