Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH v1] Bluetooth: 6lowpan: Fix using chan->conn as indication to no remote netdev
@ 2026-06-12 14:29 Luiz Augusto von Dentz
  2026-06-12 16:15 ` [v1] " bluez.test.bot
  2026-06-12 16:42 ` [PATCH v1] " Siwei Zhang
  0 siblings, 2 replies; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2026-06-12 14:29 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

b66774b48dd9 ("Bluetooth: L2CAP: Fix UAF in channel timeout by holding
conn ref") don't reset the chan->conn to NULL anymore making the bt#
netdev not be remove once the last l2cap_chan_del is removed.

Instead of restoring the original behavior this remove the logic of
keeping the interface after the last channel is removed because it
never worked as intended and the l2cap_chan_del always detach its
l2cap_conn which results in always removing the channel anyway.

Fixes: b66774b48dd9 ("Bluetooth: L2CAP: Fix UAF in channel timeout by holding conn ref")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
 net/bluetooth/6lowpan.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c
index cb1e329d66fd..dba0c9128cf6 100644
--- a/net/bluetooth/6lowpan.c
+++ b/net/bluetooth/6lowpan.c
@@ -801,16 +801,6 @@ static void chan_close_cb(struct l2cap_chan *chan)
 
 	BT_DBG("chan %p conn %p", chan, chan->conn);
 
-	if (chan->conn && chan->conn->hcon) {
-		if (!is_bt_6lowpan(chan->conn->hcon))
-			return;
-
-		/* If conn is set, then the netdev is also there and we should
-		 * not remove it.
-		 */
-		remove = false;
-	}
-
 	spin_lock(&devices_lock);
 
 	list_for_each_entry_rcu(entry, &bt_6lowpan_devices, list) {
-- 
2.54.0


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

* RE: [v1] Bluetooth: 6lowpan: Fix using chan->conn as indication to no remote netdev
  2026-06-12 14:29 [PATCH v1] Bluetooth: 6lowpan: Fix using chan->conn as indication to no remote netdev Luiz Augusto von Dentz
@ 2026-06-12 16:15 ` bluez.test.bot
  2026-06-12 16:42 ` [PATCH v1] " Siwei Zhang
  1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2026-06-12 16:15 UTC (permalink / raw)
  To: linux-bluetooth, luiz.dentz

[-- Attachment #1: Type: text/plain, Size: 1946 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=1110712

---Test result---

Test Summary:
CheckPatch                    FAIL      0.65 seconds
VerifyFixes                   PASS      0.11 seconds
VerifySignedoff               PASS      0.11 seconds
GitLint                       PASS      0.29 seconds
SubjectPrefix                 PASS      0.10 seconds
BuildKernel                   PASS      27.16 seconds
CheckAllWarning               PASS      30.27 seconds
CheckSparse                   PASS      28.60 seconds
BuildKernel32                 PASS      26.79 seconds
TestRunnerSetup               PASS      591.54 seconds
TestRunner_6lowpan-tester     PASS      23.04 seconds
IncrementalBuild              PASS      26.01 seconds

Details
##############################
Test: CheckPatch - FAIL
Desc: Run checkpatch.pl script
Output:
[v1] Bluetooth: 6lowpan: Fix using chan->conn as indication to no remote netdev
ERROR: Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' - ie: 'commit b66774b48dd9 ("Bluetooth: L2CAP: Fix UAF in channel timeout by holding conn ref")'
#98: 
b66774b48dd9 ("Bluetooth: L2CAP: Fix UAF in channel timeout by holding

total: 1 errors, 0 warnings, 0 checks, 16 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

/github/workspace/src/patch/14626271.patch has style problems, please review.

NOTE: Ignored message types: UNKNOWN_COMMIT_ID

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.




https://github.com/bluez/bluetooth-next/pull/308

---
Regards,
Linux Bluetooth


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

* Re: [PATCH v1] Bluetooth: 6lowpan: Fix using chan->conn as indication to no remote netdev
  2026-06-12 14:29 [PATCH v1] Bluetooth: 6lowpan: Fix using chan->conn as indication to no remote netdev Luiz Augusto von Dentz
  2026-06-12 16:15 ` [v1] " bluez.test.bot
@ 2026-06-12 16:42 ` Siwei Zhang
  1 sibling, 0 replies; 3+ messages in thread
From: Siwei Zhang @ 2026-06-12 16:42 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth

Hi Luiz,

On Fri, Jun 12, 2026, at 10:29 AM, Luiz Augusto von Dentz wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
>
> b66774b48dd9 ("Bluetooth: L2CAP: Fix UAF in channel timeout by holding
> conn ref") don't reset the chan->conn to NULL anymore making the bt#
> netdev not be remove once the last l2cap_chan_del is removed.
>
> Instead of restoring the original behavior this remove the logic of
> keeping the interface after the last channel is removed because it
> never worked as intended and the l2cap_chan_del always detach its
> l2cap_conn which results in always removing the channel anyway.
>
> Fixes: b66774b48dd9 ("Bluetooth: L2CAP: Fix UAF in channel timeout by 
> holding conn ref")
> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

I think the 6lowpan CI failed because of this.
What about backporting it to stable here?
b66774b48dd9 ("Bluetooth: L2CAP: Fix UAF in channel timeout by holding
conn ref") has a cc to stable.

> ---
>  net/bluetooth/6lowpan.c | 10 ----------
>  1 file changed, 10 deletions(-)
>
> diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c
> index cb1e329d66fd..dba0c9128cf6 100644
> --- a/net/bluetooth/6lowpan.c
> +++ b/net/bluetooth/6lowpan.c
> @@ -801,16 +801,6 @@ static void chan_close_cb(struct l2cap_chan *chan)
> 
>  	BT_DBG("chan %p conn %p", chan, chan->conn);
> 
> -	if (chan->conn && chan->conn->hcon) {
> -		if (!is_bt_6lowpan(chan->conn->hcon))
> -			return;
> -
> -		/* If conn is set, then the netdev is also there and we should
> -		 * not remove it.
> -		 */
> -		remove = false;

After removing this, the remove var will always be true,
leaving the var and the corresponding checking redundant.

> -	}
> -
>  	spin_lock(&devices_lock);
> 
>  	list_for_each_entry_rcu(entry, &bt_6lowpan_devices, list) {
> -- 
> 2.54.0

Best,
Siwei

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

end of thread, other threads:[~2026-06-12 16:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-12 14:29 [PATCH v1] Bluetooth: 6lowpan: Fix using chan->conn as indication to no remote netdev Luiz Augusto von Dentz
2026-06-12 16:15 ` [v1] " bluez.test.bot
2026-06-12 16:42 ` [PATCH v1] " Siwei Zhang

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