CVE-2026-143246

Source
https://cve.org/CVERecord?id=CVE-2026-143246
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-143246.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2026-143246
Downstream
Published
2026-12-03T09:20:56Z
Modified
2026-12-03T11:01:47Z
Summary
gpiolib: fix GPIO descriptor leak in gpiod_get_array()
Details

In the Linux kernel, the following vulnerability has been resolved:

gpiolib: fix GPIO descriptor leak in gpiod_get_array()

In gpiod_get_array(), descs->ndescs is used as the loop induction variable and is only incremented at the end of each iteration. When krealloc() fails on the first iteration (when index is 0), descs->desc[0] has already been acquired via gpiod_get_index(), but descs->ndescs is still 0. Consequently, gpiod_put_array() frees descs without releasing descs->desc[0], leaking the descriptor.

Fix this by using a dedicated loop induction variable and incrementing descs->ndescs immediately upon storing the retrieved descriptor. Additionally, since the fast-path array_info setup only executes for the first element (index 0), simplify the bitmap_set() calls to start at bit 0 for count bits instead of calculating offsets from the loop index.

Database specific
{
    "cna_assigner":  "Linux",
    "osv_generated_from":  "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/143xxx/CVE-2026-143246.json"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
bf9346f5d47b4506aafbc384dfb5796b0adc3f8d
Fixed
5e22a760a23ee3298b525b1bc6b0647272d6bf4b
Fixed
233b889db63c316ec558db34ae15dcb4784dc39f
Fixed
b2a161687acdc297aa91fec7fa0966b5aecf0d16

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-143246.json"

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
4.20.0
Fixed
6.18.66
Type
ECOSYSTEM
Events
Introduced
6.19.0
Fixed
7.3.7

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-143246.json"