CVE-2026-31764: iio: imu: st_lsm6dsx: Set buffer sampling frequency for accelerometer only
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
iio: imu: st_lsm6dsx: Set buffer sampling frequency for accelerometer only
The st_lsm6dsx_hwfifo_odr_store() function, which is called when userspace writes the buffer sampling frequency sysfs attribute, calls st_lsm6dsx_check_odr(), which accesses the odr_table array at index sensor->id; since this array is only 2 entries long, an access for any sensor type other than accelerometer or gyroscope is an out-of-bounds access.
The motivation for being able to set a buffer frequency different from the sensor sampling frequency is to support use cases that need accurate event detection (which requires a high sampling frequency) while retrieving sensor data at low frequency. Since all the supported event types are generated from acceleration data only, do not create the buffer sampling frequency attribute for sensor types other than the accelerometer.
The Linux kernel CVE team has assigned CVE-2026-31764 to this issue.
Affected and fixed versions
===========================
Issue introduced in 6.19 with commit 6b648a36c200dfd3e776e657a4c8a8ce63fb52d3 and fixed in 6.19.12 with commit 3225a81e8d264442b14c7c1bc965ebafa3c0ee01 Issue introduced in 6.19 with commit 6b648a36c200dfd3e776e657a4c8a8ce63fb52d3 and fixed in 7.0 with commit 679c04c10d65d32a3f269e696b22912ff0a001b9
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-31764
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/imu/st_lsm6dsx/st_lsm6dsx_buffer.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/3225a81e8d264442b14c7c1bc965ebafa3c0ee01 https://git.kernel.org/stable/c/679c04c10d65d32a3f269e696b22912ff0a001b9