From: "Ömer Mete Kaya" <omermetekaya0@gmail.com>
To: netdev@vger.kernel.org
Cc: david@ixit.cz, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com, horms@kernel.org,
oe-linux-nfc@lists.linux.dev, linux-kernel@vger.kernel.org,
"Ömer Mete Kaya" <omermetekaya0@gmail.com>,
syzbot+1e3df0852e82c21ca418@syzkaller.appspotmail.com
Subject: [PATCH net v2] nfc: llcp: fix slab-out-of-bounds read in nfc_llcp_wks_sap()
Date: Sun, 6 Sep 2026 01:48:43 +0300 [thread overview]
Message-ID: <20260905225211.596366-1-omermetekaya0@gmail.com> (raw)
In-Reply-To: <20260903165014.497490-1-omermetekaya0@gmail.com>
nfc_llcp_wks_sap() passes service_name to pr_debug() using the %s
format specifier. The service_name buffer is allocated via kmemdup()
in llcp_sock_bind() and is not null-terminated, causing
__dynamic_pr_debug() to read beyond the allocated region:
KASAN: slab-out-of-bounds Read in __dynamic_pr_debug
Fix by using %.*s with service_name_len to limit the output to the
actual length of the string.
Reported-by: syzbot+1e3df0852e82c21ca418@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=1e3df0852e82c21ca418
Signed-off-by: Ömer Mete Kaya <omermetekaya0@gmail.com>
---
v2: Changed prefix to [PATCH net] but still I could not find the Fixes: tag both in the gitblame and the lore.
net/nfc/llcp_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/nfc/llcp_core.c b/net/nfc/llcp_core.c
index cac1b5487064..fda236e4d9fd 100644
--- a/net/nfc/llcp_core.c
+++ b/net/nfc/llcp_core.c
@@ -341,7 +341,7 @@ static int nfc_llcp_wks_sap(const char *service_name, size_t service_name_len)
{
int sap, num_wks;
- pr_debug("%s\n", service_name);
+ pr_debug("%.*s\n", (int)service_name_len, service_name);
if (service_name == NULL)
return -EINVAL;
--
2.55.0
next prev parent reply other threads:[~2026-09-05 22:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-03 16:49 [PATCH] " Ömer Mete Kaya
2026-09-05 22:48 ` Ömer Mete Kaya [this message]
2026-09-06 0:38 ` [PATCH net v3] nfc: llcp: fix slab-out-of-bounds reads when logging service names Ömer Mete Kaya
2026-09-08 15:41 ` Simon Horman
2026-09-08 16:12 ` Ömer Mete Kaya
2026-09-08 16:20 ` Simon Horman
2026-09-10 3:51 ` [PATCH net v2] nfc: llcp: fix slab-out-of-bounds read in nfc_llcp_wks_sap() netdev-bot+sashiko
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=20260905225211.596366-1-omermetekaya0@gmail.com \
--to=omermetekaya0@gmail.com \
--cc=davem@davemloft.net \
--cc=david@ixit.cz \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=oe-linux-nfc@lists.linux.dev \
--cc=pabeni@redhat.com \
--cc=syzbot+1e3df0852e82c21ca418@syzkaller.appspotmail.com \
/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
all inboxes | Powered by JetHome®