{
    "dataType": "CVE_RECORD",
    "dataVersion": "5.2",
    "cveMetadata": {
        "cveId": "CVE-2026-31732",
        "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "state": "PUBLISHED",
        "assignerShortName": "Linux",
        "dateReserved": "2026-03-09T15:48:24.137Z",
        "datePublished": "2026-05-01T14:14:30.844Z",
        "dateUpdated": "2026-07-04T11:50:32.706Z"
    },
    "containers": {
        "cna": {
            "providerMetadata": {
                "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
                "shortName": "Linux",
                "dateUpdated": "2026-07-04T11:50:32.706Z"
            },
            "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->dev.release` is unset.  As a result, the reference count to\n`gdev->dev` isn't 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   >>> Some memory allocation.  Go to ERR ZONE 1 on errors.\n   >>> device_initialize().\n\n   gpiodev_release() takes over the responsibility for freeing the\n   resources of `gdev->dev`.  The subsequent error handling paths\n   shouldn't go through ERR ZONE 1 again which leads to double free.\n\n   >>> Some initialization mainly on `gdev`.\n   >>> The rest of initialization.  Go to ERR ZONE 2 on errors.\n   >>> Chip registration success and exit.\n\n   >>> ERR ZONE 2.  gpio_device_put() and exit.\n   >>> ERR ZONE 1."
                }
            ],
            "affected": [
                {
                    "product": "Linux",
                    "vendor": "Linux",
                    "defaultStatus": "unaffected",
                    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                    "programFiles": [
                        "drivers/gpio/gpiolib.c"
                    ],
                    "versions": [
                        {
                            "version": "aab5c6f200238ac45001bec3d5494fff8438a8dc",
                            "lessThan": "a500e1837c4266ddb05b39b3e1cc71f49a43ffa5",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "aab5c6f200238ac45001bec3d5494fff8438a8dc",
                            "lessThan": "f0cf9c7b7c281956cc0dec163132cd96f76e1d60",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "aab5c6f200238ac45001bec3d5494fff8438a8dc",
                            "lessThan": "fb4584d2b324c522404c733c65840a1a6519ada8",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "aab5c6f200238ac45001bec3d5494fff8438a8dc",
                            "lessThan": "16fdabe143fce2cbf89139677728e17e21b46c28",
                            "status": "affected",
                            "versionType": "git"
                        }
                    ]
                },
                {
                    "product": "Linux",
                    "vendor": "Linux",
                    "defaultStatus": "affected",
                    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                    "programFiles": [
                        "drivers/gpio/gpiolib.c"
                    ],
                    "versions": [
                        {
                            "version": "6.9",
                            "status": "affected"
                        },
                        {
                            "version": "0",
                            "lessThan": "6.9",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.12.95",
                            "lessThanOrEqual": "6.12.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.18.22",
                            "lessThanOrEqual": "6.18.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.19.12",
                            "lessThanOrEqual": "6.19.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "7.0",
                            "lessThanOrEqual": "*",
                            "status": "unaffected",
                            "versionType": "original_commit_for_fix"
                        }
                    ]
                }
            ],
            "cpeApplicability": [
                {
                    "nodes": [
                        {
                            "operator": "OR",
                            "negate": false,
                            "cpeMatch": [
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "6.9",
                                    "versionEndExcluding": "6.12.95"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "6.9",
                                    "versionEndExcluding": "6.18.22"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "6.9",
                                    "versionEndExcluding": "6.19.12"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "6.9",
                                    "versionEndExcluding": "7.0"
                                }
                            ]
                        }
                    ]
                }
            ],
            "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"
            }
        }
    }
}