NFC: nci: uart: Set tty->disc_data only in success path
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 9961127d4bce6325e9a0b0fb105e0c85a6c62cb7 · < 55c3dbd8389636161090a2b2b6d2d709b9602e9c| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
NFC: nci: uart: Set tty->disc_data only in success path
Setting tty->disc_data before opening the NCI device means we need to clean it up on error paths. This also opens some short window if device starts sending data, even before NCIUARTSETDRIVER IOCTL succeeded (broken hardware?). Close the window by exposing tty->disc_data only on the success path, when opening of the NCI device and try_module_get() succeeds.
The code differs in error path in one aspect: tty->disc_data won't be ever assigned thus NULL-ified. This however should not be relevant difference, because of "tty->disc_data=NULL" in nci_uart_tty_open().
From the CVE record · Linux
The Linux kernel’s NFC NCI UART code exposes tty->disc_data before opening the NCI device succeeds. A device that sends data before the NCIUARTSETDRIVER ioctl succeeds can encounter this window; the input does not specify attacker access, authentication requirements, or user interaction.
Engineers running the Linux kernel should check whether their kernel includes the affected NFC NCI UART code; affected versions were not provided.