CVE-2026-31732 (GCVE-0-2026-31732)
Vulnerability from cvelistv5 – Published: 2026-05-01 14:14 – Updated: 2026-05-01 14:14
VLAI?
Title
gpio: Fix resource leaks on errors in gpiochip_add_data_with_key()
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.
Severity ?
No CVSS data available.
Assigner
References
Impacted products
| Vendor | Product | Version | ||
|---|---|---|---|---|
| Linux | Linux |
Affected:
aab5c6f200238ac45001bec3d5494fff8438a8dc , < f0cf9c7b7c281956cc0dec163132cd96f76e1d60
(git)
Affected: aab5c6f200238ac45001bec3d5494fff8438a8dc , < fb4584d2b324c522404c733c65840a1a6519ada8 (git) Affected: aab5c6f200238ac45001bec3d5494fff8438a8dc , < 16fdabe143fce2cbf89139677728e17e21b46c28 (git) |
||
{
"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": "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.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.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-05-01T14:14:30.844Z",
"orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
"shortName": "Linux"
},
"references": [
{
"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-05-01T14:14:30.844Z",
"state": "PUBLISHED"
},
"dataType": "CVE_RECORD",
"dataVersion": "5.2",
"vulnerability-lookup:meta": {
"epss": {
"cve": "CVE-2026-31732",
"date": "2026-05-05",
"epss": "0.00017",
"percentile": "0.04061"
},
"nvd": "{\"cve\":{\"id\":\"CVE-2026-31732\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2026-05-01T15:16:35.807\",\"lastModified\":\"2026-05-01T15:24:14.893\",\"vulnStatus\":\"Awaiting Analysis\",\"cveTags\":[],\"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.\"}],\"metrics\":{},\"references\":[{\"url\":\"https://git.kernel.org/stable/c/16fdabe143fce2cbf89139677728e17e21b46c28\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/f0cf9c7b7c281956cc0dec163132cd96f76e1d60\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/fb4584d2b324c522404c733c65840a1a6519ada8\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"}]}}"
}
}
Loading…
Loading…
Experimental. This forecast is provided for visualization only and may change without notice. Do not use it for operational decisions.
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…
Loading…