CVE-2026-31745: reset: gpio: fix double free in reset_add_gpio_aux_device() error path
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
reset: gpio: fix double free in reset_add_gpio_aux_device() error path
When __auxiliary_device_add() fails, reset_add_gpio_aux_device() calls auxiliary_device_uninit(adev).
The device release callback reset_gpio_aux_device_release() frees adev, but the current error path then calls kfree(adev) again, causing a double free.
Keep kfree(adev) for the auxiliary_device_init() failure path, but avoid freeing adev after auxiliary_device_uninit().
The Linux kernel CVE team has assigned CVE-2026-31745 to this issue.
Affected and fixed versions
===========================
Issue introduced in 6.19 with commit 5fc4e4cf7a2268b5f73700fd1e8d02159f2417d8 and fixed in 6.19.12 with commit 1de465753220deb41569cf2add87bbb0673731db Issue introduced in 6.19 with commit 5fc4e4cf7a2268b5f73700fd1e8d02159f2417d8 and fixed in 7.0 with commit fbffb8c7c7bb4d38e9f65e0bee446685011de5d8
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-31745
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/reset/core.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/1de465753220deb41569cf2add87bbb0673731db https://git.kernel.org/stable/c/fbffb8c7c7bb4d38e9f65e0bee446685011de5d8