[syzbot] [bluetooth?] KASAN: slab-use-after-free Read in hci_send_acl

30 views
Skip to first unread message

syzbot

unread,
Aug 21, 2023, 12:26:50 PM8/21/23
to johan....@gmail.com, linux-b...@vger.kernel.org, linux-...@vger.kernel.org, luiz....@gmail.com, mar...@holtmann.org, syzkall...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 7271b2a53042 Add linux-next specific files for 20230818
git tree: linux-next
console+strace: https://syzkaller.appspot.com/x/log.txt?x=13404b6ba80000
kernel config: https://syzkaller.appspot.com/x/.config?x=1936af09cdef7dd6
dashboard link: https://syzkaller.appspot.com/bug?extid=a0c80b06ae2cb8895bc4
compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=13506923a80000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=147569efa80000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/d81109bc02c1/disk-7271b2a5.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/4b3bf8e2a4f7/vmlinux-7271b2a5.xz
kernel image: https://storage.googleapis.com/syzbot-assets/6404cd473c1e/bzImage-7271b2a5.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+a0c80b...@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: slab-use-after-free in hci_send_acl+0xdf4/0xf30 net/bluetooth/hci_core.c:3228
Read of size 8 at addr ffff888025635618 by task kworker/1:1/27

CPU: 1 PID: 27 Comm: kworker/1:1 Not tainted 6.5.0-rc6-next-20230818-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023
Workqueue: events l2cap_info_timeout
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:364 [inline]
print_report+0xc4/0x620 mm/kasan/report.c:475
kasan_report+0xda/0x110 mm/kasan/report.c:588
hci_send_acl+0xdf4/0xf30 net/bluetooth/hci_core.c:3228
l2cap_send_cmd+0x6dd/0x920 net/bluetooth/l2cap_core.c:977
l2cap_send_conn_req+0x1e5/0x260 net/bluetooth/l2cap_core.c:1286
l2cap_start_connection+0x11e/0x420 net/bluetooth/l2cap_core.c:1514
l2cap_conn_start+0x7ae/0xa40 net/bluetooth/l2cap_core.c:1661
process_one_work+0x887/0x15d0 kernel/workqueue.c:2630
process_scheduled_works kernel/workqueue.c:2703 [inline]
worker_thread+0x8bb/0x1290 kernel/workqueue.c:2784
kthread+0x33a/0x430 kernel/kthread.c:388
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304
</TASK>

Allocated by task 5046:
kasan_save_stack+0x33/0x50 mm/kasan/common.c:45
kasan_set_track+0x25/0x30 mm/kasan/common.c:52
____kasan_kmalloc mm/kasan/common.c:374 [inline]
__kasan_kmalloc+0xa2/0xb0 mm/kasan/common.c:383
kmalloc include/linux/slab.h:600 [inline]
kzalloc include/linux/slab.h:721 [inline]
hci_chan_create+0xa6/0x3a0 net/bluetooth/hci_conn.c:2691
l2cap_conn_add.part.0+0x1a/0xdf0 net/bluetooth/l2cap_core.c:7841
l2cap_conn_add include/net/bluetooth/l2cap.h:866 [inline]
l2cap_chan_connect+0x15b9/0x2140 net/bluetooth/l2cap_core.c:8053
bt_6lowpan_connect net/bluetooth/6lowpan.c:894 [inline]
lowpan_control_write+0x3d6/0x730 net/bluetooth/6lowpan.c:1129
full_proxy_write+0x124/0x190 fs/debugfs/file.c:236
vfs_write+0x2a4/0xe40 fs/read_write.c:582
ksys_write+0x12f/0x250 fs/read_write.c:637
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd

Freed by task 50:
kasan_save_stack+0x33/0x50 mm/kasan/common.c:45
kasan_set_track+0x25/0x30 mm/kasan/common.c:52
kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:522
____kasan_slab_free mm/kasan/common.c:236 [inline]
____kasan_slab_free+0x15b/0x1b0 mm/kasan/common.c:200
kasan_slab_free include/linux/kasan.h:164 [inline]
slab_free_hook mm/slub.c:1800 [inline]
slab_free_freelist_hook+0x114/0x1e0 mm/slub.c:1826
slab_free mm/slub.c:3809 [inline]
__kmem_cache_free+0xb8/0x2f0 mm/slub.c:3822
hci_chan_list_flush+0x81/0xf0 net/bluetooth/hci_conn.c:2731
hci_conn_cleanup net/bluetooth/hci_conn.c:152 [inline]
hci_conn_del+0x1fc/0xd10 net/bluetooth/hci_conn.c:1140
hci_abort_conn_sync+0xacb/0xe20 net/bluetooth/hci_sync.c:5432
abort_conn_sync+0x18e/0x3a0 net/bluetooth/hci_conn.c:2878
hci_cmd_sync_work+0x1a4/0x3c0 net/bluetooth/hci_sync.c:306
process_one_work+0x887/0x15d0 kernel/workqueue.c:2630
process_scheduled_works kernel/workqueue.c:2703 [inline]
worker_thread+0x8bb/0x1290 kernel/workqueue.c:2784
kthread+0x33a/0x430 kernel/kthread.c:388
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304

Last potentially related work creation:
kasan_save_stack+0x33/0x50 mm/kasan/common.c:45
__kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:492
kvfree_call_rcu+0x70/0xbe0 kernel/rcu/tree.c:3373
kernfs_unlink_open_file+0x3b6/0x4b0 fs/kernfs/file.c:633
kernfs_fop_release+0xec/0x1e0 fs/kernfs/file.c:805
__fput+0x3f7/0xa70 fs/file_table.c:384
__fput_sync+0x47/0x50 fs/file_table.c:465
__do_sys_close fs/open.c:1572 [inline]
__se_sys_close fs/open.c:1557 [inline]
__x64_sys_close+0x87/0xf0 fs/open.c:1557
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd

Second to last potentially related work creation:
kasan_save_stack+0x33/0x50 mm/kasan/common.c:45
__kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:492
kvfree_call_rcu+0x70/0xbe0 kernel/rcu/tree.c:3373
kernfs_unlink_open_file+0x3b6/0x4b0 fs/kernfs/file.c:633
kernfs_fop_release+0xec/0x1e0 fs/kernfs/file.c:805
__fput+0x3f7/0xa70 fs/file_table.c:384
__fput_sync+0x47/0x50 fs/file_table.c:465
__do_sys_close fs/open.c:1572 [inline]
__se_sys_close fs/open.c:1557 [inline]
__x64_sys_close+0x87/0xf0 fs/open.c:1557
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd

The buggy address belongs to the object at ffff888025635600
which belongs to the cache kmalloc-128 of size 128
The buggy address is located 24 bytes inside of
freed 128-byte region [ffff888025635600, ffff888025635680)

The buggy address belongs to the physical page:
page:ffffea0000958d40 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x25635
flags: 0xfff00000000800(slab|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000800 ffff888012c418c0 dead000000000100 dead000000000122
raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 4500, tgid 4500 (udevd), ts 28013160887, free_ts 27864795775
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x2cf/0x340 mm/page_alloc.c:1536
prep_new_page mm/page_alloc.c:1543 [inline]
get_page_from_freelist+0x10d7/0x31b0 mm/page_alloc.c:3219
__alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4475
alloc_pages+0x1a9/0x270 mm/mempolicy.c:2298
alloc_slab_page mm/slub.c:1870 [inline]
allocate_slab+0x251/0x380 mm/slub.c:2017
new_slab mm/slub.c:2070 [inline]
___slab_alloc+0x8be/0x1570 mm/slub.c:3223
__slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3322
__slab_alloc_node mm/slub.c:3375 [inline]
slab_alloc_node mm/slub.c:3468 [inline]
__kmem_cache_alloc_node+0x137/0x350 mm/slub.c:3517
kmalloc_trace+0x25/0xe0 mm/slab_common.c:1095
kmalloc include/linux/slab.h:600 [inline]
kzalloc include/linux/slab.h:721 [inline]
kernfs_get_open_node fs/kernfs/file.c:572 [inline]
kernfs_fop_open+0xad1/0xe00 fs/kernfs/file.c:740
do_dentry_open+0x88b/0x1730 fs/open.c:929
do_open fs/namei.c:3636 [inline]
path_openat+0x19af/0x29c0 fs/namei.c:3793
do_filp_open+0x1de/0x430 fs/namei.c:3820
do_sys_openat2+0x176/0x1e0 fs/open.c:1422
do_sys_open fs/open.c:1437 [inline]
__do_sys_openat fs/open.c:1453 [inline]
__se_sys_openat fs/open.c:1448 [inline]
__x64_sys_openat+0x175/0x210 fs/open.c:1448
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1136 [inline]
free_unref_page_prepare+0x476/0xa40 mm/page_alloc.c:2348
free_unref_page+0x33/0x3b0 mm/page_alloc.c:2441
qlink_free mm/kasan/quarantine.c:166 [inline]
qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:185
kasan_quarantine_reduce+0x18b/0x1d0 mm/kasan/quarantine.c:292
__kasan_slab_alloc+0x65/0x90 mm/kasan/common.c:305
kasan_slab_alloc include/linux/kasan.h:188 [inline]
slab_post_alloc_hook mm/slab.h:762 [inline]
slab_alloc_node mm/slub.c:3478 [inline]
slab_alloc mm/slub.c:3486 [inline]
__kmem_cache_alloc_lru mm/slub.c:3493 [inline]
kmem_cache_alloc+0x172/0x3b0 mm/slub.c:3502
getname_flags.part.0+0x50/0x4d0 fs/namei.c:140
getname_flags include/linux/audit.h:319 [inline]
getname+0x90/0xe0 fs/namei.c:219
do_sys_openat2+0x100/0x1e0 fs/open.c:1416
do_sys_open fs/open.c:1437 [inline]
__do_sys_openat fs/open.c:1453 [inline]
__se_sys_openat fs/open.c:1448 [inline]
__x64_sys_openat+0x175/0x210 fs/open.c:1448
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd

Memory state around the buggy address:
ffff888025635500: 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc
ffff888025635580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888025635600: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888025635680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888025635700: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================


---
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 syzk...@googlegroups.com.

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

If the bug is already fixed, 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 bug's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

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

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

Pauli Virtanen

unread,
Aug 21, 2023, 2:09:46 PM8/21/23
to syzbot, syzkall...@googlegroups.com
#syz test git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git f0835e7404b7f6fd825fc1ad7a174253a54234cf

diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index ae206eb551f7..b65a1e9b178b 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -2861,7 +2861,7 @@ static int abort_conn_sync(struct hci_dev *hdev, void *data)
u16 handle = PTR_ERR(data);

conn = hci_conn_hash_lookup_handle(hdev, handle);
- if (!conn)
+ if (!conn || !conn->abort_reason)
return 0;

return hci_abort_conn_sync(hdev, conn, conn->abort_reason);
@@ -2876,6 +2876,8 @@ int hci_abort_conn(struct hci_conn *conn, u8 reason)
*/
if (conn->abort_reason)
return 0;
+ if (!reason)
+ return -EINVAL;

bt_dev_dbg(hdev, "handle 0x%2.2x reason 0x%2.2x", conn->handle, reason);

--
2.41.0

syzbot

unread,
Aug 21, 2023, 2:57:38 PM8/21/23
to p...@iki.fi, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-and-tested-by: syzbot+a0c80b...@syzkaller.appspotmail.com

Tested on:

commit: f0835e74 Bluetooth: ISO: Use defer setup to separate P..
git tree: git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git
console output: https://syzkaller.appspot.com/x/log.txt?x=1622c6f7a80000
kernel config: https://syzkaller.appspot.com/x/.config?x=4b3a4035b595be0
dashboard link: https://syzkaller.appspot.com/bug?extid=a0c80b06ae2cb8895bc4
compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
patch: https://syzkaller.appspot.com/x/patch.diff?x=122cbd07a80000

Note: testing is done by a robot and is best-effort only.

Pauli Virtanen

unread,
Aug 21, 2023, 3:36:01 PM8/21/23
to syzbot, syzkall...@googlegroups.com
#syz test git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git f0835e7404b7f6fd825fc1ad7a174253a54234cf

diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 8b0c8e631324..cfaed01c7b97 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -2887,6 +2887,8 @@ int hci_abort_conn(struct hci_conn *conn, u8 reason)

syzbot

unread,
Aug 21, 2023, 4:02:36 PM8/21/23
to p...@iki.fi, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
KASAN: slab-use-after-free Read in hci_send_acl

==================================================================
BUG: KASAN: slab-use-after-free in hci_send_acl+0xdf4/0xf30 net/bluetooth/hci_core.c:3228
Read of size 8 at addr ffff888068e89118 by task kworker/1:3/5394

CPU: 1 PID: 5394 Comm: kworker/1:3 Not tainted 6.5.0-rc5-syzkaller-01535-gf0835e7404b7-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023
Workqueue: events l2cap_info_timeout
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:364 [inline]
print_report+0xc4/0x620 mm/kasan/report.c:475
kasan_report+0xda/0x110 mm/kasan/report.c:588
hci_send_acl+0xdf4/0xf30 net/bluetooth/hci_core.c:3228
l2cap_send_cmd+0x6dd/0x920 net/bluetooth/l2cap_core.c:977
l2cap_send_conn_req+0x1e5/0x260 net/bluetooth/l2cap_core.c:1286
l2cap_start_connection+0x11e/0x420 net/bluetooth/l2cap_core.c:1514
l2cap_conn_start+0x7ae/0xa40 net/bluetooth/l2cap_core.c:1661
process_one_work+0xaa2/0x16f0 kernel/workqueue.c:2600
worker_thread+0x687/0x1110 kernel/workqueue.c:2751
kthread+0x33a/0x430 kernel/kthread.c:389
ret_from_fork+0x2c/0x70 arch/x86/kernel/process.c:145
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304
</TASK>

Allocated by task 5435:
kasan_save_stack+0x33/0x50 mm/kasan/common.c:45
kasan_set_track+0x25/0x30 mm/kasan/common.c:52
____kasan_kmalloc mm/kasan/common.c:374 [inline]
__kasan_kmalloc+0xa2/0xb0 mm/kasan/common.c:383
kmalloc include/linux/slab.h:582 [inline]
kzalloc include/linux/slab.h:703 [inline]
hci_chan_create+0xa6/0x3a0 net/bluetooth/hci_conn.c:2691
l2cap_conn_add.part.0+0x1a/0xdf0 net/bluetooth/l2cap_core.c:7841
l2cap_conn_add include/net/bluetooth/l2cap.h:866 [inline]
l2cap_chan_connect+0x15b9/0x2140 net/bluetooth/l2cap_core.c:8053
bt_6lowpan_connect net/bluetooth/6lowpan.c:894 [inline]
lowpan_control_write+0x3d6/0x730 net/bluetooth/6lowpan.c:1129
full_proxy_write+0x124/0x190 fs/debugfs/file.c:236
vfs_write+0x2a4/0xe40 fs/read_write.c:582
ksys_write+0x12f/0x250 fs/read_write.c:637
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd

Freed by task 4432:
kasan_save_stack+0x33/0x50 mm/kasan/common.c:45
kasan_set_track+0x25/0x30 mm/kasan/common.c:52
kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:522
____kasan_slab_free mm/kasan/common.c:236 [inline]
____kasan_slab_free+0x15e/0x1b0 mm/kasan/common.c:200
kasan_slab_free include/linux/kasan.h:162 [inline]
slab_free_hook mm/slub.c:1792 [inline]
slab_free_freelist_hook+0x10b/0x1e0 mm/slub.c:1818
slab_free mm/slub.c:3801 [inline]
__kmem_cache_free+0xb8/0x2f0 mm/slub.c:3814
hci_chan_list_flush+0x81/0xf0 net/bluetooth/hci_conn.c:2731
hci_conn_cleanup net/bluetooth/hci_conn.c:152 [inline]
hci_conn_del+0x1fc/0xd10 net/bluetooth/hci_conn.c:1140
hci_abort_conn_sync+0xacb/0xe20 net/bluetooth/hci_sync.c:5432
abort_conn_sync+0x18e/0x3a0 net/bluetooth/hci_conn.c:2878
hci_cmd_sync_work+0x1a4/0x3c0 net/bluetooth/hci_sync.c:306
process_one_work+0xaa2/0x16f0 kernel/workqueue.c:2600
worker_thread+0x687/0x1110 kernel/workqueue.c:2751
kthread+0x33a/0x430 kernel/kthread.c:389
ret_from_fork+0x2c/0x70 arch/x86/kernel/process.c:145
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304

Last potentially related work creation:
kasan_save_stack+0x33/0x50 mm/kasan/common.c:45
__kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:492
__call_rcu_common.constprop.0+0x9a/0x790 kernel/rcu/tree.c:2649
collapse net/ipv4/fib_trie.c:703 [inline]
resize+0x1d73/0x2250 net/ipv4/fib_trie.c:906
trie_rebalance net/ipv4/fib_trie.c:1106 [inline]
fib_remove_alias net/ipv4/fib_trie.c:1667 [inline]
fib_remove_alias+0x324/0x480 net/ipv4/fib_trie.c:1649
fib_table_delete+0x6d7/0x9f0 net/ipv4/fib_trie.c:1772
fib_magic+0x329/0x560 net/ipv4/fib_frontend.c:1106
fib_del_ifaddr+0xb0d/0x14d0 net/ipv4/fib_frontend.c:1317
fib_inetaddr_event+0xb8/0x2a0 net/ipv4/fib_frontend.c:1448
notifier_call_chain+0xb6/0x3b0 kernel/notifier.c:93
blocking_notifier_call_chain kernel/notifier.c:388 [inline]
blocking_notifier_call_chain+0x69/0x90 kernel/notifier.c:376
__inet_del_ifa+0x417/0x1030 net/ipv4/devinet.c:432
inet_del_ifa net/ipv4/devinet.c:469 [inline]
inetdev_destroy net/ipv4/devinet.c:322 [inline]
inetdev_event+0x5bb/0x1900 net/ipv4/devinet.c:1606
notifier_call_chain+0xb6/0x3b0 kernel/notifier.c:93
call_netdevice_notifiers_info+0xb9/0x130 net/core/dev.c:1970
call_netdevice_notifiers_extack net/core/dev.c:2008 [inline]
call_netdevice_notifiers net/core/dev.c:2022 [inline]
unregister_netdevice_many_notify+0x85f/0x1a20 net/core/dev.c:10930
unregister_netdevice_many net/core/dev.c:10986 [inline]
default_device_exit_batch+0x584/0x740 net/core/dev.c:11445
ops_exit_list+0x125/0x170 net/core/net_namespace.c:175
cleanup_net+0x505/0xb20 net/core/net_namespace.c:614
process_one_work+0xaa2/0x16f0 kernel/workqueue.c:2600
worker_thread+0x687/0x1110 kernel/workqueue.c:2751
kthread+0x33a/0x430 kernel/kthread.c:389
ret_from_fork+0x2c/0x70 arch/x86/kernel/process.c:145
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304

The buggy address belongs to the object at ffff888068e89100
which belongs to the cache kmalloc-128 of size 128
The buggy address is located 24 bytes inside of
freed 128-byte region [ffff888068e89100, ffff888068e89180)

The buggy address belongs to the physical page:
page:ffffea0001a3a240 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x68e89
ksm flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000200 ffff8880128418c0 ffffea0000a71b40 dead000000000003
raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0x12820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY), pid 9, tgid 9 (kworker/0:1), ts 54053813563, free_ts 14688260990
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x2d2/0x350 mm/page_alloc.c:1570
prep_new_page mm/page_alloc.c:1577 [inline]
get_page_from_freelist+0x10a9/0x31e0 mm/page_alloc.c:3221
__alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4477
alloc_pages+0x1a9/0x270 mm/mempolicy.c:2292
alloc_slab_page mm/slub.c:1862 [inline]
allocate_slab+0x24e/0x380 mm/slub.c:2009
new_slab mm/slub.c:2062 [inline]
___slab_alloc+0x8bc/0x1570 mm/slub.c:3215
__slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3314
__slab_alloc_node mm/slub.c:3367 [inline]
slab_alloc_node mm/slub.c:3460 [inline]
__kmem_cache_alloc_node+0x137/0x350 mm/slub.c:3509
kmalloc_trace+0x25/0xe0 mm/slab_common.c:1076
kmalloc include/linux/slab.h:582 [inline]
__hw_addr_create net/core/dev_addr_lists.c:60 [inline]
__hw_addr_add_ex+0x3cb/0x7f0 net/core/dev_addr_lists.c:118
__dev_mc_add net/core/dev_addr_lists.c:867 [inline]
dev_mc_add+0xc3/0x110 net/core/dev_addr_lists.c:885
igmp6_group_added+0x375/0x420 net/ipv6/mcast.c:680
__ipv6_dev_mc_inc+0x72a/0xc40 net/ipv6/mcast.c:949
addrconf_join_solict net/ipv6/addrconf.c:2189 [inline]
addrconf_dad_begin net/ipv6/addrconf.c:4033 [inline]
addrconf_dad_work+0x232/0x13e0 net/ipv6/addrconf.c:4158
process_one_work+0xaa2/0x16f0 kernel/workqueue.c:2600
worker_thread+0x687/0x1110 kernel/workqueue.c:2751
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1161 [inline]
free_unref_page_prepare+0x508/0xb90 mm/page_alloc.c:2348
free_unref_page+0x33/0x3b0 mm/page_alloc.c:2443
free_contig_range+0xb6/0x190 mm/page_alloc.c:6395
destroy_args+0x686/0x940 mm/debug_vm_pgtable.c:1029
debug_vm_pgtable+0x2339/0x3ff0 mm/debug_vm_pgtable.c:1410
do_one_initcall+0x117/0x630 init/main.c:1232
do_initcall_level init/main.c:1294 [inline]
do_initcalls init/main.c:1310 [inline]
do_basic_setup init/main.c:1329 [inline]
kernel_init_freeable+0x5bd/0x8f0 init/main.c:1546
kernel_init+0x1c/0x2a0 init/main.c:1437
ret_from_fork+0x2c/0x70 arch/x86/kernel/process.c:145
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304

