diff options
| author | Pengpeng Hou <pengpeng@iscas.ac.cn> | 2026-07-15 16:44:05 +0800 |
|---|---|---|
| committer | David Heidelberg <david@ixit.cz> | 2026-08-17 19:27:50 +0200 |
| commit | ff825ed2b74983453ec851d1a7053dd3576d7667 (patch) | |
| tree | 2175455778ad0621fde69c380f82a460c7c4c359 /scripts/objdiff | |
| parent | 831cfb7ba99e99f4106d2e933f565c7f72bbe5c6 (diff) | |
| download | linux-next-ff825ed2b74983453ec851d1a7053dd3576d7667.tar.gz linux-next-ff825ed2b74983453ec851d1a7053dd3576d7667.zip | |
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.
Fixes: 3096e25a3e40 ("NFC: st21nfca: Fix incorrect byte stuffing revocation")
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Link: https://patch.msgid.link/20260715084405.41546-1-pengpeng@iscas.ac.cn
Signed-off-by: David Heidelberg <david@ixit.cz>
Diffstat (limited to 'scripts/objdiff')
0 files changed, 0 insertions, 0 deletions
