Skip to contentSkip to conversation

memory leak in skb_clone (3)

syzbot syzbot 1 participant 7 messages Jan 7 – Mar 9

Subsystems (4)
lore
Share & tools
lore

syzbot

author syzbot
#0 lore raw

Hello,

syzbot found the following issue on:

HEAD commit:    4a26e7032d7d Merge tag 'core-bugs-2025-12-01' of git://git..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=116a9512580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=cbf343972ee89096
dashboard link: https://syzkaller.appspot.com/bug?extid=6e76aa21aaf2d8be6034
compiler:       gcc (Debian 12.2.0-14+deb12u1) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=179be192580000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=15cd92b4580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/3f4ff8b7d65f/disk-4a26e703.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/2fbb585ef1ac/vmlinux-4a26e703.xz
kernel image: https://storage.googleapis.com/syzbot-assets/dfdc58db78d3/bzImage-4a26e703.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:

Reported-by [email protected]

2025/12/03 00:25:54 executed programs: 5

BUG: memory leak
unreferenced object 0xffff88811a1e1100 (size 240):
  comm "kworker/u9:0", pid 51, jiffies 4294944590
  hex dump (first 32 bytes):
    90 50 50 42 81 88 ff ff 90 50 50 42 81 88 ff ff  .PPB.....PPB....
    00 00 00 00 00 00 00 00 00 50 50 42 81 88 ff ff  .........PPB....
  backtrace (crc eed28d2d):
    kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]
    slab_post_alloc_hook mm/slub.c:4983 [inline]
    slab_alloc_node mm/slub.c:5288 [inline]
    kmem_cache_alloc_noprof+0x397/0x5a0 mm/slub.c:5295
    skb_clone+0xae/0x2b0 net/core/skbuff.c:2050
    __skb_tstamp_tx+0x3a0/0x4c0 net/core/skbuff.c:5636
    hci_conn_tx_queue+0x11c/0x1d0 net/bluetooth/hci_conn.c:3026
    hci_send_conn_frame net/bluetooth/hci_core.c:3086 [inline]
    hci_sched_acl_pkt net/bluetooth/hci_core.c:3701 [inline]
    hci_sched_acl net/bluetooth/hci_core.c:3726 [inline]
    hci_tx_work+0x437/0x570 net/bluetooth/hci_core.c:3820
    process_one_work+0x26b/0x620 kernel/workqueue.c:3263
    process_scheduled_works kernel/workqueue.c:3346 [inline]
    worker_thread+0x2c4/0x4f0 kernel/workqueue.c:3427
    kthread+0x15b/0x310 kernel/kthread.c:463
    ret_from_fork+0x2af/0x2e0 arch/x86/kernel/process.c:158
    ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245

connection error: failed to recv *flatrpc.ExecutorMessageRawT: EOF

---
This report is generated by a bot. It may contain errors. See https://goo.gl/tpsmEJ for more information about syzbot. syzbot engineers can be reached at [email protected].

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

author syzbot
#1 lore raw

Forwarded: [PATCH] Bluetooth: hci_conn: Fix memory leak in tx_q on connection teardown

For archival purposes, forwarding an incoming command email to [email protected], [email protected].

For archival purposes, forwarding an incoming command email to [email protected], [email protected].

***

Subject: [PATCH] Bluetooth: hci_conn: Fix memory leak in tx_q on connection teardown
Author: [email protected]

#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master

Cloned SKBs queued in conn->tx_q.queue for TX timestamp tracking are not freed if the connection is torn down before all completion events arrive. Add skb_queue_purge() in hci_conn_cleanup() to fix the leak.

---
 net/bluetooth/hci_conn.c | 1 +
 1 file changed, 1 insertion(+)
net/bluetooth/hci_conn.c +1 -0
index c3f7828bf9d5..3fb93faf60f3 100644
@@ -148,6 +148,7 @@ static void hci_conn_cleanup(struct hci_conn *conn)
 		hci_remove_link_key(hdev, &conn->dst);
 
 	hci_chan_list_flush(conn);
+	skb_queue_purge(&conn->tx_q.queue);
 
 	if (HCI_CONN_HANDLE_UNSET(conn->handle))
 		ida_free(&hdev->unset_handle_ida, conn->handle);
Signature · 1 line
2.43.0
author syzbot
#2 lore raw

Forwarded: [PATCH] Bluetooth: hci_conn: Fix memory leak in tx_q on connection teardown

In reply to syzbot
For archival purposes, forwarding an incoming command email to [email protected], [email protected].