Memory state around the buggy address:
ffff888068e89000: 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc
ffff888068e89080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888068e89100: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888068e89180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888068e89200: 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc
==================================================================


Tested on:

commit: f0835e74 Bluetooth: ISO: Use defer setup to separate P..
git tree: git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git
console output: https://syzkaller.appspot.com/x/log.txt?x=1346e1d3a80000
kernel config: https://syzkaller.appspot.com/x/.config?x=4b3a4035b595be0
dashboard link: https://syzkaller.appspot.com/bug?extid=a0c80b06ae2cb8895bc4
compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
patch: https://syzkaller.appspot.com/x/patch.diff?x=15d8933da80000

Hillf Danton

unread,
Aug 22, 2023, 7:27:13 AM8/22/23
to syzbot, linux-...@vger.kernel.org, syzkall...@googlegroups.com
On Mon, 21 Aug 2023 09:26:48 -0700
> HEAD commit: 7271b2a53042 Add linux-next specific files for 20230818
> git tree: linux-next
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=147569efa80000

Delete hci channel after canceling worker.

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 7271b2a53042

--- x/net/bluetooth/l2cap_core.c
+++ y/net/bluetooth/l2cap_core.c
@@ -1931,13 +1931,11 @@ static void l2cap_conn_del(struct hci_co

mutex_unlock(&conn->chan_lock);

+ cancel_delayed_work_sync(&conn->info_timer);
hci_chan_del(conn->hchan);

- if (conn->info_state & L2CAP_INFO_FEAT_MASK_REQ_SENT)
- cancel_delayed_work_sync(&conn->info_timer);
-
- hcon->l2cap_data = NULL;
conn->hchan = NULL;
+ hcon->l2cap_data = NULL;
l2cap_conn_put(conn);
}

--

syzbot

unread,
Aug 22, 2023, 8:15:36 AM8/22/23
to hda...@sina.com, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
KASAN: slab-use-after-free Read in hci_send_acl

==================================================================
BUG: KASAN: slab-use-after-free in hci_send_acl+0xdf4/0xf30 net/bluetooth/hci_core.c:3228
Read of size 8 at addr ffff888069713618 by task kworker/0:4/5435

CPU: 0 PID: 5435 Comm: kworker/0:4 Not tainted 6.5.0-rc6-next-20230818-syzkaller-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023
Workqueue: events l2cap_info_timeout
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:364 [inline]
print_report+0xc4/0x620 mm/kasan/report.c:475
kasan_report+0xda/0x110 mm/kasan/report.c:588
hci_send_acl+0xdf4/0xf30 net/bluetooth/hci_core.c:3228
l2cap_send_cmd+0x6dd/0x920 net/bluetooth/l2cap_core.c:977
l2cap_send_conn_req+0x1e5/0x260 net/bluetooth/l2cap_core.c:1286
l2cap_start_connection+0x11e/0x420 net/bluetooth/l2cap_core.c:1514
l2cap_conn_start+0x7ae/0xa40 net/bluetooth/l2cap_core.c:1661
process_one_work+0x887/0x15d0 kernel/workqueue.c:2630
process_scheduled_works kernel/workqueue.c:2703 [inline]
worker_thread+0x8bb/0x1290 kernel/workqueue.c:2784
kthread+0x33a/0x430 kernel/kthread.c:388
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304
</TASK>

Allocated by task 5466:
kasan_save_stack+0x33/0x50 mm/kasan/common.c:45
kasan_set_track+0x25/0x30 mm/kasan/common.c:52
____kasan_kmalloc mm/kasan/common.c:374 [inline]
__kasan_kmalloc+0xa2/0xb0 mm/kasan/common.c:383
kmalloc include/linux/slab.h:600 [inline]
kzalloc include/linux/slab.h:721 [inline]
hci_chan_create+0xa6/0x3a0 net/bluetooth/hci_conn.c:2691
l2cap_conn_add.part.0+0x1a/0xdf0 net/bluetooth/l2cap_core.c:7839
l2cap_conn_add include/net/bluetooth/l2cap.h:866 [inline]
l2cap_chan_connect+0x15b9/0x2140 net/bluetooth/l2cap_core.c:8051
bt_6lowpan_connect net/bluetooth/6lowpan.c:894 [inline]
lowpan_control_write+0x3d6/0x730 net/bluetooth/6lowpan.c:1129
full_proxy_write+0x124/0x190 fs/debugfs/file.c:236
vfs_write+0x2a4/0xe40 fs/read_write.c:582
ksys_write+0x12f/0x250 fs/read_write.c:637
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd

Freed by task 5045:
kasan_save_stack+0x33/0x50 mm/kasan/common.c:45
kasan_set_track+0x25/0x30 mm/kasan/common.c:52
kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:522
____kasan_slab_free mm/kasan/common.c:236 [inline]
____kasan_slab_free+0x15b/0x1b0 mm/kasan/common.c:200
kasan_slab_free include/linux/kasan.h:164 [inline]
slab_free_hook mm/slub.c:1800 [inline]
slab_free_freelist_hook+0x114/0x1e0 mm/slub.c:1826
slab_free mm/slub.c:3809 [inline]
__kmem_cache_free+0xb8/0x2f0 mm/slub.c:3822
hci_chan_list_flush+0x81/0xf0 net/bluetooth/hci_conn.c:2731
hci_conn_cleanup net/bluetooth/hci_conn.c:152 [inline]
hci_conn_del+0x1fc/0xd10 net/bluetooth/hci_conn.c:1140
hci_abort_conn_sync+0xacb/0xe20 net/bluetooth/hci_sync.c:5432
abort_conn_sync+0x18e/0x3a0 net/bluetooth/hci_conn.c:2878
hci_cmd_sync_work+0x1a4/0x3c0 net/bluetooth/hci_sync.c:306
process_one_work+0x887/0x15d0 kernel/workqueue.c:2630
process_scheduled_works kernel/workqueue.c:2703 [inline]
worker_thread+0x8bb/0x1290 kernel/workqueue.c:2784
kthread+0x33a/0x430 kernel/kthread.c:388
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304

The buggy address belongs to the object at ffff888069713600
which belongs to the cache kmalloc-128 of size 128
The buggy address is located 24 bytes inside of
freed 128-byte region [ffff888069713600, ffff888069713680)

