]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
nfc: nci: Fix uninit-value in nci_rx_work
authorRyosuke Yasuoka <ryasuoka@redhat.com>
Sun, 19 May 2024 09:43:03 +0000 (18:43 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 16 Jun 2024 11:39:46 +0000 (13:39 +0200)
commitad4d196d2008c7f413167f0a693feb4f0439d7fe
tree575a356fd14d18d056291593abcaa1beed7aaa33
parente8688218e38111ace457509d8f0cad75f79c1a7a
nfc: nci: Fix uninit-value in nci_rx_work

[ Upstream commit e4a87abf588536d1cdfb128595e6e680af5cf3ed ]

syzbot reported the following uninit-value access issue [1]

nci_rx_work() parses received packet from ndev->rx_q. It should be
validated header size, payload size and total packet size before
processing the packet. If an invalid packet is detected, it should be
silently discarded.

Fixes: d24b03535e5e ("nfc: nci: Fix uninit-value in nci_dev_up and nci_ntf_packet")
Reported-and-tested-by: syzbot+d7b4dc6cd50410152534@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=d7b4dc6cd50410152534 [1]
Signed-off-by: Ryosuke Yasuoka <ryasuoka@redhat.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/nfc/nci/core.c