i2c: atr: fix dangling adapter pointer on add failure
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:
i2c: atr: fix dangling adapter pointer on add failure
i2c_atr_add_adapter() stores atr->adapter[chan_id] before i2c_add_adapter() so that the I2C bus notifier can match child clients during registration. On failure the channel is freed but the slot was left pointing at freed memory, which can lead to use-after-free in i2c_atr_del_adapter() / cleanup and also block reuse with -EEXIST.
Clear the slot on the i2c_add_adapter() error path before freeing chan.
From the CVE record · Linux
The Linux kernel's I2C ATR code leaves a pointer to freed memory when adapter registration fails. Subsequent adapter cleanup can trigger a use-after-free, and the stale pointer can prevent channel reuse. The input does not specify how an attacker could trigger this condition or whether access or user interaction is required.
Engineers running Linux kernels with the affected I2C ATR code should check their versions; affected versions are not specified.