CVE-2026-143246: gpiolib: fix GPIO descriptor leak in gpiod_get_array()

Published Dec 3, 2026
·
Updated

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

gpiolib: fix GPIO descriptor leak in gpiodgetarray()

In gpiodgetarray(), 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 gpiodgetindex(), but descs->ndescs is still 0. Consequently, gpiodputarray() 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 arrayinfo setup only executes for the first element (index 0), simplify the bitmapset() calls to start at bit 0 for count bits instead of calculating offsets from the loop index.

Affected Software

3 affected componentsFixes available
Linux Linux kernel
linux/kernel>=4.20.0<6.18.66
6.18.66
linux/kernel>=6.19.0<7.3.7
7.3.7

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 6.18.66
  2. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 7.3.7

Event History

Dec 3, 2026
CVE Published
via MITRE·09:20 AM
Data Sourced
via MITRE·09:20 AM
Description
Data Sourced
via OSV·09:20 AM
DescriptionAffected Software
Data Sourced
via NVD·10:18 AM
Description

Frequently Asked Questions

1

What condition is required to trigger the descriptor leak?

The allocation growth operation, krealloc(), must fail during the first iteration of gpiod_get_array(), after gpiod_get_index() has acquired the first GPIO descriptor. In that path, the descriptor count remains zero, so cleanup does not release the acquired descriptor.

2

How can I determine whether a kernel includes the fix?

Check whether the kernel source contains the gpiod_get_array() change that uses a dedicated loop index and increments descs->ndescs immediately after storing a retrieved descriptor. The provided stable references identify commits containing the fix.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203