The buggy address belongs to the physical page:
page:ffffea0001a5c4c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x69713
flags: 0xfff00000000800(slab|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000800 ffff888012c418c0 dead000000000122 0000000000000000
raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY), pid 5400, tgid 5400 (syz-executor.0), ts 92397723620, free_ts 92397302327
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x2cf/0x340 mm/page_alloc.c:1536
prep_new_page mm/page_alloc.c:1543 [inline]
get_page_from_freelist+0x10d7/0x31b0 mm/page_alloc.c:3219
__alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4475
__alloc_pages_node include/linux/gfp.h:237 [inline]
alloc_slab_page mm/slub.c:1872 [inline]
allocate_slab+0xa1/0x380 mm/slub.c:2017
new_slab mm/slub.c:2070 [inline]
___slab_alloc+0x8be/0x1570 mm/slub.c:3223
__slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3322
__slab_alloc_node mm/slub.c:3375 [inline]
slab_alloc_node mm/slub.c:3468 [inline]
__kmem_cache_alloc_node+0x137/0x350 mm/slub.c:3517
__do_kmalloc_node mm/slab_common.c:1003 [inline]
__kmalloc_node+0x52/0x110 mm/slab_common.c:1011
kmalloc_array_node include/linux/slab.h:698 [inline]
kcalloc_node include/linux/slab.h:703 [inline]
memcg_alloc_slab_cgroups+0xa9/0x170 mm/memcontrol.c:2895
memcg_slab_post_alloc_hook+0xaa/0x390 mm/slab.h:530
slab_post_alloc_hook mm/slab.h:770 [inline]
slab_alloc_node mm/slub.c:3478 [inline]
slab_alloc mm/slub.c:3486 [inline]
__kmem_cache_alloc_lru mm/slub.c:3493 [inline]
kmem_cache_alloc+0x1a7/0x3b0 mm/slub.c:3502
prepare_creds+0x43/0x7b0 kernel/cred.c:263
copy_creds+0xa7/0xe50 kernel/cred.c:368
copy_process+0xeb6/0x7400 kernel/fork.c:2368
kernel_clone+0xfd/0x930 kernel/fork.c:2916
__do_sys_clone+0xba/0x100 kernel/fork.c:3059
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1136 [inline]
free_unref_page_prepare+0x476/0xa40 mm/page_alloc.c:2348
free_unref_page+0x33/0x3b0 mm/page_alloc.c:2441
vfree+0x181/0x7a0 mm/vmalloc.c:2842
__do_replace+0x7bf/0x9c0 net/ipv4/netfilter/arp_tables.c:937
do_replace net/ipv6/netfilter/ip6_tables.c:1154 [inline]
do_ip6t_set_ctl+0x93a/0xbd0 net/ipv6/netfilter/ip6_tables.c:1636
nf_setsockopt+0x87/0xe0 net/netfilter/nf_sockopt.c:101
ipv6_setsockopt+0x12b/0x190 net/ipv6/ipv6_sockglue.c:1017
tcp_setsockopt+0x9d/0x100 net/ipv4/tcp.c:3677
__sys_setsockopt+0x2cd/0x5b0 net/socket.c:2307
__do_sys_setsockopt net/socket.c:2318 [inline]
__se_sys_setsockopt net/socket.c:2315 [inline]
__x64_sys_setsockopt+0xbd/0x150 net/socket.c:2315
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd

Memory state around the buggy address:
ffff888069713500: 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc
ffff888069713580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888069713600: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888069713680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888069713700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================


Tested on:

commit: 7271b2a5 Add linux-next specific files for 20230818
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
console output: https://syzkaller.appspot.com/x/log.txt?x=1555b1bba80000
kernel config: https://syzkaller.appspot.com/x/.config?x=1936af09cdef7dd6
dashboard link: https://syzkaller.appspot.com/bug?extid=a0c80b06ae2cb8895bc4
compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
patch: https://syzkaller.appspot.com/x/patch.diff?x=1766e9bba80000

Hillf Danton

unread,
Aug 23, 2023, 10:08:48 AM8/23/23
to syzbot, linux-...@vger.kernel.org, syzkall...@googlegroups.com
On Mon, 21 Aug 2023 09:26:48 -0700
> HEAD commit: 7271b2a53042 Add linux-next specific files for 20230818
> git tree: linux-next
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=147569efa80000

Delete hci channel after canceling worker.

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 7271b2a53042

