]> git.baikalelectronics.ru Git - kernel.git/commit
NFC: nci: Add some bounds checking in nci_hci_cmd_received()
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 3 Apr 2019 07:12:48 +0000 (10:12 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sat, 6 Apr 2019 22:05:07 +0000 (15:05 -0700)
commit09d015fa849e214b0f6208043285a0792d912bcb
treeda9e6eca74c5d82e6b1ce44423284fa312721e78
parenta72ad427c39e8f11d99304c1bc2bdb950c6518d3
NFC: nci: Add some bounds checking in nci_hci_cmd_received()

This is similar to commit af8e8009b7af ("NFC: Fix possible memory
corruption when handling SHDLC I-Frame commands").

I'm not totally sure, but I think that commit description may have
overstated the danger.  I was under the impression that this data came
from the firmware?  If you can't trust your networking firmware, then
you're already in trouble.

Anyway, these days we add bounds checking where ever we can and we call
it kernel hardening.  Better safe than sorry.

Fixes: 7bc4a77f0fb1 ("NFC: nci: Add HCI over NCI protocol support")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/nfc/nci/hci.c