From: Kathara Sasikumar <katharasasikumar007@gmail.com>
To: alex.aring@gmail.com, horms@kernel.org
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, linux-bluetooth@vger.kernel.org,
linux-wpan@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org,
Kathara Sasikumar <katharasasikumar007@gmail.com>
Subject: [PATCH v2 net-next] net: 6lowpan: replace sprintf() with scnprintf() in debugfs
Date: Tue, 6 Jan 2026 17:16:11 +0000 [thread overview]
Message-ID: <20260106171610.124138-2-katharasasikumar007@gmail.com> (raw)
sprintf() does not perform bounds checking on the destination buffer.
Replace it with scnprintf() to ensure the write stays within bounds.
No functional change intended.
Signed-off-by: Kathara Sasikumar <katharasasikumar007@gmail.com>
---
v2:
- Updated commit message wording
- Targeted the patch to net-next
---
net/6lowpan/debugfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/6lowpan/debugfs.c b/net/6lowpan/debugfs.c
index 600b9563bfc5..d45ace484143 100644
--- a/net/6lowpan/debugfs.c
+++ b/net/6lowpan/debugfs.c
@@ -173,7 +173,7 @@ static void lowpan_dev_debugfs_ctx_init(struct net_device *dev,
if (WARN_ON_ONCE(id >= LOWPAN_IPHC_CTX_TABLE_SIZE))
return;
- sprintf(buf, "%d", id);
+ scnprintf(buf, sizeof(buf), "%d", id);
root = debugfs_create_dir(buf, ctx);
--
2.51.0
next reply other threads:[~2026-01-06 17:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-06 17:16 Kathara Sasikumar [this message]
2026-01-09 2:02 ` [PATCH v2 net-next] net: 6lowpan: replace sprintf() with scnprintf() in debugfs Jakub Kicinski
2026-01-09 17:24 ` Simon Horman
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=20260106171610.124138-2-katharasasikumar007@gmail.com \
--to=katharasasikumar007@gmail.com \
--cc=alex.aring@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wpan@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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