CVE-2026-53400: i2c: core: fix adapter registration race
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
i2c: core: fix adapter registration race
Adapters can be looked up based on their id using i2c_get_adapter() which takes a reference to the embedded struct device.
Make sure that the adapter (including its struct device) has been initialised before adding it to the IDR to avoid accessing uninitialised data which could, for example, lead to NULL-pointer dereferences or use-after-free.
Note that the i2c-dev chardev, which is registered from a bus notifier, currently uses i2c_get_adapter() so the adapter needs to be added to the IDR before registration.
The Linux kernel CVE team has assigned CVE-2026-53400 to this issue.
Affected and fixed versions
===========================
Issue introduced in 2.6.22 with commit 6e13e641841833cc2aa5baefe89bb04bc388801b and fixed in 6.12.95 with commit 78793c75dc6d0ff2e4d50ad617349b328a99054e Issue introduced in 2.6.22 with commit 6e13e641841833cc2aa5baefe89bb04bc388801b and fixed in 6.18.38 with commit 6a946038f2a5a8c29048c6af369d4e391448a5c5 Issue introduced in 2.6.22 with commit 6e13e641841833cc2aa5baefe89bb04bc388801b and fixed in 7.1.3 with commit a4c8094bbf4c6fa68b17e3b16f6a0a1b7a14f3e0 Issue introduced in 2.6.22 with commit 6e13e641841833cc2aa5baefe89bb04bc388801b and fixed in 7.2-rc1 with commit ba14d7cf2fe7284610a29854bdff22b2537d3ce6
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-53400
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/i2c/i2c-core-base.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/78793c75dc6d0ff2e4d50ad617349b328a99054e https://git.kernel.org/stable/c/6a946038f2a5a8c29048c6af369d4e391448a5c5 https://git.kernel.org/stable/c/a4c8094bbf4c6fa68b17e3b16f6a0a1b7a14f3e0 https://git.kernel.org/stable/c/ba14d7cf2fe7284610a29854bdff22b2537d3ce6