--- x/net/bluetooth/l2cap_core.c
+++ y/net/bluetooth/l2cap_core.c
@@ -1890,6 +1890,7 @@ static void l2cap_conn_del(struct hci_co
{
struct l2cap_conn *conn = hcon->l2cap_data;
struct l2cap_chan *chan, *l;
+ LIST_HEAD(head);

if (!conn)
return;
@@ -1931,13 +1932,12 @@ static void l2cap_conn_del(struct hci_co

mutex_unlock(&conn->chan_lock);

+ cancel_delayed_work_sync(&conn->info_timer);
+ list_add(&conn->hchan->list, &head);
hci_chan_del(conn->hchan);

- if (conn->info_state & L2CAP_INFO_FEAT_MASK_REQ_SENT)
- cancel_delayed_work_sync(&conn->info_timer);
-
- hcon->l2cap_data = NULL;
conn->hchan = NULL;
+ hcon->l2cap_data = NULL;
l2cap_conn_put(conn);
}

@@ -7893,6 +7893,7 @@ static struct l2cap_conn *l2cap_conn_add
INIT_DELAYED_WORK(&conn->id_addr_timer, l2cap_conn_update_id_addr);

conn->disc_reason = HCI_ERROR_REMOTE_USER_TERM;
+ list_del(&hchan->list);

return conn;
}
--

syzbot

unread,
Aug 23, 2023, 10:32:25 AM8/23/23
to hda...@sina.com, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
KASAN: slab-out-of-bounds Read in l2cap_chan_del

==================================================================
BUG: KASAN: slab-out-of-bounds in hci_conn_drop include/net/bluetooth/hci_core.h:1549 [inline]
BUG: KASAN: slab-out-of-bounds in hci_conn_drop include/net/bluetooth/hci_core.h:1519 [inline]
BUG: KASAN: slab-out-of-bounds in l2cap_chan_del+0xa0b/0xa70 net/bluetooth/l2cap_core.c:668
Read of size 8 at addr ffff888068778718 by task kworker/0:0/8

CPU: 0 PID: 8 Comm: kworker/0:0 Not tainted 6.5.0-rc6-next-20230818-syzkaller-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023
Workqueue: events l2cap_chan_timeout
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:364 [inline]
print_report+0xc4/0x620 mm/kasan/report.c:475
kasan_report+0xda/0x110 mm/kasan/report.c:588
hci_conn_drop include/net/bluetooth/hci_core.h:1549 [inline]
hci_conn_drop include/net/bluetooth/hci_core.h:1519 [inline]
l2cap_chan_del+0xa0b/0xa70 net/bluetooth/l2cap_core.c:668
l2cap_chan_close+0xff/0xa20 net/bluetooth/l2cap_core.c:851
l2cap_chan_timeout+0x17d/0x2f0 net/bluetooth/l2cap_core.c:452
process_one_work+0x887/0x15d0 kernel/workqueue.c:2630
process_scheduled_works kernel/workqueue.c:2703 [inline]
worker_thread+0x8bb/0x1290 kernel/workqueue.c:2784
kthread+0x33a/0x430 kernel/kthread.c:388
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304
</TASK>

Allocated by task 4708:
kasan_save_stack+0x33/0x50 mm/kasan/common.c:45
kasan_set_track+0x25/0x30 mm/kasan/common.c:52
____kasan_kmalloc mm/kasan/common.c:374 [inline]
__kasan_kmalloc+0xa2/0xb0 mm/kasan/common.c:383
kasan_kmalloc include/linux/kasan.h:198 [inline]
__do_kmalloc_node mm/slab_common.c:1004 [inline]
__kmalloc_node_track_caller+0x61/0x100 mm/slab_common.c:1024
kmalloc_reserve+0xef/0x270 net/core/skbuff.c:575
__alloc_skb+0x12b/0x330 net/core/skbuff.c:644
alloc_skb include/linux/skbuff.h:1286 [inline]
alloc_skb_with_frags+0xe4/0x710 net/core/skbuff.c:6274
sock_alloc_send_pskb+0x7c8/0x950 net/core/sock.c:2794
unix_dgram_sendmsg+0x455/0x1c30 net/unix/af_unix.c:1953
sock_sendmsg_nosec net/socket.c:730 [inline]
sock_sendmsg+0xd9/0x180 net/socket.c:753
sock_write_iter+0x29b/0x3d0 net/socket.c:1140
call_write_iter include/linux/fs.h:1983 [inline]
do_iter_readv_writev+0x21e/0x3c0 fs/read_write.c:735
do_iter_write+0x17f/0x830 fs/read_write.c:860
vfs_writev+0x221/0x700 fs/read_write.c:933
do_writev+0x285/0x370 fs/read_write.c:976
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd

Freed by task 4707:
kasan_save_stack+0x33/0x50 mm/kasan/common.c:45
kasan_set_track+0x25/0x30 mm/kasan/common.c:52
kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:522
____kasan_slab_free mm/kasan/common.c:236 [inline]
____kasan_slab_free+0x15b/0x1b0 mm/kasan/common.c:200
kasan_slab_free include/linux/kasan.h:164 [inline]
slab_free_hook mm/slub.c:1800 [inline]
slab_free_freelist_hook+0x114/0x1e0 mm/slub.c:1826
slab_free mm/slub.c:3809 [inline]
__kmem_cache_free+0xb8/0x2f0 mm/slub.c:3822
skb_kfree_head net/core/skbuff.c:939 [inline]
skb_free_head+0x110/0x1b0 net/core/skbuff.c:951
skb_release_data+0x5ba/0x870 net/core/skbuff.c:981
skb_release_all net/core/skbuff.c:1047 [inline]
__kfree_skb net/core/skbuff.c:1061 [inline]
consume_skb net/core/skbuff.c:1277 [inline]
consume_skb+0xd2/0x170 net/core/skbuff.c:1271
__unix_dgram_recvmsg+0x814/0xe50 net/unix/af_unix.c:2442
unix_dgram_recvmsg+0xc3/0xf0 net/unix/af_unix.c:2459
sock_recvmsg_nosec net/socket.c:1026 [inline]
sock_recvmsg+0xe2/0x170 net/socket.c:1048
sock_read_iter+0x2c3/0x3c0 net/socket.c:1118
call_read_iter include/linux/fs.h:1977 [inline]
do_iter_readv_writev+0x2f2/0x3c0 fs/read_write.c:733
do_iter_read+0x315/0x870 fs/read_write.c:795
vfs_readv+0x12d/0x1a0 fs/read_write.c:915
do_readv+0x285/0x370 fs/read_write.c:952
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd

The buggy address belongs to the object at ffff888068778400
which belongs to the cache kmalloc-cg-512 of size 512
The buggy address is located 280 bytes to the right of
allocated 512-byte region [ffff888068778400, ffff888068778600)

The buggy address belongs to the physical page:
page:ffffea0001a1de00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x68778
head:ffffea0001a1de00 order:2 entire_mapcount:0 nr_pages_mapped:0 pincount:0
memcg:ffff88801937bc01
flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000840 ffff888012c4f140 dead000000000122 0000000000000000
raw: 0000000000000000 0000000000100010 00000001ffffffff ffff88801937bc01
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 2, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 4708, tgid 4708 (dhcpcd), ts 448399025420, free_ts 448388778101
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x2cf/0x340 mm/page_alloc.c:1536
prep_new_page mm/page_alloc.c:1543 [inline]
get_page_from_freelist+0x10d7/0x31b0 mm/page_alloc.c:3219
__alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4475
alloc_pages+0x1a9/0x270 mm/mempolicy.c:2298
alloc_slab_page mm/slub.c:1870 [inline]
allocate_slab+0x251/0x380 mm/slub.c:2017
new_slab mm/slub.c:2070 [inline]
___slab_alloc+0x8be/0x1570 mm/slub.c:3223
__slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3322
__slab_alloc_node mm/slub.c:3375 [inline]
slab_alloc_node mm/slub.c:3468 [inline]
__kmem_cache_alloc_node+0x137/0x350 mm/slub.c:3517
__do_kmalloc_node mm/slab_common.c:1003 [inline]
__kmalloc_node_track_caller+0x50/0x100 mm/slab_common.c:1024
kmalloc_reserve+0xef/0x270 net/core/skbuff.c:575
__alloc_skb+0x12b/0x330 net/core/skbuff.c:644
alloc_skb include/linux/skbuff.h:1286 [inline]
alloc_skb_with_frags+0xe4/0x710 net/core/skbuff.c:6274
sock_alloc_send_pskb+0x7c8/0x950 net/core/sock.c:2794
unix_dgram_sendmsg+0x455/0x1c30 net/unix/af_unix.c:1953
sock_sendmsg_nosec net/socket.c:730 [inline]
sock_sendmsg+0xd9/0x180 net/socket.c:753
sock_write_iter+0x29b/0x3d0 net/socket.c:1140
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1136 [inline]
free_unref_page_prepare+0x476/0xa40 mm/page_alloc.c:2348
free_unref_page+0x33/0x3b0 mm/page_alloc.c:2441
skb_kfree_head net/core/skbuff.c:939 [inline]
skb_free_head+0x110/0x1b0 net/core/skbuff.c:951
skb_release_data+0x5ba/0x870 net/core/skbuff.c:981
skb_release_all net/core/skbuff.c:1047 [inline]
__kfree_skb net/core/skbuff.c:1061 [inline]
consume_skb net/core/skbuff.c:1277 [inline]
consume_skb+0xd2/0x170 net/core/skbuff.c:1271
__unix_dgram_recvmsg+0x814/0xe50 net/unix/af_unix.c:2442
unix_dgram_recvmsg+0xc3/0xf0 net/unix/af_unix.c:2459
sock_recvmsg_nosec net/socket.c:1026 [inline]
sock_recvmsg+0xe2/0x170 net/socket.c:1048
sock_read_iter+0x2c3/0x3c0 net/socket.c:1118
call_read_iter include/linux/fs.h:1977 [inline]
do_iter_readv_writev+0x2f2/0x3c0 fs/read_write.c:733
do_iter_read+0x315/0x870 fs/read_write.c:795
vfs_readv+0x12d/0x1a0 fs/read_write.c:915
do_readv+0x285/0x370 fs/read_write.c:952
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd

Memory state around the buggy address:
ffff888068778600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888068778680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888068778700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff888068778780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888068778800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================


Tested on:

commit: 7271b2a5 Add linux-next specific files for 20230818
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
console output: https://syzkaller.appspot.com/x/log.txt?x=142e2cbda80000
kernel config: https://syzkaller.appspot.com/x/.config?x=1936af09cdef7dd6
dashboard link: https://syzkaller.appspot.com/bug?extid=a0c80b06ae2cb8895bc4
compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
patch: https://syzkaller.appspot.com/x/patch.diff?x=12838e5ba80000

Hillf Danton

unread,
Aug 24, 2023, 6:58:50 PM8/24/23
to syzbot, linux-...@vger.kernel.org, syzkall...@googlegroups.com
On Mon, 21 Aug 2023 09:26:48 -0700
> HEAD commit: 7271b2a53042 Add linux-next specific files for 20230818
> git tree: linux-next
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=147569efa80000

Delete hci channel after canceling worker.

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 7271b2a53042

--- x/net/bluetooth/l2cap_core.c
+++ y/net/bluetooth/l2cap_core.c
@@ -624,10 +624,7 @@ void __l2cap_chan_add(struct l2cap_conn

l2cap_chan_hold(chan);

- /* Only keep a reference for fixed channels if they requested it */
- if (chan->chan_type != L2CAP_CHAN_FIXED ||
- test_bit(FLAG_HOLD_HCI_CONN, &chan->flags))
- hci_conn_hold(conn->hcon);
+ hci_conn_hold(conn->hcon);

list_add(&chan->list, &conn->chan_l);
}
@@ -659,13 +656,7 @@ void l2cap_chan_del(struct l2cap_chan *c

chan->conn = NULL;

- /* Reference was only held for non-fixed channels or
- * fixed channels that explicitly requested it using the
- * FLAG_HOLD_HCI_CONN flag.
- */
- if (chan->chan_type != L2CAP_CHAN_FIXED ||
- test_bit(FLAG_HOLD_HCI_CONN, &chan->flags))
- hci_conn_drop(conn->hcon);
+ hci_conn_drop(conn->hcon);

if (mgr && mgr->bredr_chan == chan)
mgr->bredr_chan = NULL;
@@ -1890,6 +1881,7 @@ static void l2cap_conn_del(struct hci_co
{
struct l2cap_conn *conn = hcon->l2cap_data;
struct l2cap_chan *chan, *l;
+ LIST_HEAD(head);

if (!conn)
return;
@@ -1931,13 +1923,12 @@ static void l2cap_conn_del(struct hci_co

mutex_unlock(&conn->chan_lock);

+ cancel_delayed_work_sync(&conn->info_timer);
+ list_add(&conn->hchan->list, &head);
hci_chan_del(conn->hchan);

- if (conn->info_state & L2CAP_INFO_FEAT_MASK_REQ_SENT)
- cancel_delayed_work_sync(&conn->info_timer);
-
- hcon->l2cap_data = NULL;
conn->hchan = NULL;
+ hcon->l2cap_data = NULL;
l2cap_conn_put(conn);
}

@@ -7893,6 +7884,7 @@ static struct l2cap_conn *l2cap_conn_add

syzbot

unread,
Aug 24, 2023, 9:08:36 PM8/24/23
to hda...@sina.com, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
WARNING in l2cap_chan_del

------------[ cut here ]------------
WARNING: CPU: 0 PID: 780 at kernel/workqueue.c:1725 __queue_work+0xb52/0x1060 kernel/workqueue.c:1724
Modules linked in:
CPU: 0 PID: 780 Comm: kworker/0:2 Not tainted 6.5.0-rc6-next-20230818-syzkaller-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023
Workqueue: events l2cap_chan_timeout
RIP: 0010:__queue_work+0xb52/0x1060 kernel/workqueue.c:1724
Code: 03 38 d0 7c 09 84 d2 74 05 e8 ea 54 87 00 8b 5b 2c 31 ff 83 e3 20 89 de e8 5b cf 31 00 85 db 0f 85 7f 01 00 00 e8 de d3 31 00 <0f> 0b e9 ca fa ff ff e8 d2 d3 31 00 0f 0b e9 76 fa ff ff e8 c6 d3
RSP: 0018:ffffc900046d7ac8 EFLAGS: 00010093
RAX: 0000000000000000 RBX: ffff888013650000 RCX: 0000000000000000
RDX: ffff88801d4d1dc0 RSI: ffffffff8155ff92 RDI: ffff888013650008
RBP: 0000000000000000 R08: 0000000000000005 R09: 0000000000000000
R10: 0000000000200000 R11: 0000000000000000 R12: ffff88806a634270
R13: ffffffff81dd2d93 R14: ffff88806a6342b8 R15: ffffffff81dd2d93
FS: 0000000000000000(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f98dec6b6c0 CR3: 000000000c976000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
__queue_delayed_work+0x1bf/0x260 kernel/workqueue.c:1950
queue_delayed_work_on+0x106/0x130 kernel/workqueue.c:1986
queue_delayed_work include/linux/workqueue.h:569 [inline]
hci_conn_drop include/net/bluetooth/hci_core.h:1549 [inline]
hci_conn_drop include/net/bluetooth/hci_core.h:1519 [inline]
l2cap_chan_del+0x389/0x9b0 net/bluetooth/l2cap_core.c:659
l2cap_chan_close+0xff/0xa20 net/bluetooth/l2cap_core.c:842
l2cap_chan_timeout+0x17d/0x2f0 net/bluetooth/l2cap_core.c:452
process_one_work+0x887/0x15d0 kernel/workqueue.c:2630
process_scheduled_works kernel/workqueue.c:2703 [inline]
worker_thread+0x8bb/0x1290 kernel/workqueue.c:2784
kthread+0x33a/0x430 kernel/kthread.c:388
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304
</TASK>


Tested on:

commit: 7271b2a5 Add linux-next specific files for 20230818
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
console output: https://syzkaller.appspot.com/x/log.txt?x=1333e4dfa80000
kernel config: https://syzkaller.appspot.com/x/.config?x=1936af09cdef7dd6
dashboard link: https://syzkaller.appspot.com/bug?extid=a0c80b06ae2cb8895bc4
compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
patch: https://syzkaller.appspot.com/x/patch.diff?x=1361735ba80000

Hillf Danton

unread,
Aug 25, 2023, 7:19:45 AM8/25/23
to syzbot, linux-...@vger.kernel.org, syzkall...@googlegroups.com
On Mon, 21 Aug 2023 09:26:48 -0700
> HEAD commit: 7271b2a53042 Add linux-next specific files for 20230818
> git tree: linux-next
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=147569efa80000

Delete hci channel after canceling worker.

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 7271b2a53042

--- x/net/bluetooth/l2cap_core.c
+++ y/net/bluetooth/l2cap_core.c
@@ -624,10 +624,7 @@ void __l2cap_chan_add(struct l2cap_conn

l2cap_chan_hold(chan);

- /* Only keep a reference for fixed channels if they requested it */
- if (chan->chan_type != L2CAP_CHAN_FIXED ||
- test_bit(FLAG_HOLD_HCI_CONN, &chan->flags))
- hci_conn_hold(conn->hcon);
+ hci_conn_hold(conn->hcon);

list_add(&chan->list, &conn->chan_l);
}
@@ -659,13 +656,9 @@ void l2cap_chan_del(struct l2cap_chan *c

chan->conn = NULL;

- /* Reference was only held for non-fixed channels or
- * fixed channels that explicitly requested it using the
- * FLAG_HOLD_HCI_CONN flag.
- */
- if (chan->chan_type != L2CAP_CHAN_FIXED ||
- test_bit(FLAG_HOLD_HCI_CONN, &chan->flags))
- hci_conn_drop(conn->hcon);
+ mutex_lock(&conn->hcon->hdev->req_lock);
+ hci_conn_drop(conn->hcon);
+ mutex_unlock(&conn->hcon->hdev->req_lock);

if (mgr && mgr->bredr_chan == chan)
mgr->bredr_chan = NULL;
@@ -1890,6 +1883,7 @@ static void l2cap_conn_del(struct hci_co
{
struct l2cap_conn *conn = hcon->l2cap_data;
struct l2cap_chan *chan, *l;
+ LIST_HEAD(head);

if (!conn)
return;
@@ -1931,13 +1925,12 @@ static void l2cap_conn_del(struct hci_co

mutex_unlock(&conn->chan_lock);

+ cancel_delayed_work_sync(&conn->info_timer);
+ list_add(&conn->hchan->list, &head);
hci_chan_del(conn->hchan);

- if (conn->info_state & L2CAP_INFO_FEAT_MASK_REQ_SENT)
- cancel_delayed_work_sync(&conn->info_timer);
-
- hcon->l2cap_data = NULL;
conn->hchan = NULL;
+ hcon->l2cap_data = NULL;
l2cap_conn_put(conn);
}

@@ -7893,6 +7886,7 @@ static struct l2cap_conn *l2cap_conn_add

syzbot

unread,
Aug 25, 2023, 8:56:39 AM8/25/23
to hda...@sina.com, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
INFO: task hung in l2cap_chan_timeout

INFO: task kworker/0:0:8 blocked for more than 143 seconds.
Not tainted 6.5.0-rc6-next-20230818-syzkaller-dirty #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/0:0 state:D stack:26488 pid:8 ppid:2 flags:0x00004000
Workqueue: events l2cap_chan_timeout
Call Trace:
<TASK>
context_switch kernel/sched/core.c:5382 [inline]
__schedule+0xee1/0x59f0 kernel/sched/core.c:6695
schedule+0xe7/0x1b0 kernel/sched/core.c:6771
schedule_preempt_disabled+0x13/0x20 kernel/sched/core.c:6830
__mutex_lock_common kernel/locking/mutex.c:679 [inline]
__mutex_lock+0x967/0x1340 kernel/locking/mutex.c:747
l2cap_chan_timeout+0x68/0x2f0 net/bluetooth/l2cap_core.c:438
process_one_work+0x887/0x15d0 kernel/workqueue.c:2630
process_scheduled_works kernel/workqueue.c:2703 [inline]
worker_thread+0x8bb/0x1290 kernel/workqueue.c:2784
kthread+0x33a/0x430 kernel/kthread.c:388
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304
</TASK>
INFO: task kworker/0:1:9 blocked for more than 143 seconds.
Not tainted 6.5.0-rc6-next-20230818-syzkaller-dirty #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/0:1 state:D stack:28784 pid:9 ppid:2 flags:0x00004000
Workqueue: events l2cap_chan_timeout
Call Trace:
<TASK>
context_switch kernel/sched/core.c:5382 [inline]
__schedule+0xee1/0x59f0 kernel/sched/core.c:6695
schedule+0xe7/0x1b0 kernel/sched/core.c:6771
schedule_preempt_disabled+0x13/0x20 kernel/sched/core.c:6830
__mutex_lock_common kernel/locking/mutex.c:679 [inline]
__mutex_lock+0x967/0x1340 kernel/locking/mutex.c:747
l2cap_chan_timeout+0x68/0x2f0 net/bluetooth/l2cap_core.c:438
process_one_work+0x887/0x15d0 kernel/workqueue.c:2630
process_scheduled_works kernel/workqueue.c:2703 [inline]
worker_thread+0x8bb/0x1290 kernel/workqueue.c:2784
kthread+0x33a/0x430 kernel/kthread.c:388
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304
</TASK>
INFO: task kworker/1:0:23 blocked for more than 143 seconds.
Not tainted 6.5.0-rc6-next-20230818-syzkaller-dirty #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/1:0 state:D stack:25448 pid:23 ppid:2 flags:0x00004000
Workqueue: events l2cap_chan_timeout
Call Trace:
<TASK>
context_switch kernel/sched/core.c:5382 [inline]
__schedule+0xee1/0x59f0 kernel/sched/core.c:6695
schedule+0xe7/0x1b0 kernel/sched/core.c:6771
schedule_preempt_disabled+0x13/0x20 kernel/sched/core.c:6830
__mutex_lock_common kernel/locking/mutex.c:679 [inline]
__mutex_lock+0x967/0x1340 kernel/locking/mutex.c:747
l2cap_chan_timeout+0x68/0x2f0 net/bluetooth/l2cap_core.c:438
process_one_work+0x887/0x15d0 kernel/workqueue.c:2630
process_scheduled_works kernel/workqueue.c:2703 [inline]
worker_thread+0x8bb/0x1290 kernel/workqueue.c:2784
kthread+0x33a/0x430 kernel/kthread.c:388
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304
</TASK>
INFO: task kworker/1:1:27 blocked for more than 143 seconds.
Not tainted 6.5.0-rc6-next-20230818-syzkaller-dirty #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/1:1 state:D stack:25880 pid:27 ppid:2 flags:0x00004000
Workqueue: events l2cap_chan_timeout
Call Trace:
<TASK>
context_switch kernel/sched/core.c:5382 [inline]
__schedule+0xee1/0x59f0 kernel/sched/core.c:6695
schedule+0xe7/0x1b0 kernel/sched/core.c:6771
schedule_preempt_disabled+0x13/0x20 kernel/sched/core.c:6830
__mutex_lock_common kernel/locking/mutex.c:679 [inline]
__mutex_lock+0x967/0x1340 kernel/locking/mutex.c:747
l2cap_chan_timeout+0x68/0x2f0 net/bluetooth/l2cap_core.c:438
process_one_work+0x887/0x15d0 kernel/workqueue.c:2630
process_scheduled_works kernel/workqueue.c:2703 [inline]
worker_thread+0x8bb/0x1290 kernel/workqueue.c:2784
kthread+0x33a/0x430 kernel/kthread.c:388
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304
</TASK>
INFO: task kworker/u5:0:50 blocked for more than 144 seconds.
Not tainted 6.5.0-rc6-next-20230818-syzkaller-dirty #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/u5:0 state:D stack:27704 pid:50 ppid:2 flags:0x00004000
Workqueue: hci0 hci_cmd_sync_work
Call Trace:
<TASK>
context_switch kernel/sched/core.c:5382 [inline]
__schedule+0xee1/0x59f0 kernel/sched/core.c:6695
schedule+0xe7/0x1b0 kernel/sched/core.c:6771
schedule_preempt_disabled+0x13/0x20 kernel/sched/core.c:6830
__mutex_lock_common kernel/locking/mutex.c:679 [inline]
__mutex_lock+0x967/0x1340 kernel/locking/mutex.c:747
l2cap_chan_del+0x2b3/0xaa0 net/bluetooth/l2cap_core.c:659
l2cap_conn_del+0x3ce/0x870 net/bluetooth/l2cap_core.c:1918
l2cap_connect_cfm+0xa10/0xf90 net/bluetooth/l2cap_core.c:8232
hci_connect_cfm include/net/bluetooth/hci_core.h:1933 [inline]
hci_conn_failed+0x196/0x320 net/bluetooth/hci_conn.c:1235
hci_abort_conn_sync+0xacb/0xe20 net/bluetooth/hci_sync.c:5432
abort_conn_sync+0x18e/0x3a0 net/bluetooth/hci_conn.c:2878
hci_cmd_sync_work+0x1a4/0x3c0 net/bluetooth/hci_sync.c:306
process_one_work+0x887/0x15d0 kernel/workqueue.c:2630
process_scheduled_works kernel/workqueue.c:2703 [inline]
worker_thread+0x8bb/0x1290 kernel/workqueue.c:2784
kthread+0x33a/0x430 kernel/kthread.c:388
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304
</TASK>
INFO: task kworker/0:2:54 blocked for more than 144 seconds.
Not tainted 6.5.0-rc6-next-20230818-syzkaller-dirty #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/0:2 state:D stack:25568 pid:54 ppid:2 flags:0x00004000
Workqueue: events l2cap_chan_timeout
Call Trace:
<TASK>
context_switch kernel/sched/core.c:5382 [inline]
__schedule+0xee1/0x59f0 kernel/sched/core.c:6695
schedule+0xe7/0x1b0 kernel/sched/core.c:6771
schedule_preempt_disabled+0x13/0x20 kernel/sched/core.c:6830
__mutex_lock_common kernel/locking/mutex.c:679 [inline]
__mutex_lock+0x967/0x1340 kernel/locking/mutex.c:747
l2cap_chan_del+0x2b3/0xaa0 net/bluetooth/l2cap_core.c:659
l2cap_chan_close+0xff/0xa20 net/bluetooth/l2cap_core.c:844
l2cap_chan_timeout+0x17d/0x2f0 net/bluetooth/l2cap_core.c:452
process_one_work+0x887/0x15d0 kernel/workqueue.c:2630
process_scheduled_works kernel/workqueue.c:2703 [inline]
worker_thread+0x8bb/0x1290 kernel/workqueue.c:2784
kthread+0x33a/0x430 kernel/kthread.c:388
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304
</TASK>
INFO: task kworker/1:2:780 blocked for more than 144 seconds.
Not tainted 6.5.0-rc6-next-20230818-syzkaller-dirty #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/1:2 state:D stack:26504 pid:780 ppid:2 flags:0x00004000
Workqueue: events l2cap_chan_timeout
Call Trace:
<TASK>
context_switch kernel/sched/core.c:5382 [inline]
__schedule+0xee1/0x59f0 kernel/sched/core.c:6695
schedule+0xe7/0x1b0 kernel/sched/core.c:6771
schedule_preempt_disabled+0x13/0x20 kernel/sched/core.c:6830
__mutex_lock_common kernel/locking/mutex.c:679 [inline]
__mutex_lock+0x967/0x1340 kernel/locking/mutex.c:747
l2cap_chan_timeout+0x68/0x2f0 net/bluetooth/l2cap_core.c:438
process_one_work+0x887/0x15d0 kernel/workqueue.c:2630
process_scheduled_works kernel/workqueue.c:2703 [inline]
worker_thread+0x8bb/0x1290 kernel/workqueue.c:2784
kthread+0x33a/0x430 kernel/kthread.c:388
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304
</TASK>
INFO: task kworker/1:3:4456 blocked for more than 144 seconds.
Not tainted 6.5.0-rc6-next-20230818-syzkaller-dirty #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/1:3 state:D stack:28128 pid:4456 ppid:2 flags:0x00004000
Workqueue: events l2cap_chan_timeout
Call Trace:
<TASK>
context_switch kernel/sched/core.c:5382 [inline]
__schedule+0xee1/0x59f0 kernel/sched/core.c:6695
schedule+0xe7/0x1b0 kernel/sched/core.c:6771
schedule_preempt_disabled+0x13/0x20 kernel/sched/core.c:6830
__mutex_lock_common kernel/locking/mutex.c:679 [inline]
__mutex_lock+0x967/0x1340 kernel/locking/mutex.c:747
l2cap_chan_timeout+0x68/0x2f0 net/bluetooth/l2cap_core.c:438
process_one_work+0x887/0x15d0 kernel/workqueue.c:2630
process_scheduled_works kernel/workqueue.c:2703 [inline]
worker_thread+0x8bb/0x1290 kernel/workqueue.c:2784
kthread+0x33a/0x430 kernel/kthread.c:388
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304
</TASK>
INFO: task kworker/1:4:5053 blocked for more than 145 seconds.
Not tainted 6.5.0-rc6-next-20230818-syzkaller-dirty #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/1:4 state:D stack:25112 pid:5053 ppid:2 flags:0x00004000
Workqueue: events l2cap_chan_timeout
Call Trace:
<TASK>
context_switch kernel/sched/core.c:5382 [inline]
__schedule+0xee1/0x59f0 kernel/sched/core.c:6695
schedule+0xe7/0x1b0 kernel/sched/core.c:6771
schedule_preempt_disabled+0x13/0x20 kernel/sched/core.c:6830
__mutex_lock_common kernel/locking/mutex.c:679 [inline]
__mutex_lock+0x967/0x1340 kernel/locking/mutex.c:747
l2cap_chan_timeout+0x68/0x2f0 net/bluetooth/l2cap_core.c:438
process_one_work+0x887/0x15d0 kernel/workqueue.c:2630
process_scheduled_works kernel/workqueue.c:2703 [inline]
worker_thread+0x8bb/0x1290 kernel/workqueue.c:2784
kthread+0x33a/0x430 kernel/kthread.c:388
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304
</TASK>
INFO: task kworker/0:4:5059 blocked for more than 145 seconds.
Not tainted 6.5.0-rc6-next-20230818-syzkaller-dirty #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/0:4 state:D stack:27920 pid:5059 ppid:2 flags:0x00004000
Workqueue: events l2cap_chan_timeout
Call Trace:
<TASK>
context_switch kernel/sched/core.c:5382 [inline]
__schedule+0xee1/0x59f0 kernel/sched/core.c:6695
schedule+0xe7/0x1b0 kernel/sched/core.c:6771
schedule_preempt_disabled+0x13/0x20 kernel/sched/core.c:6830
__mutex_lock_common kernel/locking/mutex.c:679 [inline]
__mutex_lock+0x967/0x1340 kernel/locking/mutex.c:747
l2cap_chan_timeout+0x68/0x2f0 net/bluetooth/l2cap_core.c:438
process_one_work+0x887/0x15d0 kernel/workqueue.c:2630
process_scheduled_works kernel/workqueue.c:2703 [inline]
worker_thread+0x8bb/0x1290 kernel/workqueue.c:2784
kthread+0x33a/0x430 kernel/kthread.c:388
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304
</TASK>
Future hung task reports are suppressed, see sysctl kernel.hung_task_warnings
INFO: lockdep is turned off.
NMI backtrace for cpu 0
CPU: 0 PID: 29 Comm: khungtaskd Not tainted 6.5.0-rc6-next-20230818-syzkaller-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106
nmi_cpu_backtrace+0x277/0x380 lib/nmi_backtrace.c:113
nmi_trigger_cpumask_backtrace+0x299/0x300 lib/nmi_backtrace.c:62
trigger_all_cpu_backtrace include/linux/nmi.h:160 [inline]
check_hung_uninterruptible_tasks kernel/hung_task.c:222 [inline]
watchdog+0xfac/0x1230 kernel/hung_task.c:379
kthread+0x33a/0x430 kernel/kthread.c:388
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304
</TASK>
Sending NMI from CPU 0 to CPUs 1:
NMI backtrace for cpu 1 skipped: idling at native_safe_halt arch/x86/include/asm/irqflags.h:48 [inline]
NMI backtrace for cpu 1 skipped: idling at arch_safe_halt arch/x86/include/asm/irqflags.h:86 [inline]
NMI backtrace for cpu 1 skipped: idling at acpi_safe_halt+0x1b/0x20 drivers/acpi/processor_idle.c:112


Tested on:

commit: 7271b2a5 Add linux-next specific files for 20230818
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
console output: https://syzkaller.appspot.com/x/log.txt?x=109b2797a80000
kernel config: https://syzkaller.appspot.com/x/.config?x=1936af09cdef7dd6
dashboard link: https://syzkaller.appspot.com/bug?extid=a0c80b06ae2cb8895bc4
compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
patch: https://syzkaller.appspot.com/x/patch.diff?x=146ec7cfa80000

Pauli Virtanen

unread,
Aug 25, 2023, 11:52:18 AM8/25/23
to syzbot, syzkall...@googlegroups.com
#syz test git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git f0835e7404b7f6fd825fc1ad7a174253a54234cf

diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 8b0c8e631324..f4800ea6f19b 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -2872,7 +2872,7 @@ static int abort_conn_sync(struct hci_dev *hdev, void *data)
u16 handle = PTR_UINT(data);

conn = hci_conn_hash_lookup_handle(hdev, handle);
- if (!conn)
+ if (!conn || WARN_ON(!conn->abort_reason))
return 0;

return hci_abort_conn_sync(hdev, conn, conn->abort_reason);
@@ -2887,6 +2887,8 @@ int hci_abort_conn(struct hci_conn *conn, u8 reason)
*/
if (conn->abort_reason)
return 0;
+ if (WARN_ON(!reason))
+ reason = HCI_ERROR_UNSPECIFIED;

syzbot

unread,
Aug 25, 2023, 12:37:28 PM8/25/23
to p...@iki.fi, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
WARNING in abort_conn_sync

Bluetooth: hci0: command 0x0409 tx timeout
------------[ cut here ]------------
WARNING: CPU: 0 PID: 4431 at net/bluetooth/hci_conn.c:2875 abort_conn_sync+0x387/0x3c0 net/bluetooth/hci_conn.c:2875
Modules linked in:
CPU: 0 PID: 4431 Comm: kworker/u5:1 Not tainted 6.5.0-rc5-syzkaller-01535-gf0835e7404b7-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023
Workqueue: hci0 hci_cmd_sync_work
RIP: 0010:abort_conn_sync+0x387/0x3c0 net/bluetooth/hci_conn.c:2875
Code: f8 48 c7 c2 40 59 97 8b be 0a 03 00 00 48 c7 c7 00 59 97 8b c6 05 b7 fa 60 05 01 e8 43 b4 30 f8 e9 9c fd ff ff e8 c9 87 50 f8 <0f> 0b 31 db e9 1b fe ff ff e8 bb 6c a5 f8 e9 52 fd ff ff 48 89 df
RSP: 0018:ffffc900068afc58 EFLAGS: 00010293
RAX: 0000000000000000 RBX: ffff88802a874000 RCX: 0000000000000000
RDX: ffff88802cf15940 RSI: ffffffff893568c7 RDI: 0000000000000001
RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: dffffc0000000000
R13: ffff88801878d220 R14: ffff88801878c000 R15: 0000000000000f00
FS: 0000000000000000(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f02c7df9378 CR3: 000000000c776000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
hci_cmd_sync_work+0x1a4/0x3c0 net/bluetooth/hci_sync.c:306
process_one_work+0xaa2/0x16f0 kernel/workqueue.c:2600
worker_thread+0x687/0x1110 kernel/workqueue.c:2751
kthread+0x33a/0x430 kernel/kthread.c:389
ret_from_fork+0x2c/0x70 arch/x86/kernel/process.c:145
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304
</TASK>


Tested on:

commit: f0835e74 Bluetooth: ISO: Use defer setup to separate P..
git tree: git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git
console output: https://syzkaller.appspot.com/x/log.txt?x=10affb97a80000
kernel config: https://syzkaller.appspot.com/x/.config?x=4b3a4035b595be0
dashboard link: https://syzkaller.appspot.com/bug?extid=a0c80b06ae2cb8895bc4
compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
patch: https://syzkaller.appspot.com/x/patch.diff?x=16eff740680000

Hillf Danton

unread,
Aug 25, 2023, 9:12:15 PM8/25/23
to syzbot, linux-...@vger.kernel.org, syzkall...@googlegroups.com
On Mon, 21 Aug 2023 09:26:48 -0700
> HEAD commit: 7271b2a53042 Add linux-next specific files for 20230818
> git tree: linux-next
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=147569efa80000

Delete hci channel after canceling worker.

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 7271b2a53042

--- x/net/bluetooth/l2cap_core.c
+++ y/net/bluetooth/l2cap_core.c
@@ -624,10 +624,7 @@ void __l2cap_chan_add(struct l2cap_conn

l2cap_chan_hold(chan);

- /* Only keep a reference for fixed channels if they requested it */
- if (chan->chan_type != L2CAP_CHAN_FIXED ||
- test_bit(FLAG_HOLD_HCI_CONN, &chan->flags))
- hci_conn_hold(conn->hcon);
+ hci_conn_hold(conn->hcon);

list_add(&chan->list, &conn->chan_l);
}
@@ -659,13 +656,7 @@ void l2cap_chan_del(struct l2cap_chan *c

chan->conn = NULL;

- /* Reference was only held for non-fixed channels or
- * fixed channels that explicitly requested it using the
- * FLAG_HOLD_HCI_CONN flag.
- */
- if (chan->chan_type != L2CAP_CHAN_FIXED ||
- test_bit(FLAG_HOLD_HCI_CONN, &chan->flags))
- hci_conn_drop(conn->hcon);
+ hci_conn_drop(conn->hcon);

if (mgr && mgr->bredr_chan == chan)
mgr->bredr_chan = NULL;
@@ -1890,6 +1881,7 @@ static void l2cap_conn_del(struct hci_co
{
struct l2cap_conn *conn = hcon->l2cap_data;
struct l2cap_chan *chan, *l;
+ LIST_HEAD(head);

if (!conn)
return;
@@ -1931,13 +1923,12 @@ static void l2cap_conn_del(struct hci_co

mutex_unlock(&conn->chan_lock);

+ cancel_delayed_work_sync(&conn->info_timer);
+ list_add(&conn->hchan->list, &head);
hci_chan_del(conn->hchan);

- if (conn->info_state & L2CAP_INFO_FEAT_MASK_REQ_SENT)
- cancel_delayed_work_sync(&conn->info_timer);
-
- hcon->l2cap_data = NULL;
conn->hchan = NULL;
+ hcon->l2cap_data = NULL;
l2cap_conn_put(conn);
}

@@ -7893,6 +7884,7 @@ static struct l2cap_conn *l2cap_conn_add
INIT_DELAYED_WORK(&conn->id_addr_timer, l2cap_conn_update_id_addr);

conn->disc_reason = HCI_ERROR_REMOTE_USER_TERM;
+ list_del(&hchan->list);

return conn;
}
--- x/include/net/bluetooth/hci_core.h
+++ y/include/net/bluetooth/hci_core.h
@@ -1545,9 +1545,7 @@ static inline void hci_conn_drop(struct
break;
}

- cancel_delayed_work(&conn->disc_work);
- queue_delayed_work(conn->hdev->workqueue,
- &conn->disc_work, timeo);
+ queue_delayed_work(system_unbound_wq, &conn->disc_work, timeo);
}
}

--

syzbot

unread,
Aug 25, 2023, 10:35:34 PM8/25/23
to hda...@sina.com, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
KASAN: use-after-free Read in hci_cmd_sync_queue

==================================================================
BUG: KASAN: use-after-free in instrument_atomic_read include/linux/instrumented.h:68 [inline]
BUG: KASAN: use-after-free in _test_bit include/asm-generic/bitops/instrumented-non-atomic.h:141 [inline]
BUG: KASAN: use-after-free in hci_cmd_sync_queue+0x31/0xa0 net/bluetooth/hci_sync.c:736
Read of size 8 at addr ffff88806a2f00a8 by task kworker/u4:3/48

CPU: 0 PID: 48 Comm: kworker/u4:3 Not tainted 6.5.0-rc6-next-20230818-syzkaller-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023
Workqueue: events_unbound hci_conn_timeout
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:364 [inline]
print_report+0xc4/0x620 mm/kasan/report.c:475
kasan_report+0xda/0x110 mm/kasan/report.c:588
check_region_inline mm/kasan/generic.c:181 [inline]
kasan_check_range+0xef/0x190 mm/kasan/generic.c:187
instrument_atomic_read include/linux/instrumented.h:68 [inline]
_test_bit include/asm-generic/bitops/instrumented-non-atomic.h:141 [inline]
hci_cmd_sync_queue+0x31/0xa0 net/bluetooth/hci_sync.c:736
hci_abort_conn+0x15b/0x330 net/bluetooth/hci_conn.c:2912
hci_conn_timeout+0x1a9/0x210 net/bluetooth/hci_conn.c:631
process_one_work+0x887/0x15d0 kernel/workqueue.c:2630
process_scheduled_works kernel/workqueue.c:2703 [inline]
worker_thread+0x8bb/0x1290 kernel/workqueue.c:2784
kthread+0x33a/0x430 kernel/kthread.c:388
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304
</TASK>

The buggy address belongs to the physical page:
page:ffffea0001a8bc00 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x6a2f0
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000000 ffffea0001957c08 ffffea0001a25708 0000000000000000
raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as freed
page last allocated via order 2, migratetype Unmovable, gfp_mask 0x5c2cc0(GFP_USER|__GFP_NOWARN|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_ACCOUNT), pid 4708, tgid 4708 (dhcpcd), ts 454062019777, free_ts 454066820991
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x2cf/0x340 mm/page_alloc.c:1536
prep_new_page mm/page_alloc.c:1543 [inline]
get_page_from_freelist+0x10d7/0x31b0 mm/page_alloc.c:3219
__alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4475
__alloc_pages_node include/linux/gfp.h:237 [inline]
alloc_pages_node include/linux/gfp.h:260 [inline]
__kmalloc_large_node+0x87/0x1c0 mm/slab_common.c:1145
__do_kmalloc_node mm/slab_common.c:992 [inline]
__kmalloc_node_track_caller.cold+0x5/0xdd mm/slab_common.c:1024
kmalloc_reserve+0xef/0x270 net/core/skbuff.c:575
__alloc_skb+0x12b/0x330 net/core/skbuff.c:644
alloc_skb include/linux/skbuff.h:1286 [inline]
alloc_skb_with_frags+0xe4/0x710 net/core/skbuff.c:6274
sock_alloc_send_pskb+0x7c8/0x950 net/core/sock.c:2794
unix_dgram_sendmsg+0x455/0x1c30 net/unix/af_unix.c:1953
sock_sendmsg_nosec net/socket.c:730 [inline]
sock_sendmsg+0xd9/0x180 net/socket.c:753
sock_write_iter+0x29b/0x3d0 net/socket.c:1140
call_write_iter include/linux/fs.h:1983 [inline]
do_iter_readv_writev+0x21e/0x3c0 fs/read_write.c:735
do_iter_write+0x17f/0x830 fs/read_write.c:860
vfs_writev+0x221/0x700 fs/read_write.c:933
do_writev+0x285/0x370 fs/read_write.c:976
ffff88806a2eff80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff88806a2f0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff88806a2f0080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff88806a2f0100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff88806a2f0180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================


Tested on:

commit: 7271b2a5 Add linux-next specific files for 20230818
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
console output: https://syzkaller.appspot.com/x/log.txt?x=1005e760680000
kernel config: https://syzkaller.appspot.com/x/.config?x=1936af09cdef7dd6
dashboard link: https://syzkaller.appspot.com/bug?extid=a0c80b06ae2cb8895bc4
compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
patch: https://syzkaller.appspot.com/x/patch.diff?x=145e5f5ba80000

Hillf Danton

unread,
Aug 25, 2023, 11:55:45 PM8/25/23
to syzbot, linux-...@vger.kernel.org, syzkall...@googlegroups.com
On Mon, 21 Aug 2023 09:26:48 -0700
> HEAD commit: 7271b2a53042 Add linux-next specific files for 20230818
> git tree: linux-next
--- x/net/bluetooth/hci_conn.c
+++ y/net/bluetooth/hci_conn.c
@@ -613,6 +613,7 @@ static void hci_conn_timeout(struct work
struct hci_conn *conn = container_of(work, struct hci_conn,
disc_work.work);
int refcnt = atomic_read(&conn->refcnt);
+ struct hci_dev *hdev = conn->hdev;

BT_DBG("hcon %p state %s", conn, state_to_string(conn->state));

@@ -629,6 +630,7 @@ static void hci_conn_timeout(struct work
return;

hci_abort_conn(conn, hci_proto_disconn_ind(conn));
+ hci_dev_put(hdev);
}

/* Enter sniff mode */
@@ -1027,6 +1029,7 @@ struct hci_conn *hci_conn_add(struct hci
atomic_set(&conn->refcnt, 0);

hci_dev_hold(hdev);
+ hci_dev_hold(hdev);

hci_conn_hash_add(hdev, conn);

--

syzbot

unread,
Aug 26, 2023, 12:29:28 AM8/26/23
to hda...@sina.com, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
KASAN: use-after-free Read in hci_get_route

==================================================================
BUG: KASAN: use-after-free in instrument_atomic_read include/linux/instrumented.h:68 [inline]
BUG: KASAN: use-after-free in _test_bit include/asm-generic/bitops/instrumented-non-atomic.h:141 [inline]
BUG: KASAN: use-after-free in hci_get_route+0x1cc/0x510 net/bluetooth/hci_conn.c:1156
Read of size 8 at addr ffff888068d1c0a8 by task syz-executor.0/5857

CPU: 0 PID: 5857 Comm: syz-executor.0 Not tainted 6.5.0-rc6-next-20230818-syzkaller-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:364 [inline]
print_report+0xc4/0x620 mm/kasan/report.c:475
kasan_report+0xda/0x110 mm/kasan/report.c:588
check_region_inline mm/kasan/generic.c:181 [inline]
kasan_check_range+0xef/0x190 mm/kasan/generic.c:187
instrument_atomic_read include/linux/instrumented.h:68 [inline]
_test_bit include/asm-generic/bitops/instrumented-non-atomic.h:141 [inline]
hci_get_route+0x1cc/0x510 net/bluetooth/hci_conn.c:1156
get_l2cap_conn.constprop.0+0xe9/0x6b0 net/bluetooth/6lowpan.c:968
lowpan_control_write+0x1ba/0x730 net/bluetooth/6lowpan.c:1100
full_proxy_write+0x124/0x190 fs/debugfs/file.c:236
vfs_write+0x2a4/0xe40 fs/read_write.c:582
ksys_write+0x12f/0x250 fs/read_write.c:637
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f728f47cae9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f72900ee0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007f728f59bf80 RCX: 00007f728f47cae9
RDX: 000000000000001b RSI: 0000000020000280 RDI: 0000000000000003
RBP: 00007f728f4c847a R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007f728f59bf80 R15: 00007ffd19482978
</TASK>

The buggy address belongs to the physical page:
page:ffffea0001a34700 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x68d1c
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000000 ffffea00008a6e08 ffff8880b9842670 0000000000000000
raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as freed
page last allocated via order 2, migratetype Unmovable, gfp_mask 0x140dc0(GFP_USER|__GFP_COMP|__GFP_ZERO), pid 5393, tgid 5393 (syz-executor.0), ts 86181654329, free_ts 106465252737
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x2cf/0x340 mm/page_alloc.c:1536
prep_new_page mm/page_alloc.c:1543 [inline]
get_page_from_freelist+0x10d7/0x31b0 mm/page_alloc.c:3219
__alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4475
__alloc_pages_node include/linux/gfp.h:237 [inline]
alloc_pages_node include/linux/gfp.h:260 [inline]
__kmalloc_large_node+0x87/0x1c0 mm/slab_common.c:1145
__do_kmalloc_node mm/slab_common.c:992 [inline]
__kmalloc.cold+0xb/0xe0 mm/slab_common.c:1017
kmalloc include/linux/slab.h:604 [inline]
kzalloc include/linux/slab.h:721 [inline]
hci_alloc_dev_priv+0x1d/0x2770 net/bluetooth/hci_core.c:2467
hci_alloc_dev include/net/bluetooth/hci_core.h:1598 [inline]
__vhci_create_device+0xf7/0x800 drivers/bluetooth/hci_vhci.c:402
vhci_create_device drivers/bluetooth/hci_vhci.c:475 [inline]
vhci_get_user drivers/bluetooth/hci_vhci.c:532 [inline]
vhci_write+0x2c7/0x470 drivers/bluetooth/hci_vhci.c:612
call_write_iter include/linux/fs.h:1983 [inline]
new_sync_write fs/read_write.c:491 [inline]
vfs_write+0x650/0xe40 fs/read_write.c:584
ksys_write+0x12f/0x250 fs/read_write.c:637
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1136 [inline]
free_unref_page_prepare+0x476/0xa40 mm/page_alloc.c:2348
free_unref_page+0x33/0x3b0 mm/page_alloc.c:2441
bt_host_release+0x87/0xb0 net/bluetooth/hci_sysfs.c:95
device_release+0xa1/0x240 drivers/base/core.c:2484
kobject_cleanup lib/kobject.c:689 [inline]
kobject_release lib/kobject.c:720 [inline]
kref_put include/linux/kref.h:65 [inline]
kobject_put+0x1f7/0x5b0 lib/kobject.c:737
put_device+0x1f/0x30 drivers/base/core.c:3731
hci_dev_put include/net/bluetooth/hci_core.h:1558 [inline]
hci_conn_timeout+0x215/0x2d0 net/bluetooth/hci_conn.c:633
process_one_work+0x887/0x15d0 kernel/workqueue.c:2630
process_scheduled_works kernel/workqueue.c:2703 [inline]
worker_thread+0x8bb/0x1290 kernel/workqueue.c:2784
kthread+0x33a/0x430 kernel/kthread.c:388
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304

Memory state around the buggy address:
ffff888068d1bf80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff888068d1c000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff888068d1c080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff888068d1c100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff888068d1c180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================


Tested on:

commit: 7271b2a5 Add linux-next specific files for 20230818
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
console output: https://syzkaller.appspot.com/x/log.txt?x=11425db7a80000
kernel config: https://syzkaller.appspot.com/x/.config?x=1936af09cdef7dd6
dashboard link: https://syzkaller.appspot.com/bug?extid=a0c80b06ae2cb8895bc4
compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
patch: https://syzkaller.appspot.com/x/patch.diff?x=170c63a7a80000

Hillf Danton

unread,
Aug 26, 2023, 4:08:47 AM8/26/23
to syzbot, linux-...@vger.kernel.org, syzkall...@googlegroups.com
On Mon, 21 Aug 2023 09:26:48 -0700
> HEAD commit: 7271b2a53042 Add linux-next specific files for 20230818
> git tree: linux-next
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=147569efa80000

Bail out in case of closed connection.

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 7271b2a53042

--- x/net/bluetooth/l2cap_core.c
+++ y/net/bluetooth/l2cap_core.c
@@ -1800,11 +1800,18 @@ static void l2cap_info_timeout(struct wo
{
struct l2cap_conn *conn = container_of(work, struct l2cap_conn,
info_timer.work);
+ struct hci_dev *hdev = conn->hcon->hdev;

+ hci_dev_lock(hdev);
+ if (conn->hcon->state == BT_CLOSED) {
+ hci_dev_unlock(hdev);
+ return;
+ }
conn->info_state |= L2CAP_INFO_FEAT_MASK_REQ_DONE;
conn->info_ident = 0;

l2cap_conn_start(conn);
+ hci_dev_unlock(hdev);
}

/*
--

syzbot

unread,
Aug 26, 2023, 5:02:34 AM8/26/23
to hda...@sina.com, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
KASAN: slab-use-after-free Read in l2cap_chan_del

==================================================================
BUG: KASAN: slab-use-after-free in hci_conn_drop include/net/bluetooth/hci_core.h:1549 [inline]
BUG: KASAN: slab-use-after-free in hci_conn_drop include/net/bluetooth/hci_core.h:1519 [inline]
BUG: KASAN: slab-use-after-free in l2cap_chan_del+0xa0b/0xa70 net/bluetooth/l2cap_core.c:668
Read of size 8 at addr ffff888073cb0718 by task kworker/1:0/23

CPU: 1 PID: 23 Comm: kworker/1:0 Not tainted 6.5.0-rc6-next-20230818-syzkaller-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023
Workqueue: events l2cap_chan_timeout
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:364 [inline]
print_report+0xc4/0x620 mm/kasan/report.c:475
kasan_report+0xda/0x110 mm/kasan/report.c:588
hci_conn_drop include/net/bluetooth/hci_core.h:1549 [inline]
hci_conn_drop include/net/bluetooth/hci_core.h:1519 [inline]
l2cap_chan_del+0xa0b/0xa70 net/bluetooth/l2cap_core.c:668
l2cap_chan_close+0xff/0xa20 net/bluetooth/l2cap_core.c:851
l2cap_chan_timeout+0x17d/0x2f0 net/bluetooth/l2cap_core.c:452
process_one_work+0x887/0x15d0 kernel/workqueue.c:2630
process_scheduled_works kernel/workqueue.c:2703 [inline]
worker_thread+0x8bb/0x1290 kernel/workqueue.c:2784
kthread+0x33a/0x430 kernel/kthread.c:388
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304
</TASK>

Allocated by task 78:
kasan_save_stack+0x33/0x50 mm/kasan/common.c:45
kasan_set_track+0x25/0x30 mm/kasan/common.c:52
__kasan_slab_alloc+0x81/0x90 mm/kasan/common.c:328
kasan_slab_alloc include/linux/kasan.h:188 [inline]
slab_post_alloc_hook mm/slab.h:762 [inline]
slab_alloc_node mm/slub.c:3478 [inline]
kmem_cache_alloc_node+0x185/0x3f0 mm/slub.c:3523
kmalloc_reserve+0x167/0x270 net/core/skbuff.c:559
pskb_expand_head+0x236/0x1170 net/core/skbuff.c:2087
netlink_trim+0x1eb/0x240 net/netlink/af_netlink.c:1324
netlink_broadcast_filtered+0xc5/0xf00 net/netlink/af_netlink.c:1531
netlink_broadcast+0x39/0x50 net/netlink/af_netlink.c:1576
nlmsg_multicast include/net/netlink.h:1079 [inline]
genlmsg_multicast_netns include/net/genetlink.h:454 [inline]
devlink_trap_notify net/devlink/leftover.c:8813 [inline]
devlink_trap_notify+0x1a9/0x240 net/devlink/leftover.c:8791
devlink_trap_unregister+0x127/0x3a0 net/devlink/leftover.c:8871
devl_traps_unregister+0x233/0x2f0 net/devlink/leftover.c:8978
nsim_dev_traps_exit+0x53/0x170 drivers/net/netdevsim/dev.c:936
nsim_dev_reload_destroy+0x1e0/0x560 drivers/net/netdevsim/dev.c:1663
nsim_dev_reload_down+0x6e/0xd0 drivers/net/netdevsim/dev.c:965
devlink_reload+0x11c/0x450 net/devlink/dev.c:363
devlink_pernet_pre_exit+0x1ce/0x2a0 net/devlink/core.c:282
ops_pre_exit_list net/core/net_namespace.c:160 [inline]
cleanup_net+0x46c/0xb20 net/core/net_namespace.c:602
process_one_work+0x887/0x15d0 kernel/workqueue.c:2630
process_scheduled_works kernel/workqueue.c:2703 [inline]
worker_thread+0x8bb/0x1290 kernel/workqueue.c:2784
kthread+0x33a/0x430 kernel/kthread.c:388
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304

Freed by task 78:
kasan_save_stack+0x33/0x50 mm/kasan/common.c:45
kasan_set_track+0x25/0x30 mm/kasan/common.c:52
kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:522
____kasan_slab_free mm/kasan/common.c:236 [inline]
____kasan_slab_free+0x15b/0x1b0 mm/kasan/common.c:200
kasan_slab_free include/linux/kasan.h:164 [inline]
slab_free_hook mm/slub.c:1800 [inline]
slab_free_freelist_hook+0x114/0x1e0 mm/slub.c:1826
slab_free mm/slub.c:3809 [inline]
kmem_cache_free+0xf0/0x480 mm/slub.c:3831
skb_kfree_head net/core/skbuff.c:937 [inline]
skb_kfree_head net/core/skbuff.c:934 [inline]
skb_free_head+0x17f/0x1b0 net/core/skbuff.c:951
skb_release_data+0x5ba/0x870 net/core/skbuff.c:981
skb_release_all net/core/skbuff.c:1047 [inline]
__kfree_skb net/core/skbuff.c:1061 [inline]
consume_skb net/core/skbuff.c:1277 [inline]
consume_skb+0xd2/0x170 net/core/skbuff.c:1271
netlink_broadcast_filtered+0x3d4/0xf00 net/netlink/af_netlink.c:1554
netlink_broadcast+0x39/0x50 net/netlink/af_netlink.c:1576
nlmsg_multicast include/net/netlink.h:1079 [inline]
genlmsg_multicast_netns include/net/genetlink.h:454 [inline]
devlink_trap_notify net/devlink/leftover.c:8813 [inline]
devlink_trap_notify+0x1a9/0x240 net/devlink/leftover.c:8791
devlink_trap_unregister+0x127/0x3a0 net/devlink/leftover.c:8871
devl_traps_unregister+0x233/0x2f0 net/devlink/leftover.c:8978
nsim_dev_traps_exit+0x53/0x170 drivers/net/netdevsim/dev.c:936
nsim_dev_reload_destroy+0x1e0/0x560 drivers/net/netdevsim/dev.c:1663
nsim_dev_reload_down+0x6e/0xd0 drivers/net/netdevsim/dev.c:965
devlink_reload+0x11c/0x450 net/devlink/dev.c:363
devlink_pernet_pre_exit+0x1ce/0x2a0 net/devlink/core.c:282
ops_pre_exit_list net/core/net_namespace.c:160 [inline]
cleanup_net+0x46c/0xb20 net/core/net_namespace.c:602
process_one_work+0x887/0x15d0 kernel/workqueue.c:2630
process_scheduled_works kernel/workqueue.c:2703 [inline]
worker_thread+0x8bb/0x1290 kernel/workqueue.c:2784
kthread+0x33a/0x430 kernel/kthread.c:388
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304

The buggy address belongs to the object at ffff888073cb0600
which belongs to the cache skbuff_small_head of size 640
The buggy address is located 280 bytes inside of
freed 640-byte region [ffff888073cb0600, ffff888073cb0880)

The buggy address belongs to the physical page:
page:ffffea0001cf2c00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x73cb0
head:ffffea0001cf2c00 order:2 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000840 ffff888019a6a8c0 dead000000000122 0000000000000000
raw: 0000000000000000 0000000000150015 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 2, migratetype Unmovable, gfp_mask 0x1d28c0(GFP_NOWAIT|__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 78, tgid 78 (kworker/u4:5), ts 454224323940, free_ts 453753622092
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x2cf/0x340 mm/page_alloc.c:1536
prep_new_page mm/page_alloc.c:1543 [inline]
get_page_from_freelist+0x10d7/0x31b0 mm/page_alloc.c:3219
__alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4475
alloc_pages+0x1a9/0x270 mm/mempolicy.c:2298
alloc_slab_page mm/slub.c:1870 [inline]
allocate_slab+0x251/0x380 mm/slub.c:2017
new_slab mm/slub.c:2070 [inline]
___slab_alloc+0x8be/0x1570 mm/slub.c:3223
__slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3322
__slab_alloc_node mm/slub.c:3375 [inline]
slab_alloc_node mm/slub.c:3468 [inline]
kmem_cache_alloc_node+0x137/0x3f0 mm/slub.c:3523
kmalloc_reserve+0x167/0x270 net/core/skbuff.c:559
pskb_expand_head+0x236/0x1170 net/core/skbuff.c:2087
netlink_trim+0x1eb/0x240 net/netlink/af_netlink.c:1324
netlink_broadcast_filtered+0xc5/0xf00 net/netlink/af_netlink.c:1531
netlink_broadcast+0x39/0x50 net/netlink/af_netlink.c:1576
nlmsg_multicast include/net/netlink.h:1079 [inline]
genlmsg_multicast_netns include/net/genetlink.h:454 [inline]
devlink_trap_notify net/devlink/leftover.c:8813 [inline]
devlink_trap_notify+0x1a9/0x240 net/devlink/leftover.c:8791
devlink_trap_unregister+0x127/0x3a0 net/devlink/leftover.c:8871
devl_traps_unregister+0x233/0x2f0 net/devlink/leftover.c:8978
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1136 [inline]
free_unref_page_prepare+0x476/0xa40 mm/page_alloc.c:2348
free_unref_page+0x33/0x3b0 mm/page_alloc.c:2441
__stack_depot_save+0x193/0x510 lib/stackdepot.c:443
kasan_save_stack+0x43/0x50 mm/kasan/common.c:46
kasan_set_track+0x25/0x30 mm/kasan/common.c:52
____kasan_kmalloc mm/kasan/common.c:374 [inline]
__kasan_kmalloc+0xa2/0xb0 mm/kasan/common.c:383
kmalloc include/linux/slab.h:600 [inline]
kzalloc include/linux/slab.h:721 [inline]
nf_nat_masq_schedule.part.0+0x290/0x610 net/netfilter/nf_nat_masquerade.c:118
nf_nat_masq_schedule net/netfilter/nf_nat_masquerade.c:108 [inline]
masq_device_event+0xee/0x120 net/netfilter/nf_nat_masquerade.c:162
notifier_call_chain+0xb6/0x3b0 kernel/notifier.c:93
call_netdevice_notifiers_info+0xb9/0x130 net/core/dev.c:1970
call_netdevice_notifiers_extack net/core/dev.c:2008 [inline]
call_netdevice_notifiers net/core/dev.c:2022 [inline]
dev_close_many+0x305/0x640 net/core/dev.c:1563
unregister_netdevice_many_notify+0x41b/0x1a20 net/core/dev.c:10908
unregister_netdevice_many net/core/dev.c:10991 [inline]
unregister_netdevice_queue+0x2e5/0x3c0 net/core/dev.c:10871
unregister_netdevice include/linux/netdevice.h:3106 [inline]
__tun_detach+0x116f/0x1470 drivers/net/tun.c:684
tun_detach drivers/net/tun.c:700 [inline]
tun_chr_close+0xc8/0x240 drivers/net/tun.c:3496
__fput+0x3f7/0xa70 fs/file_table.c:384

Memory state around the buggy address:
ffff888073cb0600: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888073cb0680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888073cb0700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888073cb0780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888073cb0800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================


Tested on:

commit: 7271b2a5 Add linux-next specific files for 20230818
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
console output: https://syzkaller.appspot.com/x/log.txt?x=1372b89fa80000
kernel config: https://syzkaller.appspot.com/x/.config?x=1936af09cdef7dd6
dashboard link: https://syzkaller.appspot.com/bug?extid=a0c80b06ae2cb8895bc4
compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
patch: https://syzkaller.appspot.com/x/patch.diff?x=11e1e55ba80000

Hillf Danton

unread,
Aug 26, 2023, 9:42:07 PM8/26/23
to syzbot, linux-...@vger.kernel.org, syzkall...@googlegroups.com
On Mon, 21 Aug 2023 09:26:48 -0700
> HEAD commit: 7271b2a53042 Add linux-next specific files for 20230818
> git tree: linux-next
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=147569efa80000

Bail out in case of closed connection.

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 7271b2a53042

--- x/net/bluetooth/l2cap_core.c
+++ y/net/bluetooth/l2cap_core.c
@@ -432,6 +432,13 @@ static void l2cap_chan_timeout(struct wo
chan_timer.work);
struct l2cap_conn *conn = chan->conn;
int reason;
+ struct hci_dev *hdev = conn->hcon->hdev;
+
+ hci_dev_lock(hdev);
+ if (conn->hcon->state == BT_CLOSED) {
+ hci_dev_unlock(hdev);
+ return;
+ }

BT_DBG("chan %p state %s", chan, state_to_string(chan->state));

@@ -457,6 +464,7 @@ static void l2cap_chan_timeout(struct wo
l2cap_chan_put(chan);

mutex_unlock(&conn->chan_lock);
+ hci_dev_unlock(hdev);
}

struct l2cap_chan *l2cap_chan_create(void)
@@ -1800,11 +1808,18 @@ static void l2cap_info_timeout(struct wo

syzbot

unread,
Aug 26, 2023, 10:44:35 PM8/26/23
to hda...@sina.com, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-and-tested-by: syzbot+a0c80b...@syzkaller.appspotmail.com

Tested on:

commit: 7271b2a5 Add linux-next specific files for 20230818
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
console output: https://syzkaller.appspot.com/x/log.txt?x=1032fd40680000
kernel config: https://syzkaller.appspot.com/x/.config?x=1936af09cdef7dd6
dashboard link: https://syzkaller.appspot.com/bug?extid=a0c80b06ae2cb8895bc4
compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
patch: https://syzkaller.appspot.com/x/patch.diff?x=1496adb7a80000

syzbot

unread,
Aug 31, 2023, 2:07:27 PM8/31/23
to hda...@sina.com, johan....@gmail.com, linux-b...@vger.kernel.org, linux-...@vger.kernel.org, luiz....@gmail.com, luiz.vo...@intel.com, mar...@holtmann.org, p...@iki.fi, syzkall...@googlegroups.com
syzbot has bisected this issue to:

commit 45c37c4e9c9aab5bb1cf5778d8e5ebd9f9ad820a
Author: Luiz Augusto von Dentz <luiz.vo...@intel.com>
Date: Wed Aug 9 23:49:33 2023 +0000

Bluetooth: hci_sync: Fix UAF in hci_disconnect_all_sync

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=1042c5ffa80000
start commit: 7271b2a53042 Add linux-next specific files for 20230818
git tree: linux-next
final oops: https://syzkaller.appspot.com/x/report.txt?x=1242c5ffa80000
console output: https://syzkaller.appspot.com/x/log.txt?x=1442c5ffa80000
Reported-by: syzbot+a0c80b...@syzkaller.appspotmail.com
Fixes: 45c37c4e9c9a ("Bluetooth: hci_sync: Fix UAF in hci_disconnect_all_sync")

For information about bisection process see: https://goo.gl/tpsmEJ#bisection

Pauli Virtanen

unread,
Oct 11, 2023, 3:22:17 PM10/11/23
to syzbot, syzkall...@googlegroups.com
#syz test git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git bbb24b6a681b12beccc4a6a68e44f40b3d8858b7

diff --git a/include/net/bluetooth/hci_sync.h b/include/net/bluetooth/hci_sync.h
index 6efbc2152146..ffa1481fb2e4 100644
--- a/include/net/bluetooth/hci_sync.h
+++ b/include/net/bluetooth/hci_sync.h
@@ -19,6 +19,10 @@ struct hci_cmd_sync_work_entry {
hci_cmd_sync_work_destroy_t destroy;
};

+typedef int (*hci_cmd_sync_select_t)(struct hci_dev *hdev,
+ const struct hci_cmd_sync_work_entry *item,
+ void *data);
+
struct adv_info;
/* Function with sync suffix shall not be called with hdev->lock held as they
* wait the command to complete and in the meantime an event could be received
@@ -48,6 +52,8 @@ int hci_cmd_sync_submit(struct hci_dev *hdev, hci_cmd_sync_work_func_t func,
void *data, hci_cmd_sync_work_destroy_t destroy);
int hci_cmd_sync_queue(struct hci_dev *hdev, hci_cmd_sync_work_func_t func,
void *data, hci_cmd_sync_work_destroy_t destroy);
+int hci_cmd_sync_remove(struct hci_dev *hdev,
+ hci_cmd_sync_select_t func, void *data);

int hci_update_eir_sync(struct hci_dev *hdev);
int hci_update_class_sync(struct hci_dev *hdev);
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 974631e652c1..d2b84b6568a3 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -68,6 +68,9 @@ static const struct sco_param esco_param_msbc[] = {
{ EDR_ESCO_MASK | ESCO_EV3, 0x0008, 0x02 }, /* T1 */
};

+static void hci_abort_conn_cancel(struct hci_conn *conn);
+static int __hci_abort_conn(struct hci_conn *conn, u8 reason);
+
/* This function requires the caller holds hdev->lock */
static void hci_connect_le_scan_cleanup(struct hci_conn *conn, u8 status)
{
@@ -628,7 +631,7 @@ static void hci_conn_timeout(struct work_struct *work)
if (refcnt > 0)
return;

- hci_abort_conn(conn, hci_proto_disconn_ind(conn));
+ __hci_abort_conn(conn, hci_proto_disconn_ind(conn));
}

/* Enter sniff mode */
@@ -714,7 +717,7 @@ static void le_conn_timeout(struct work_struct *work)
return;
}

- hci_abort_conn(conn, HCI_ERROR_REMOTE_USER_TERM);
+ __hci_abort_conn(conn, HCI_ERROR_REMOTE_USER_TERM);
}

struct iso_cig_params {
@@ -1150,6 +1153,8 @@ void hci_conn_del(struct hci_conn *conn)

skb_queue_purge(&conn->data_q);

+ hci_abort_conn_cancel(conn);
+
/* Remove the connection from the list and cleanup its remaining
* state. This is a separate function since for some cases like
* BT_CONNECT_SCAN we *only* want the cleanup part without the
@@ -2930,7 +2935,7 @@ static int abort_conn_sync(struct hci_dev *hdev, void *data)
return hci_abort_conn_sync(hdev, conn, conn->abort_reason);
}

-int hci_abort_conn(struct hci_conn *conn, u8 reason)
+static int __hci_abort_conn(struct hci_conn *conn, u8 reason)
{
struct hci_dev *hdev = conn->hdev;

@@ -2964,3 +2969,34 @@ int hci_abort_conn(struct hci_conn *conn, u8 reason)
return hci_cmd_sync_queue(hdev, abort_conn_sync, UINT_PTR(conn->handle),
NULL);
}
+
+int hci_abort_conn(struct hci_conn *conn, u8 reason)
+{
+ struct hci_dev *hdev = conn->hdev;
+
+ lockdep_assert_held(&hdev->lock);
+ return __hci_abort_conn(conn, reason);
+}
+
+static int abort_conn_remove(struct hci_dev *hdev,
+ const struct hci_cmd_sync_work_entry *entry,
+ void *data)
+{
+ if (entry->func == abort_conn_sync && entry->data == data)
+ return -ECANCELED;
+
+ return 0;
+}
+
+static void hci_abort_conn_cancel(struct hci_conn *conn)
+{
+ struct hci_dev *hdev = conn->hdev;
+
+ lockdep_assert_held(&hdev->lock);
+
+ /* Disallow queuing more aborts and remove entries from queue. */
+ if (!conn->abort_reason)
+ conn->abort_reason = HCI_ERROR_UNSPECIFIED;
+
+ hci_cmd_sync_remove(hdev, abort_conn_remove, UINT_PTR(conn->handle));
+}
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 195aea2198a9..fc3191531dac 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -3414,23 +3414,18 @@ static void hci_link_tx_to(struct hci_dev *hdev, __u8 type)

bt_dev_err(hdev, "link tx timeout");

- rcu_read_lock();
+ hci_dev_lock(hdev);

/* Kill stalled connections */
- list_for_each_entry_rcu(c, &h->list, list) {
+ list_for_each_entry(c, &h->list, list) {
if (c->type == type && c->sent) {
bt_dev_err(hdev, "killing stalled connection %pMR",
&c->dst);
- /* hci_disconnect might sleep, so, we have to release
- * the RCU read lock before calling it.
- */
- rcu_read_unlock();
hci_disconnect(c, HCI_ERROR_REMOTE_USER_TERM);
- rcu_read_lock();
}
}

- rcu_read_unlock();
+ hci_dev_unlock(hdev);
}

static struct hci_chan *hci_chan_sent(struct hci_dev *hdev, __u8 type,
diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index c6f57af88bfd..94966c23503e 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -634,6 +634,17 @@ void hci_cmd_sync_init(struct hci_dev *hdev)
INIT_DELAYED_WORK(&hdev->adv_instance_expire, adv_timeout_expire);
}

+static void __hci_cmd_sync_cancel_entry(struct hci_dev *hdev,
+ struct hci_cmd_sync_work_entry *entry,
+ int err)
+{
+ if (entry->destroy)
+ entry->destroy(hdev, entry->data, -ECANCELED);
+
+ list_del(&entry->list);
+ kfree(entry);
+}
+
void hci_cmd_sync_clear(struct hci_dev *hdev)
{
struct hci_cmd_sync_work_entry *entry, *tmp;
@@ -642,13 +653,8 @@ void hci_cmd_sync_clear(struct hci_dev *hdev)
cancel_work_sync(&hdev->reenable_adv_work);

mutex_lock(&hdev->cmd_sync_work_lock);
- list_for_each_entry_safe(entry, tmp, &hdev->cmd_sync_work_list, list) {
- if (entry->destroy)
- entry->destroy(hdev, entry->data, -ECANCELED);
-
- list_del(&entry->list);
- kfree(entry);
- }
+ list_for_each_entry_safe(entry, tmp, &hdev->cmd_sync_work_list, list)
+ __hci_cmd_sync_cancel_entry(hdev, entry, -ECANCELED);
mutex_unlock(&hdev->cmd_sync_work_lock);
}

@@ -681,6 +687,42 @@ void hci_cmd_sync_cancel(struct hci_dev *hdev, int err)
}
EXPORT_SYMBOL(hci_cmd_sync_cancel);

+int __hci_cmd_sync_foreach(struct hci_dev *hdev, bool cancel,
+ hci_cmd_sync_select_t func, void *data)
+{
+ struct hci_cmd_sync_work_entry *entry, *tmp;
+ int ret = 0;
+
+ list_for_each_entry_safe(entry, tmp, &hdev->cmd_sync_work_list, list) {
+ int err;
+
+ err = func(hdev, entry, data);
+ if (!err)
+ continue;
+
+ ret = err;
+ if (cancel)
+ __hci_cmd_sync_cancel_entry(hdev, entry, err);
+ else
+ break;
+ }
+
+ return ret;
+}
+
+int hci_cmd_sync_remove(struct hci_dev *hdev, hci_cmd_sync_select_t func,
+ void *data)
+{
+ int err;
+
+ mutex_lock(&hdev->cmd_sync_work_lock);
+ err = __hci_cmd_sync_foreach(hdev, true, func, data);
+ mutex_unlock(&hdev->cmd_sync_work_lock);
+
+ return err;
+}
+EXPORT_SYMBOL(hci_cmd_sync_remove);
+
/* Submit HCI command to be run in as cmd_sync_work:
*
* - hdev must _not_ be unregistered
@@ -5383,6 +5425,9 @@ int hci_abort_conn_sync(struct hci_dev *hdev, struct hci_conn *conn, u8 reason)
bool disconnect = false;
struct hci_conn *c;

+ if (WARN_ON(!reason))
+ return -EINVAL;
+
switch (conn->state) {
case BT_CONNECTED:
case BT_CONFIG:
@@ -5434,6 +5479,9 @@ static int hci_disconnect_all_sync(struct hci_dev *hdev, u8 reason)
struct list_head *head = &hdev->conn_hash.list;
struct hci_conn *conn;

+ if (!reason)
+ return -EINVAL;
+
rcu_read_lock();
while ((conn = list_first_or_null_rcu(head, struct hci_conn, list))) {
/* Make sure the connection is not freed while unlocking */

syzbot

unread,
Oct 11, 2023, 4:16:30 PM10/11/23
to p...@iki.fi, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
WARNING in hci_abort_conn_sync

Bluetooth: hci0: command 0x041b tx timeout
------------[ cut here ]------------
WARNING: CPU: 1 PID: 5052 at net/bluetooth/hci_sync.c:5428 hci_abort_conn_sync+0x87e/0xb80 net/bluetooth/hci_sync.c:5428
Modules linked in:
CPU: 1 PID: 5052 Comm: kworker/u5:2 Not tainted 6.6.0-rc4-syzkaller-01157-gbbb24b6a681b-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/06/2023
Workqueue: hci0 hci_cmd_sync_work
RIP: 0010:hci_abort_conn_sync+0x87e/0xb80 net/bluetooth/hci_sync.c:5428
Code: f8 48 c7 c2 60 f8 ba 8b be 0a 03 00 00 48 c7 c7 20 f8 ba 8b c6 05 7e 74 67 05 01 e8 8c 9f 16 f8 e9 f7 f9 ff ff e8 f2 b8 36 f8 <0f> 0b c7 04 24 ea ff ff ff e9 2a fa ff ff e8 df b8 36 f8 ba 07 00
RSP: 0018:ffffc90004287b30 EFLAGS: 00010293
RAX: 0000000000000000 RBX: ffff88807aa14000 RCX: 0000000000000000
RDX: ffff88807dea0000 RSI: ffffffff8951179e RDI: 0000000000000001
RBP: 0000000000000f00 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: ffff88807402a032
R13: ffff88807402a000 R14: 0000000000000000 R15: 0000000000000000
FS: 0000000000000000(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000559eacbed7f0 CR3: 000000000c976000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
abort_conn_sync+0x187/0x390 net/bluetooth/hci_conn.c:2935
hci_cmd_sync_work+0x1a4/0x410 net/bluetooth/hci_sync.c:306
process_one_work+0x884/0x15c0 kernel/workqueue.c:2630
process_scheduled_works kernel/workqueue.c:2703 [inline]
worker_thread+0x8b9/0x1290 kernel/workqueue.c:2784
kthread+0x33c/0x440 kernel/kthread.c:388
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304
</TASK>


Tested on:

commit: bbb24b6a Bluetooth: hci_sock: Correctly bounds check a..
git tree: git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git
console output: https://syzkaller.appspot.com/x/log.txt?x=12371711680000
kernel config: https://syzkaller.appspot.com/x/.config?x=37e6eb4526c4e801
dashboard link: https://syzkaller.appspot.com/bug?extid=a0c80b06ae2cb8895bc4
compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
patch: https://syzkaller.appspot.com/x/patch.diff?x=1516d631680000

Pauli Virtanen

unread,
Oct 13, 2023, 2:35:05 PM10/13/23
to syzbot, syzkall...@googlegroups.com
#syz test git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git 8fa4c368ba691e6d92bc7a71279ed4ce5f1a6a1d

diff --git a/include/net/bluetooth/hci_sync.h b/include/net/bluetooth/hci_sync.h
index 6efbc2152146..ffa1481fb2e4 100644
--- a/include/net/bluetooth/hci_sync.h
+++ b/include/net/bluetooth/hci_sync.h
@@ -19,6 +19,10 @@ struct hci_cmd_sync_work_entry {
hci_cmd_sync_work_destroy_t destroy;
};

+typedef int (*hci_cmd_sync_select_t)(struct hci_dev *hdev,
+ const struct hci_cmd_sync_work_entry *item,
+ void *data);
+
struct adv_info;
/* Function with sync suffix shall not be called with hdev->lock held as they
* wait the command to complete and in the meantime an event could be received
@@ -48,6 +52,8 @@ int hci_cmd_sync_submit(struct hci_dev *hdev, hci_cmd_sync_work_func_t func,
void *data, hci_cmd_sync_work_destroy_t destroy);
int hci_cmd_sync_queue(struct hci_dev *hdev, hci_cmd_sync_work_func_t func,
void *data, hci_cmd_sync_work_destroy_t destroy);
+int hci_cmd_sync_remove(struct hci_dev *hdev,
+ hci_cmd_sync_select_t func, void *data);

int hci_update_eir_sync(struct hci_dev *hdev);
int hci_update_class_sync(struct hci_dev *hdev);
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 3735764b3169..d66d80bc6757 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -68,6 +68,9 @@ static const struct sco_param esco_param_msbc[] = {
{ EDR_ESCO_MASK | ESCO_EV3, 0x0008, 0x02 }, /* T1 */
};

+static void hci_abort_conn_cancel(struct hci_conn *conn);
+static int __hci_abort_conn(struct hci_conn *conn, u8 reason);
+
/* This function requires the caller holds hdev->lock */
static void hci_connect_le_scan_cleanup(struct hci_conn *conn, u8 status)
{
@@ -631,7 +634,7 @@ static void hci_conn_timeout(struct work_struct *work)
if (refcnt > 0)
return;

- hci_abort_conn(conn, hci_proto_disconn_ind(conn));
+ __hci_abort_conn(conn, hci_proto_disconn_ind(conn));
}

/* Enter sniff mode */
@@ -717,7 +720,7 @@ static void le_conn_timeout(struct work_struct *work)
return;
}

- hci_abort_conn(conn, HCI_ERROR_REMOTE_USER_TERM);
+ __hci_abort_conn(conn, HCI_ERROR_REMOTE_USER_TERM);
}

struct iso_cig_params {
@@ -1176,6 +1179,8 @@ void hci_conn_del(struct hci_conn *conn)

skb_queue_purge(&conn->data_q);

+ hci_abort_conn_cancel(conn);
+
/* Remove the connection from the list and cleanup its remaining
* state. This is a separate function since for some cases like
* BT_CONNECT_SCAN we *only* want the cleanup part without the
@@ -2959,7 +2964,7 @@ static int abort_conn_sync(struct hci_dev *hdev, void *data)
return hci_abort_conn_sync(hdev, conn, conn->abort_reason);
}

-int hci_abort_conn(struct hci_conn *conn, u8 reason)
+static int __hci_abort_conn(struct hci_conn *conn, u8 reason)
{
struct hci_dev *hdev = conn->hdev;

@@ -2993,3 +2998,34 @@ int hci_abort_conn(struct hci_conn *conn, u8 reason)
index 65601aa52e0d..5a26150f0fc4 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -3417,23 +3417,18 @@ static void hci_link_tx_to(struct hci_dev *hdev, __u8 type)

bt_dev_err(hdev, "link tx timeout");

- rcu_read_lock();
+ hci_dev_lock(hdev);

/* Kill stalled connections */
- list_for_each_entry_rcu(c, &h->list, list) {
+ list_for_each_entry(c, &h->list, list) {
if (c->type == type && c->sent) {
bt_dev_err(hdev, "killing stalled connection %pMR",
&c->dst);
- /* hci_disconnect might sleep, so, we have to release
- * the RCU read lock before calling it.
- */
- rcu_read_unlock();
hci_disconnect(c, HCI_ERROR_REMOTE_USER_TERM);
- rcu_read_lock();
}
}

- rcu_read_unlock();
+ hci_dev_unlock(hdev);
}

static struct hci_chan *hci_chan_sent(struct hci_dev *hdev, __u8 type,
diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index c6f57af88bfd..9bfdb6307137 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -634,6 +634,17 @@ void hci_cmd_sync_init(struct hci_dev *hdev)
INIT_DELAYED_WORK(&hdev->adv_instance_expire, adv_timeout_expire);
}

+static void __hci_cmd_sync_cancel_entry(struct hci_dev *hdev,
+ struct hci_cmd_sync_work_entry *entry,
+ int err)
+{
+ if (entry->destroy)
+ entry->destroy(hdev, entry->data, err);

syzbot

unread,
Oct 13, 2023, 4:22:35 PM10/13/23
to p...@iki.fi, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-and-tested-by: syzbot+a0c80b...@syzkaller.appspotmail.com

Tested on:

commit: 8fa4c368 Bluetooth: ISO: Copy BASE if service data mat..
git tree: git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git
console output: https://syzkaller.appspot.com/x/log.txt?x=16990875680000
kernel config: https://syzkaller.appspot.com/x/.config?x=37e6eb4526c4e801
dashboard link: https://syzkaller.appspot.com/bug?extid=a0c80b06ae2cb8895bc4
compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
patch: https://syzkaller.appspot.com/x/patch.diff?x=12ef5f3d680000

Pauli Virtanen

unread,
Oct 13, 2023, 4:37:20 PM10/13/23
to syzbot, syzkall...@googlegroups.com

syzbot

unread,
Oct 13, 2023, 5:47:28 PM10/13/23
to p...@iki.fi, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-and-tested-by: syzbot+a0c80b...@syzkaller.appspotmail.com

Tested on:

commit: 8fa4c368 Bluetooth: ISO: Copy BASE if service data mat..
git tree: git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git
console output: https://syzkaller.appspot.com/x/log.txt?x=124bc561680000
kernel config: https://syzkaller.appspot.com/x/.config?x=37e6eb4526c4e801
dashboard link: https://syzkaller.appspot.com/bug?extid=a0c80b06ae2cb8895bc4
compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40

Note: no patches were applied.

syzbot

unread,
Jan 14, 2024, 9:37:07 AMJan 14
to da...@davemloft.net, edum...@google.com, hda...@sina.com, johan....@gmail.com, ku...@kernel.org, linux-b...@vger.kernel.org, linux-...@vger.kernel.org, luiz....@gmail.com, luiz.vo...@intel.com, mar...@holtmann.org, net...@vger.kernel.org, pab...@redhat.com, p...@iki.fi, syzkall...@googlegroups.com, william.x...@huawei.com
syzbot suspects this issue was fixed by commit:

commit 181a42edddf51d5d9697ecdf365d72ebeab5afb0
Author: Ziyang Xuan <william.x...@huawei.com>
Date: Wed Oct 11 09:57:31 2023 +0000

Bluetooth: Make handle of hci_conn be unique

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=127944c1e80000
start commit: 4b2b606075e5 ipv4/fib: send notify when delete source addr..
git tree: net
kernel config: https://syzkaller.appspot.com/x/.config?x=d594086f139d167
dashboard link: https://syzkaller.appspot.com/bug?extid=a0c80b06ae2cb8895bc4
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=138aad9e680000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=125e0b92680000

If the result looks correct, please mark the issue as fixed by replying with:

#syz fix: Bluetooth: Make handle of hci_conn be unique

syzbot

unread,
Apr 20, 2024, 9:03:16 AM (7 days ago) Apr 20
to syzkall...@googlegroups.com
Auto-closing this bug as obsolete.
No recent activity, existing reproducers are no longer triggering the issue.
Reply all
Reply to author
Forward
0 new messages