i2c: core: fix adapter registration race
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 6e13e641841833cc2aa5baefe89bb04bc388801b · < 6a946038f2a5a8c29048c6af369d4e391448a5c5| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
i2c: core: fix adapter registration race
Adapters can be looked up based on their id using i2c_get_adapter() which takes a reference to the embedded struct device.
Make sure that the adapter (including its struct device) has been initialised before adding it to the IDR to avoid accessing uninitialised data which could, for example, lead to NULL-pointer dereferences or use-after-free.
Note that the i2c-dev chardev, which is registered from a bus notifier, currently uses i2c_get_adapter() so the adapter needs to be added to the IDR before registration.
From the CVE record · Linux
A race in Linux kernel I2C adapter registration can expose an adapter before it is initialized, potentially causing a NULL-pointer dereference or use-after-free. The input does not establish how an attacker could trigger the race or whether access or user interaction is required.
Engineers running the Linux kernel should check their affected versions; no version range is provided.