iio: magnetometer: ak8975: fix potential kernel stack memory leak
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ bc11ca4a0b84a2f2ebaca2614b92998738d13b1e · < 3d57672119525c59ed73ea21accb001ccbcd6cfd| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
iio: magnetometer: ak8975: fix potential kernel stack memory leak
Currently in the AK8975 driver there are four instances where potential uninitialized kernel stack memory leaks can occur. If i2c_smbus_read_i2c_block_data_or_emulated() returns a value less than the size of the buffer, uninitialized bytes are retained in the buffer and later the buffer is passed on to IIO buffers, potentially leaking memory to userspace.
Fix this by adding checks whether the return value of the function is equal to the size of the buffer and subsequently if the value is lesser than zero to distinguish from a returned error code.
From the CVE record · Linux
The Linux kernel AK8975 magnetometer driver can pass uninitialized stack bytes to IIO buffers when an I2C block read returns fewer bytes than expected. This may expose kernel memory to local userspace through those buffers; the input does not specify authentication requirements.
Engineers running Linux kernels with the AK8975 magnetometer driver should check whether their kernel includes the fix.