nfc: st21nfca: validate received frame size
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 3096e25a3e40b73afd59e46f3bf8d84f919992a1 · < 57919d0662d8856211b794140172e51ca389f23d| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
nfc: st21nfca: validate received frame size
st21nfca_hci_i2c_repack() trims a received frame at its EOF marker before removing byte stuffing. It then assumes the truncated frame contains the LLC header and two CRC bytes, and it unconditionally reads the byte after an escape marker.
A malformed frame can place EOF immediately after the start marker or can end its data portion with an escape marker. The former leaves too few bytes for check_crc(), while the latter makes the unstuffing loop read past the current skb length.
Require the minimum framing bytes both before and after unstuffing. Use separate input and output cursors while removing byte stuffing, and reject an escape marker without its encoded byte. This keeps malformed frames within the received frame boundary before CRC processing.
From the CVE record · Linux
The Linux kernel’s st21nfca NFC driver does not adequately validate the size of a received frame before processing it. A malformed frame can cause the driver to read beyond the frame boundary; the input does not specify authentication or user-interaction requirements.
Engineers running Linux kernels with the st21nfca NFC driver should check their exposure; affected versions are not specified.