nfc: st-nci: Fix use after free bug in ndlc_remove due to race condition
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 35630df68d6030daf12dde12ed07bbe26324e6ac · < 5e331022b448fbc5e76f24349cd0246844dcad25| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
nfc: st-nci: Fix use after free bug in ndlc_remove due to race condition
This bug influences both st_nci_i2c_remove and st_nci_spi_remove. Take st_nci_i2c_remove as an example.
In st_nci_i2c_probe, it called ndlc_probe and bound &ndlc->sm_work with llt_ndlc_sm_work.
When it calls ndlc_recv or timeout handler, it will finally call schedule_work to start the work.
When we call st_nci_i2c_remove to remove the driver, there may be a sequence as follows:
Fix it by finishing the work before cleanup in ndlc_remove
CPU0 CPU1
From the CVE record · Linux
A race in the Linux kernel’s NFC st-nci driver can let scheduled work access freed device memory during I2C or SPI driver removal. The input does not establish how an attacker could trigger the race or whether authentication or user interaction is required.
Engineers running Linux kernels with the NFC st-nci driver should check whether their kernel includes the fix; affected versions are not specified.