nfc: pn533: hold a reference to the request skb during send_frame
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 9815c7cf22daceabfb919ddcd6f2c80e049c1fbc · < 7a8e0a7aef80721da287ac246349aba7d98f6aed| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
nfc: pn533: hold a reference to the request skb during send_frame
__pn533_send_async() publishes the command and then calls dev->phy_ops->send_frame(). Once dev->cmd is set, an incoming frame can be matched to this command: the I2C threaded IRQ runs pn533_recv_frame(), which queues cmd_complete_work, and pn533_send_async_complete() frees cmd->req with consume_skb().
On the I2C transport, pn533_i2c_send_frame() still dereferences the same skb after i2c_master_send() returns, so a completion that races the send can free the skb while the transport is still using it.
The request skb is owned by the command object and may be freed by command completion at any time after dev->cmd is published, so the transport send path must not assume it stays alive. Hold a temporary reference to the request skb across the send_frame() call so the transport always sees a live skb even if completion races the send. Add a pn533_send_cmd_frame() helper and use it from all three send paths.
From the CVE record · Linux
The Linux kernel’s pn533 NFC I2C transport can use a request buffer after command completion frees it. This can happen when an incoming frame completes a command while the transport is still sending it. 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 pn533 NFC I2C transport should check their versions; affected versions were not provided.