iio: imu: st_lsm6dsx: fix iio_chan_spec for sensors without event detection
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
iio: imu: st_lsm6dsx: fix iio_chan_spec for sensors without event detection
The st_lsm6dsx_acc_channels array of struct iio_chan_spec has a non-NULL event_spec field, indicating support for IIO events. However, event detection is not supported for all sensors, and if userspace tries to configure accelerometer wakeup events on a sensor device that does not support them (e.g. LSM6DS0), st_lsm6dsx_write_event() dereferences a NULL pointer when trying to write to the wakeup register. Define an additional struct iio_chan_spec array whose members have a NULL event_spec field, and use this array instead of st_lsm6dsx_acc_channels for sensors without event detection capability.
From the CVE record · Linux
The Linux kernel’s st_lsm6dsx accelerometer driver exposes wakeup-event controls for sensors that do not support event detection, such as LSM6DS0. A local userspace process that tries to configure those events can trigger a NULL pointer dereference.
Check Linux kernel installations using the st_lsm6dsx driver with sensors that lack event detection.