summaryrefslogtreecommitdiff
path: root/drivers/nfc
diff options
context:
space:
mode:
authorThadeu Lima de Souza Cascardo <cascardo@igalia.com>2026-01-13 17:24:58 -0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-02-06 16:41:53 +0100
commit7b673faac4784aa75af36369a42a9709d1d064dd (patch)
treea146990f7fb845cc6ceb57013c9686eb514bff06 /drivers/nfc
parentc49b1646cc50f2fa081d7573e289a937e8c3a170 (diff)
Revert "nfc/nci: Add the inconsistency check between the input data length and count"
commit f40ddcc0c0ca1a0122a7f4440b429f97d5832bdf upstream. This reverts commit 068648aab72c9ba7b0597354ef4d81ffaac7b979. NFC packets may have NUL-bytes. Checking for string length is not a correct assumption here. As long as there is a check for the length copied from copy_from_user, all should be fine. The fix only prevented the syzbot reproducer from triggering the bug because the packet is not enqueued anymore and the code that triggers the bug is not exercised. The fix even broke testing/selftests/nci/nci_dev, making all tests there fail. After the revert, 6 out of 8 tests pass. Fixes: 068648aab72c ("nfc/nci: Add the inconsistency check between the input data length and count") Cc: stable@vger.kernel.org Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@igalia.com> Link: https://patch.msgid.link/20260113202458.449455-1-cascardo@igalia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/nfc')
-rw-r--r--drivers/nfc/virtual_ncidev.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/drivers/nfc/virtual_ncidev.c b/drivers/nfc/virtual_ncidev.c
index 09d4ab0e63b1..6317e8505aaa 100644
--- a/drivers/nfc/virtual_ncidev.c
+++ b/drivers/nfc/virtual_ncidev.c
@@ -121,10 +121,6 @@ static ssize_t virtual_ncidev_write(struct file *file,
kfree_skb(skb);
return -EFAULT;
}
- if (strnlen(skb->data, count) != count) {
- kfree_skb(skb);
- return -EINVAL;
- }
nci_recv_frame(ndev, skb);
return count;