public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: 6lowpan: replace sprintf() with scnprintf() in debugfs
@ 2025-12-05 17:53 Kathara Sasikumar
  2025-12-05 18:42 ` bluez.test.bot
  2025-12-06 13:57 ` [PATCH] " Simon Horman
  0 siblings, 2 replies; 3+ messages in thread
From: Kathara Sasikumar @ 2025-12-05 17:53 UTC (permalink / raw)
  To: alex.aring
  Cc: davem, edumazet, kuba, pabeni, horms, david.hunter.linux,
	linux-bluetooth, linux-wpan, netdev, linux-kernel, shuah, skhan,
	katharasasikumar007

sprintf() does not perform bounds checking on the destination buffer and
is deprecated in the kernel as documented in
Documentation/process/deprecated.rst.

Replace it with scnprintf() to ensure the write stays within bounds.

No functional change intended.

Signed-off-by: Kathara Sasikumar <katharasasikumar007@gmail.com>
---
 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: net: 6lowpan: replace sprintf() with scnprintf() in debugfs
  2025-12-05 17:53 [PATCH] net: 6lowpan: replace sprintf() with scnprintf() in debugfs Kathara Sasikumar
@ 2025-12-05 18:42 ` bluez.test.bot
  2025-12-06 13:57 ` [PATCH] " Simon Horman
  1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2025-12-05 18:42 UTC (permalink / raw)
  To: linux-bluetooth, katharasasikumar007

[-- Attachment #1: Type: text/plain, Size: 2759 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=1030938

---Test result---

Test Summary:
CheckPatch                    PENDING   0.29 seconds
GitLint                       PENDING   0.33 seconds
SubjectPrefix                 FAIL      0.45 seconds
BuildKernel                   PASS      24.56 seconds
CheckAllWarning               PASS      27.61 seconds
CheckSparse                   PASS      30.58 seconds
BuildKernel32                 PASS      24.34 seconds
TestRunnerSetup               PASS      545.39 seconds
TestRunner_l2cap-tester       PASS      24.18 seconds
TestRunner_iso-tester         PASS      75.31 seconds
TestRunner_bnep-tester        PASS      6.28 seconds
TestRunner_mgmt-tester        FAIL      114.12 seconds
TestRunner_rfcomm-tester      PASS      9.29 seconds
TestRunner_sco-tester         FAIL      14.31 seconds
TestRunner_ioctl-tester       PASS      9.95 seconds
TestRunner_mesh-tester        FAIL      11.47 seconds
TestRunner_smp-tester         PASS      8.52 seconds
TestRunner_userchan-tester    PASS      6.58 seconds
IncrementalBuild              PENDING   0.60 seconds

Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:

##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:

##############################
Test: SubjectPrefix - FAIL
Desc: Check subject contains "Bluetooth" prefix
Output:
"Bluetooth: " prefix is not specified in the subject
##############################
Test: TestRunner_mgmt-tester - FAIL
Desc: Run mgmt-tester with test-runner
Output:
Total: 494, Passed: 489 (99.0%), Failed: 1, Not Run: 4

Failed Test Cases
Read Exp Feature - Success                           Failed       0.105 seconds
##############################
Test: TestRunner_sco-tester - FAIL
Desc: Run sco-tester with test-runner
Output:
WARNING: possible circular locking dependency detected
BUG: sleeping function called from invalid context at net/core/sock.c:3782
Total: 30, Passed: 30 (100.0%), Failed: 0, Not Run: 0
##############################
Test: TestRunner_mesh-tester - FAIL
Desc: Run mesh-tester with test-runner
Output:
Total: 10, Passed: 8 (80.0%), Failed: 2, Not Run: 0

Failed Test Cases
Mesh - Send cancel - 1                               Timed out    1.974 seconds
Mesh - Send cancel - 2                               Timed out    1.998 seconds
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:



---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] net: 6lowpan: replace sprintf() with scnprintf() in debugfs
  2025-12-05 17:53 [PATCH] net: 6lowpan: replace sprintf() with scnprintf() in debugfs Kathara Sasikumar
  2025-12-05 18:42 ` bluez.test.bot
@ 2025-12-06 13:57 ` Simon Horman
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2025-12-06 13:57 UTC (permalink / raw)
  To: Kathara Sasikumar
  Cc: alex.aring, davem, edumazet, kuba, pabeni, david.hunter.linux,
	linux-bluetooth, linux-wpan, netdev, linux-kernel, shuah, skhan

On Fri, Dec 05, 2025 at 05:53:24PM +0000, Kathara Sasikumar wrote:
> sprintf() does not perform bounds checking on the destination buffer and
> is deprecated in the kernel as documented in
> Documentation/process/deprecated.rst.

Hi Kathara,

Thanks for your patch.

While I do see this mentioned at [1], and I do agree with the approach
taken here, I don't see it mentioned in deprecated.rst in net-next or
Linus' tree.

[1] https://lwn.net/Articles/69419/
[2] https://lore.kernel.org/netdev/20251017094954.1402684-1-wintera@linux.ibm.com/

> 
> Replace it with scnprintf() to ensure the write stays within bounds.
> 
> No functional change intended.
> 
> Signed-off-by: Kathara Sasikumar <katharasasikumar007@gmail.com>

This patch looks like it should be targeted at net-next,
and that should be done like this.

Subject: [PATCH net-next] ...

But unfortunately net-next is currently closed.

## Form letter - net-next-closed

The merge window for v6.19 has begun and therefore net-next has closed
for new drivers, features, code refactoring and optimizations. We are
currently accepting bug fixes only.

Please repost when net-next reopens.

Due to a combination of the merge-window, travel commitments of the
maintainers, and the holiday season, net-next will re-open after
2nd January.

RFC patches sent for review only are welcome at any time.

See: https://www.kernel.org/doc/html/next/process/maintainer-netdev.html#development-cycle

-- 
pw-bot: changes-requested

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-12-06 13:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-05 17:53 [PATCH] net: 6lowpan: replace sprintf() with scnprintf() in debugfs Kathara Sasikumar
2025-12-05 18:42 ` bluez.test.bot
2025-12-06 13:57 ` [PATCH] " Simon Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox