CVE-2026-31761: iio: gyro: mpu3050: Move iio_device_register() to correct location
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
iio: gyro: mpu3050: Move iio_device_register() to correct location
iio_device_register() should be at the end of the probe function to prevent race conditions.
Place iio_device_register() at the end of the probe function and place iio_device_unregister() accordingly.
The Linux kernel CVE team has assigned CVE-2026-31761 to this issue.
Affected and fixed versions
===========================
Issue introduced in 4.10 with commit 3904b28efb2c780c23dcddfb87e07fe0230661e5 and fixed in 5.10.253 with commit 22487ef85f6dd9499ddf49b85a08afc50a3f1992 Issue introduced in 4.10 with commit 3904b28efb2c780c23dcddfb87e07fe0230661e5 and fixed in 5.15.203 with commit caec338f91469f0a70b68165185afa3abc994545 Issue introduced in 4.10 with commit 3904b28efb2c780c23dcddfb87e07fe0230661e5 and fixed in 6.1.168 with commit 051ca43b0e0e4b66bfd349cd53ccf231ad1d69b7 Issue introduced in 4.10 with commit 3904b28efb2c780c23dcddfb87e07fe0230661e5 and fixed in 6.6.134 with commit 2a4537653d200fda2a8516083459f8ff6194f8fc Issue introduced in 4.10 with commit 3904b28efb2c780c23dcddfb87e07fe0230661e5 and fixed in 6.12.81 with commit 92f18aa86302fe83e0726a1191015f427d4ff056 Issue introduced in 4.10 with commit 3904b28efb2c780c23dcddfb87e07fe0230661e5 and fixed in 6.18.22 with commit cc3de12a5612ee25df7fb549cb7b3e4cc8bfaf9c Issue introduced in 4.10 with commit 3904b28efb2c780c23dcddfb87e07fe0230661e5 and fixed in 6.19.12 with commit 59a317f8215674c8330817770497301bfb2c1b99 Issue introduced in 4.10 with commit 3904b28efb2c780c23dcddfb87e07fe0230661e5 and fixed in 7.0 with commit 4c05799449108fb0e0a6bd30e65fffc71e60db4d
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-31761
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/iio/gyro/mpu3050-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/22487ef85f6dd9499ddf49b85a08afc50a3f1992 https://git.kernel.org/stable/c/caec338f91469f0a70b68165185afa3abc994545 https://git.kernel.org/stable/c/051ca43b0e0e4b66bfd349cd53ccf231ad1d69b7 https://git.kernel.org/stable/c/2a4537653d200fda2a8516083459f8ff6194f8fc https://git.kernel.org/stable/c/92f18aa86302fe83e0726a1191015f427d4ff056 https://git.kernel.org/stable/c/cc3de12a5612ee25df7fb549cb7b3e4cc8bfaf9c https://git.kernel.org/stable/c/59a317f8215674c8330817770497301bfb2c1b99 https://git.kernel.org/stable/c/4c05799449108fb0e0a6bd30e65fffc71e60db4d