CVE-2026-31660: nfc: pn533: allocate rx skb before consuming bytes
In the Linux kernel, the following vulnerability has been resolved:
nfc: pn533: allocate rx skb before consuming bytes
pn532receivebuf() reports the number of accepted bytes to the serdev core. The current code consumes bytes into recvskb and may already hand a complete frame to pn533recvframe() before allocating a fresh receive buffer.
If that allocskb() fails, the callback returns 0 even though it has already consumed bytes, and it leaves recvskb as NULL for the next receive callback. That breaks the receivebuf() accounting contract and can also lead to a NULL dereference on the next skbputu8().
Allocate the receive skb lazily before consuming the next byte instead. If allocation fails, return the number of bytes already accepted.
Affected Software
Remediation
Event History
Frequently Asked Questions
What is the severity of CVE-2026-31660?
CVE-2026-31660 has a medium severity rating due to potential impacts on the NFC functionality in the Linux kernel.
How do I fix CVE-2026-31660?
To fix CVE-2026-31660, update to a patched version of the Linux kernel that addresses this vulnerability.
Which versions of the Linux kernel are affected by CVE-2026-31660?
CVE-2026-31660 affects various versions of the Linux kernel from 5.5 to 7.0-rc7.
What components are impacted by CVE-2026-31660?
CVE-2026-31660 affects the pn533 NFC driver within the Linux kernel.
What should I do if I cannot upgrade due to compatibility issues with CVE-2026-31660?
If you cannot upgrade, consider applying temporary mitigations or restrictions to the NFC functionality until an upgrade is feasible.