From: Thadeu Lima de Souza Cascardo <cascardo@igalia.com>
To: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Edward Adam Davis <eadavis@qq.com>,
"David S. Miller" <davem@davemloft.net>,
Krzysztof Kozlowski <krzk@kernel.org>,
Bongsu Jeon <bongsu.jeon@samsung.com>,
kernel-dev@igalia.com,
Thadeu Lima de Souza Cascardo <cascardo@igalia.com>
Subject: [PATCH net] Revert "nfc/nci: Add the inconsistency check between the input data length and count"
Date: Tue, 13 Jan 2026 17:24:58 -0300 [thread overview]
Message-ID: <20260113202458.449455-1-cascardo@igalia.com> (raw)
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>
---
drivers/nfc/virtual_ncidev.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/nfc/virtual_ncidev.c b/drivers/nfc/virtual_ncidev.c
index 9ef8ef2d4363..b957fce83b7c 100644
--- a/drivers/nfc/virtual_ncidev.c
+++ b/drivers/nfc/virtual_ncidev.c
@@ -125,10 +125,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(vdev->ndev, skb);
return count;
--
2.47.3
next reply other threads:[~2026-01-13 20:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-13 20:24 Thadeu Lima de Souza Cascardo [this message]
2026-01-19 14:18 ` [PATCH net] Revert "nfc/nci: Add the inconsistency check between the input data length and count" patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260113202458.449455-1-cascardo@igalia.com \
--to=cascardo@igalia.com \
--cc=bongsu.jeon@samsung.com \
--cc=davem@davemloft.net \
--cc=eadavis@qq.com \
--cc=kernel-dev@igalia.com \
--cc=krzk@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox