Article View: linux.kernel.netdev
Article #24307[PATCH net v2 0/3] net/nfc: three peer-reachable skb bugs in LLCP and NCI
From: Piyus Kedia
Date: Mon, 30 Nov 2026 01:22
Date: Mon, 30 Nov 2026 01:22
61 lines
13396 bytes
13396 bytes
Three independent bugs in the NFC receive paths: a 16-bit truncation that
overruns an skb and panics, a use-after-free on a received frame, and a
NULL skb handed to the nfc core. They touch three different files and have
three different causes, so they can be taken in any order; they are posted
as one series only because v1 went out as three numbered patches in three
threads, which is what the review objected to.
1/3 holds the SNL allocation size in a size_t instead of a u16, so a large
SDREQ burst cannot wrap it and make skb_put() trip skb_over_panic().
2/3 takes the skb reference before sock_queue_rcv_skb() publishes the frame
on the receive queue rather than after, and releases it on failure.
3/3 stops nci_add_rx_data_frag() forwarding a NULL skb to the nfc core
after it has freed it on the reassembly error path.
Each was reproduced on net.git main under KASAN, and the patched kernel is
clean on the same reproducer with ordinary NFC traffic unaffected. Found
by AI-driven fuzzing built on top of syzkaller; every analysis was then
checked by hand against the code, as each patch records. The reproducers
are not posted - they go to anyone who asks for them.
Changes in v2, all of them from Willem de Bruijn's review:
- a Fixes: tag on each patch. v1 had none because the clone we were
working from does not reach back that far; from a full one they are
1/3 e0ae7bac06cc - gave nfc_llcp_allocate_snl() a size_t length to
add into the u16 that was already there
2/3 1727cf937401 - put skb_get() after sock_queue_rcv_skb() in both
handlers
3/3 122c195872e9 - added the target-mode exit that forwards the skb.
The NULL itself dates to 2011, but until this commit the shared
exit path only reached nci_data_exchange_complete(), which
accepts one.
- this cover letter, and one series rather than three numbered threads
- the full get_maintainer.pl recipient list
- a Link: to each bug report in the commit message, instead of threading
the patch under the report with In-Reply-To
v1 of the three patches, each threaded under its own bug report:
https://lore.kernel.org/netdev/20261123023548.3351531-2-piyus@iiitd.ac.in/
https://lore.kernel.org/netdev/20261123023519.3350997-2-piyus@iiitd.ac.in/
https://lore.kernel.org/netdev/20261123023446.3350387-2-piyus@iiitd.ac.in/
The review:
https://lore.kernel.org/netdev/willemb.360aecefa3166@google.com/
Piyus Kedia (3):
net/nfc: llcp: fix the 16-bit truncation that overruns the SNL
response skb
net/nfc: llcp: take the skb reference before queueing it to the socket
net/nfc: nci: do not hand a NULL skb to the nfc core
net/nfc/llcp_commands.c | 2 +-
net/nfc/llcp_core.c | 33 +++++++++++++++++++--------------
net/nfc/nci/data.c | 15 +++++++++++----
3 files changed, 31 insertions(+), 19 deletions(-)
base-commit: 9437ee8b6cf607e883b36e44bd755968daaebd48
--
2.34.1
Technical Details
Message-ID:
<20261130012208.1962491-1-piyus@iiitd.ac.in>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-373754-linux-kernel-netdev=dewy.ruShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-373754-linux-kernel-netdev=dewy.ru
From: piyus@iiitd.ac.in (Piyus Kedia)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net v2 0/3] net/nfc: three peer-reachable skb bugs in LLCP and NCI
Date: Mon, 30 Nov 2026 06:52:05 +0530
Organization: Usenet Network
Message-ID: <20261130012208.1962491-1-piyus@iiitd.ac.in>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="1301919"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:68XJdN+x7gwpGv7Q1HLojcKa+CU= sha256:bwdSeG6QueVnnl81vxb5YmaPjlxjWdzBX6EecF9gtbU=
sha1:xYam3NOx/xb83EReMJE4AsNBBp0= sha256:ZJ1FnzF8R7qsRd73fUSUCGnI+8Sp+fOsPy9XQJiyBOg=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
by mail.dewy.ru (Postfix) with ESMTP id C4D17125FB9; Mon, 30 Nov 2026 04:22:44 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.051
X-Spam-Status: No, score=-3.051 tagged_above=-9999 required=6.31
tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key)
header.d=iiitd.ac.in
X-Received: from mail.dewy.ru ([127.0.0.1])
by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id 1s9TviRKUPXW;
Mon, 30 Nov 2026 04:22:35 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-373754-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=iiitd.ac.in
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
by mail.dewy.ru (Postfix) with ESMTPS id 619D1125FB3; Mon, 30 Nov 2026 04:22:21 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by sea.lore.kernel.org (Postfix) with ESMTP id 9A64226278; Mon, 30 Nov 2026 01:22:18 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
t=1796001737;
b=nw2IKuBQ+7sFQLJqau7hFsEhew7Z1BY2eQOmOIol8LPKeeTqSrCoTbCjPUHWc9M73OkJ
9vPVO59a/UxdavNChgMPFinIqjPCwKHP+opaJop/RdGl8fh3CJAw4KgmkzYYNrhiDiV0y
mJq8tnLA1agK8jLwUgdTHAPz0YRmthI9omJk8hbj++EyiDMZipL4RfA5ssnZvQCxNrKKg
NJ5vvXuTy+v1gmaNzBJI3ze4qHcWmeZPokpZIgQPd1edA14uHf+9OzOnc/ca1kYwyieVl
1lG3lI4d0RlSC4oEVP3ZVgybe8ayk1s7Z1Mordnm3YWbiBJxBcjFe/hwQlxUYjwDvXQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1796001737;
h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State:
X-Gm-Gg:X-Received:Received:From:To:Cc:Subject:Date:Message-Id:
X-Mailer:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
List-Unsubscribe:List-Owner:Precedence:MIME-Version:
Content-Transfer-Encoding;
bh=w7ScXhhVUJLD5+8kwUWjkN5ehgvCmjdgphNR1DWoGNE=;
b=djMm5a1l3UAr1W4NiXJVaojdhUkhVzMWnJQCnHhbX7oKeGNI2NcXAOKaVSrPXB1xXiSt
06WG2HHIAMFTqkbm9ATwTh7KpAoamgTuY42RVZV2nE+N81toLgc1DCIAHXJMEc2yKx0MG
pT6kd/vBTg/7090KJOW+i7X8Ih2BIn/nCaU8m91qOVFxd6vKXG0vSvRDDa1ufQ9zuAuz3
IUmRNP9C1fix3cHwxpJznV4FPhJErYHwIn3x4sUiHPv22m355kFYRMclHqzbzVgR3AXX8
dnAwj6kuD1d5ZoBHimPmrP0DsMU6sfQHfXiYhCYioEAGv7ts80Ay+VhM5FnbpQ8jEqQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=iiitd.ac.in header.i=@iiitd.ac.in header.a=rsa-sha256 header.s=google header.b=hWEs2Q0+;
dmarc=none header.from=iiitd.ac.in;
spf=pass smtp.mailfrom=iiitd.ac.in;
arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id B4497606A333;
Mon, 30 Nov 2026 01:22:17 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (1024-bit key) header.d=iiitd.ac.in header.i=@iiitd.ac.in header.a=rsa-sha256 header.s=google header.b=hWEs2Q0+
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.214.177
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1796001736;
b=5FccmLMETw++8nhvnufMIv8lWAihYLpgGM42VsgnMIbeEXv0+VOI2eBqVTdOJba1P7Fo
C984MUa5Myer2Bl+FSvXw6QyZFlAAeEjjQBOx3i4nnn/YqWbVtGZIuqbgiHSbhhI/WzL1
Qh7EJ1kfermKCKGU5hRtp34MvuAIEER1ycCCP4/Ag6aPS6B7CsSkXk402/ZlK8bf7Ha3F
Z/eRWCAuYcue1Lw+lzQBBu7T5Fo4gP+woSVt7IzkfbFmrpnjQMpQHHts0gqqMINaNBNSi
4t2YECBYmojbf4GCYpPqXWst7JMqi5fxJcNMC2j4ftxWq/ZbblDlalUAYcVUSnf0miw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1796001736;
h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received:
From:To:Cc:Subject:Date:Message-Id:X-Mailer:MIME-Version:
Content-Transfer-Encoding;
bh=w7ScXhhVUJLD5+8kwUWjkN5ehgvCmjdgphNR1DWoGNE=;
b=evWeJtKquw/DrN7UiYukwBJPbBn3GpRGR7c2n/q6T7OtBkqM/dw7YxQtFzJo91UlWuAE
ukPR/0s+p/7rvSG1SPOWLVzb55zrDv0GRyf35E5r6DlvicBSg4RgBHry3XY3jO8LXzrLw
6uG9ANl9kVOPEnVXkBu4xLjyE7T5M7ahe2APpUr7N3d1Uo4UGLwLu2ZcgPeCmjr42hhW9
t/51MuwxfXge1oflhceSlAr+akUunqZ288NwvykvRXRA6gKLmJCz6WmG5vQpIweQD2l6W
0NKH78dWqt8C4yJkRehiMwMtxOCIdNXZC/Rvj+EV7OoqRzvMpWyfrhlb4RfpU3BVgNw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=none header.from=iiitd.ac.in;
spf=pass smtp.mailfrom=iiitd.ac.in;
dkim=pass header.d=iiitd.ac.in header.i=@iiitd.ac.in header.a=rsa-sha256 header.s=google header.b=hWEs2Q0+;
arc=none smtp.remote-ip=209.85.214.177
X-Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177])
(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id C2971606A327
for <netdev@vger.kernel.org>; Mon, 30 Nov 2026 01:22:15 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org C2971606A327
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iiitd.ac.in
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=iiitd.ac.in
X-Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-2f03920c4a0so59813875ad.3
for <netdev@vger.kernel.org>; Sun, 29 Nov 2026 17:22:15 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=iiitd.ac.in; s=google; t=1796001735; x=1796606535; darn=vger.kernel.org;
h=content-transfer-encoding:mime-version:message-id:date:subject:cc
:to:from:from:to:cc:subject:date:message-id:reply-to:content-type;
bh=w7ScXhhVUJLD5+8kwUWjkN5ehgvCmjdgphNR1DWoGNE=;
b=hWEs2Q0+7LmwpdZGfGA26NVnqiqId4t/IY6/0nTp5mnOtOUBAp3wd219Pme1G5ZON2
zcyOTLFP6pDoYccwLVFgV0aB3xEwIuUVVfFOcABuI5G9FFyxWRepnHR4XEYue2b0ANCy
JZluNjjUe2jnX/eGqxOCbRhOCkFTR5j37n3PQ=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1796001735; x=1796606535;
h=content-transfer-encoding:mime-version:message-id:date:subject:cc
:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
:message-id:reply-to:content-type;
bh=w7ScXhhVUJLD5+8kwUWjkN5ehgvCmjdgphNR1DWoGNE=;
b=Fxv9ZTOVCQrLegDJf5DMT7N84WkZomlMD+mxb61a5UlzLD4oCiK+yyguyMdvPqFdlL
hHBTAFQEUijyJP1uhOeM4Smm9/f3vz868QyOhZmWIvFz9irmsvFUShImHojycr4rc1LY
zABwNFXNC2VoyIP8v646t8W4dtvqyuMFXRa0FbltbZQucgcFAZZlVP39Dxi0QW0nVMzw
iO2Bj+L6i75JqY8Wg3S3XysfwkJ3hPakDGfjRGfjTftNH5q8cFJ4mKSusbjTrrN45pw+
j5dAEZahZYa2QlSp61wZQ+mdn4eNx38QtHG5YdxMK0CI5O9QMMD2nPleUpEXY0bOZTDE
stpg==
X-Forwarded-Encrypted: i=1; AL+hErHpH3XPGeZb7hAotc4FTHm0/vUhxCNKoL6IqE9pIlm/nryCC4opnU4+vGOji6b+Yeuo+xCIxlQ=@vger.kernel.org
X-Gm-Message-State: APuU4Z8Y2LAfZE9Kh7JKtcz0kLguvR8ErneNiq9lGX1wIM92NVn/BIfL
zeCMaVZSUQOqpx457vAO+4e04d6cjkfu+5H6HNjfXvprLZO/IbwKcY/Iq9wHW0Y5y7k=
X-Gm-Gg: AZFdTZcAUiTpxOS5ZenNDXXAtQOF8nJVkDm5tLrJGgv7fdw2G5kohCoQXojhr/q+Jfi
a88QSQKlB3z2Po37VieOa8ejTFPqtZqMZQkbi/Avz9UMKYhijzBR8ts0KebRoDg/UoRmwcAFXrN
pX63aCjFwK5CU6/GrvRx32hXO7wD+TUMt2GKcFxIKo1MQZhPVivS6xJ5HRBURe3NgB0p7xPbt9H
gLcbBlGKJVVaNrW7doeVhDY4Rc1o8vtfk766aaXY7xGqJN1ffAp1XIqm1fGkCOs+pd+ZF77jVLC
fKHCNiEkoF0RFse5/Vq9LV007q6OTPg4b1P2jxXZG6Q5zzixn3J/zH81TmxfU4A4VRE0gQoDuKa
ogrvPf+8kbdxggA+sVDyAeORC8CjmlbrOhK4AQBCJTIrcvHMtZIBvsNyK357MtSeBErAVgnYXvy
jHo9BjEIGkRQbxHhSTtr7fm0PGPOJz6mcPL7NwXxJteRuty6XDgV5wpdW/nt1wr4EKKgjoD1suV
lYpPBwq/ykKD1Xx2iEihcmQxI+7WgV/97J5vFQSDc6vud2Rw04JwgZE/zUl3wYeW57UdTCu/uAP
xlB5SXgp2juiqah8+g8OVO6VyPJj5/GvnW3Si5mrLZxT3Rnrce9uAIxa4D0PyQYvYIa9ZS5hTuL
1CYHzRY6blRlHjlKow2H2gs9G3x/yTQTgjeQ/D4i5KYr9lOFtH3Nx/7XiR/9TIQG3
X-Received: by 2002:a17:903:41cc:b0:2ef:ed4d:d69a with SMTP id d9443c01a7336-2f03ef3d432mr337751495ad.6.1796001735016;
Sun, 29 Nov 2026 17:22:15 -0800 (PST)
X-Received: from iiitd-S2600STB.iiitd.edu.in ([103.25.231.160])
by smtp.gmail.com with ESMTPSA id d9443c01a7336-2f0bc695f31sm98858205ad.49.2026.11.29.17.22.11
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Sun, 29 Nov 2026 17:22:14 -0800 (PST)
X-Cc: oe-linux-nfc@lists.linux.dev,
netdev@vger.kernel.org,
linux-kernel@vger.kernel.org,
Kapil Vaswani <kapil@presceralabs.ai>
X-Mailer: git-send-email 2.34.1
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list