iio: core: Prevent invalid memory access when there is no parent
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
6.1.466.4.116.5In the Linux kernel, the following vulnerability has been resolved:
iio: core: Prevent invalid memory access when there is no parent
Commit 813665564b3d ("iio: core: Convert to use firmware node handle instead of OF node") switched the kind of nodes to use for label retrieval in device registration. Probably an unwanted change in that commit was that if the device has no parent then NULL pointer is accessed. This is what happens in the stock IIO dummy driver when a new entry is created in configfs:
# mkdir /sys/kernel/config/iio/devices/dummy/foo BUG: kernel NULL pointer dereference, address: ... ... Call Trace: __iio_device_register iio_dummy_probe
Since there seems to be no reason to make a parent device of an IIO dummy device mandatory, let’s prevent the invalid memory access in __iio_device_register when the parent device is NULL. With this change, the IIO dummy driver works fine with configfs.
From the CVE record · Linux
The Linux kernel’s IIO core can dereference a NULL pointer when registering a device with no parent. Creating a new IIO dummy device through configfs triggers the issue locally; the input does not specify authentication requirements.
Engineers running Linux kernels with the affected IIO core should check their deployments; affected versions are not specified.