linux/drivers/nfc
Deepanshu Kartikey b61732f473
nfc: pn533: fix OOB read in pn533_acr122_is_rx_frame_valid()
frame->ccid.datalen is read directly from the USB response frame
and used, unchecked, as an index into frame->data[]. A malicious or
malfunctioning device can set this field to an arbitrary value,
causing the driver to read far outside the received buffer.

Bound ccid.datalen against the maximum possible ACR122 frame size
before using it. This replaces the existing datalen == 0 check,
since datalen < 2 already covers that case and additionally
rejects datalen == 1, which would still underflow the
"datalen - 2" offset used below.

Fixes: 9815c7cf22 ("NFC: pn533: Separate physical layer from the core implementation")
Reported-by: syzbot+1853daab1a47603d4678@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=1853daab1a47603d4678
Tested-by: syzbot+1853daab1a47603d4678@syzkaller.appspotmail.com
Assisted-by: LLM
Signed-off-by: Deepanshu Kartikey <kartikey406@gmail.com>
Link: https://patch.msgid.link/20260923035627.6210-1-kartikey406@gmail.com
Signed-off-by: David Heidelberg <david@ixit.cz>
2026-09-23 22:13:18 +02:00
..
fdp Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2026-08-18 10:42:41 -07:00
microread nfc: fix use-after-free in nfc_get_local_general_bytes 2026-09-23 22:13:17 +02:00
nfcmrvl nfc: nfcmrvl: validate helper command length before pull 2026-09-23 22:13:15 +02:00
nxp-nci nfc: Unify style of of_device_id arrays 2026-08-11 18:14:00 +02:00
pn533 nfc: pn533: fix OOB read in pn533_acr122_is_rx_frame_valid() 2026-09-23 22:13:18 +02:00
pn544 nfc: fix use-after-free in nfc_get_local_general_bytes 2026-09-23 22:13:17 +02:00
s3fwrn5 nfc: Unify style of of_device_id arrays 2026-08-11 18:14:00 +02:00
st-nci nfc: Unify style of spi_device_id arrays 2026-08-11 18:14:00 +02:00
st21nfca nfc: st21nfca: validate ISO15693 inventory length 2026-09-23 22:13:17 +02:00
st95hf nfc: st95hf: switch to using sleeping variants of gpiod API 2026-08-11 18:14:01 +02:00
Kconfig nfc: Add a virtual nci device driver 2021-01-29 18:03:33 -08:00
Makefile nfc: Add a virtual nci device driver 2021-01-29 18:03:33 -08:00
mei_phy.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
mei_phy.h NFC: mei_phy: fix kernel-doc warnings 2025-11-17 19:32:32 -08:00
nfcsim.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
port100.c nfc: port100: reject frames whose declared length exceeds the received data 2026-09-23 22:13:16 +02:00
trf7970a.c nfc: trf7970a: power down on startup RX gain failure 2026-09-23 22:13:17 +02:00
virtual_ncidev.c nfc: virtual_ncidev: Add missing ioctl compat handler 2026-09-23 22:13:16 +02:00