CVE-2026-98971: gpio: exar: initialize the ID before registering its cleanup
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
gpio: exar: initialize the ID before registering its cleanup
devm_add_action_or_reset() invokes the cleanup action immediately when registering the action fails. gpio_exar_probe() currently stores the allocated ID in exar_gpio only after registering the action, so that failure makes exar_devm_ida_free() release ID 0. If the allocated ID is nonzero, this leaks that ID and can free ID 0 belonging to another device.
Store the ID before registering the cleanup action so both the immediate failure path and normal device teardown release the correct allocation.
The Linux kernel CVE team has assigned CVE-2026-98971 to this issue.
Affected and fixed versions
===========================
Issue introduced in 5.11 with commit 5300ebb695fa0672589ab191062392f686fca75d and fixed in 6.6.160 with commit bf3d841ef12fcbec4458e2750956b738b043a226 Issue introduced in 5.11 with commit 5300ebb695fa0672589ab191062392f686fca75d and fixed in 6.12.113 with commit b78c114600ae3df90c083c72c290437b068577c8 Issue introduced in 5.11 with commit 5300ebb695fa0672589ab191062392f686fca75d and fixed in 6.18.57 with commit 01318927a9055136c207399eeb36ce07becac179 Issue introduced in 5.11 with commit 5300ebb695fa0672589ab191062392f686fca75d and fixed in 7.2.11 with commit f7ec4dbd2a073dd53b6349be1c586fe8580dd6b2 Issue introduced in 5.11 with commit 5300ebb695fa0672589ab191062392f686fca75d and fixed in 7.3 with commit 4d69e74034b208588636ecc177e0dd43a7696af3
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2026-98971
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
drivers/gpio/gpio-exar.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/bf3d841ef12fcbec4458e2750956b738b043a226 https://git.kernel.org/stable/c/b78c114600ae3df90c083c72c290437b068577c8 https://git.kernel.org/stable/c/01318927a9055136c207399eeb36ce07becac179 https://git.kernel.org/stable/c/f7ec4dbd2a073dd53b6349be1c586fe8580dd6b2 https://git.kernel.org/stable/c/4d69e74034b208588636ecc177e0dd43a7696af3