For archival purposes, forwarding an incoming command email to [email protected], [email protected].

***

Subject: [PATCH] Bluetooth: hci_conn: Fix memory leak in tx_q on connection teardown
Author: [email protected]

#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master

Cloned SKBs queued in conn->tx_q.queue for TX timestamp tracking are not freed if the connection is torn down before all completion events arrive. Add skb_queue_purge() in hci_conn_cleanup() to fix the leak.

---
 net/bluetooth/hci_conn.c | 1 +
 1 file changed, 1 insertion(+)
net/bluetooth/hci_conn.c +1 -0
index c3f7828bf9d5..3fb93faf60f3 100644
@@ -148,6 +148,7 @@ static void hci_conn_cleanup(struct hci_conn *conn)
 		hci_remove_link_key(hdev, &conn->dst);
 
 	hci_chan_list_flush(conn);
+	skb_queue_purge(&conn->tx_q.queue);
 
 	if (HCI_CONN_HANDLE_UNSET(conn->handle))
 		ida_free(&hdev->unset_handle_ida, conn->handle);
Signature · 1 line
2.43.0
author syzbot
#3 lore raw

Forwarded: [PATCH] Bluetooth: hci_conn: Fix memory leak in tx_q on connection teardown

In reply to syzbot
For archival purposes, forwarding an incoming command email to [email protected], [email protected].

For archival purposes, forwarding an incoming command email to [email protected], [email protected].

***

Subject: [PATCH] Bluetooth: hci_conn: Fix memory leak in tx_q on connection teardown
Author: [email protected]

#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master

Cloned SKBs queued in conn->tx_q.queue for TX timestamp tracking are not freed if the connection is torn down before all completion events arrive. Add skb_queue_purge() in hci_conn_cleanup() to fix the leak.

---
 net/bluetooth/hci_conn.c | 1 +
 1 file changed, 1 insertion(+)
net/bluetooth/hci_conn.c +1 -0
index c3f7828bf9d5..3fb93faf60f3 100644
@@ -148,6 +148,7 @@ static void hci_conn_cleanup(struct hci_conn *conn)
 		hci_remove_link_key(hdev, &conn->dst);
 
 	hci_chan_list_flush(conn);
+	skb_queue_purge(&conn->tx_q.queue);
 
 	if (HCI_CONN_HANDLE_UNSET(conn->handle))
 		ida_free(&hdev->unset_handle_ida, conn->handle);
Signature · 1 line
2.43.0
author syzbot
#4 lore raw

Forwarded: Re: [syzbot] [batman?] [bluetooth?] memory leak in skb_clone (3)

In reply to syzbot
For archival purposes, forwarding an incoming command email to [email protected].

For archival purposes, forwarding an incoming command email to [email protected].

***

Subject: Re: [syzbot] [batman?] [bluetooth?] memory leak in skb_clone (3)
Author: [email protected]

#syz test:
git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git
master

Signature · 3 lines
You received this message because you are subscribed to the Google Groups "syzkaller-bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/syzkaller-bugs/0690b0d4-3f1c-48a0-ada9-b53f1a1f0646n%40googlegroups.com.
author syzbot
#5 lore raw

Forwarded: Re: [syzbot] [bluetooth?] [batman?] memory leak in skb_clone (3)

In reply to syzbot
For archival purposes, forwarding an incoming command email to [email protected].

For archival purposes, forwarding an incoming command email to [email protected].

***

Subject: Re: [syzbot] [bluetooth?] [batman?] memory leak in skb_clone (3)
Author: [email protected]

#syz test: upstream 21e4271e65094172aadd5beb8caea95dd0fbf6d7

Signature · 3 lines
You received this message because you are subscribed to the Google Groups "syzkaller-bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/syzkaller-bugs/3430dd6b-9845-4256-b06a-c2ed905633d8n%40googlegroups.com.
author syzbot
#6 lore raw

Forwarded: Re: [syzbot] [bluetooth?] [batman?] memory leak in skb_clone (3)

In reply to syzbot
For archival purposes, forwarding an incoming command email to [email protected].

For archival purposes, forwarding an incoming command email to [email protected].

***

Subject: Re: [syzbot] [bluetooth?] [batman?] memory leak in skb_clone (3)
Author: [email protected]

#syz fix: Bluetooth: purge error queues in socket destructors

Signature · 3 lines
You received this message because you are subscribed to the Google Groups "syzkaller-bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/syzkaller-bugs/7c4d7e3f-b999-4de0-a94a-d3eaa3ca7307n%40googlegroups.com.