AZL-118409: CVE-2026-143246 affecting package kernel 6.6.161.1-1
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
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In gpiod_get_array(), use a dedicated loop induction variable instead of descs->ndescs, and update descs->ndescs immediately after storing each retrieved descriptor so cleanup includes it if a later operation fails. For the first-element fast path, simplify bitmap_set() calls to start at bit 0 for the count bits.
Event History
Frequently Asked Questions
What conditions are required to trigger the descriptor leak?
The failure path requires gpiod_get_array() to acquire the first GPIO descriptor and then have krealloc() fail during that first iteration. In that case, the descriptor is stored but not counted, so cleanup does not release it.
What is the practical impact of the flaw?
The affected error path leaks a GPIO descriptor. The provided information describes a resource leak and does not establish code execution, privilege escalation, or data exposure.
How can I determine whether my system is affected?
The supplied package information identifies kernel version 6.6.161.1-1. Systems using that package should be evaluated for exposure to the gpiod_get_array() allocation-failure path.