syzbot


KASAN: slab-out-of-bounds Read in bt_accept_unlink

Status: upstream: reported on 2025/06/17 00:09
Reported-by: syzbot+1fabcd38ec20ef641d56@syzkaller.appspotmail.com
First crash: 1d07h, last: 1d07h
Similar bugs (4)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-5.15 BUG: corrupted list in bt_accept_unlink 3 29d 70d 0/3 upstream: reported on 2025/04/09 00:51
upstream KASAN: slab-use-after-free Read in bt_accept_unlink bluetooth 45 3d14h 239d 0/28 upstream: reported on 2024/10/21 08:47
linux-6.1 KASAN: use-after-free Read in bt_accept_unlink 1 7d08h 7d08h 0/3 upstream: reported on 2025/06/10 23:51
upstream general protection fault in bt_accept_unlink (2) bluetooth 1 1568d 1564d 0/28 auto-closed as invalid on 2021/07/01 06:33

Sample crash report:
==================================================================
BUG: KASAN: slab-out-of-bounds in __list_del_entry_valid_or_report+0x84/0x130 lib/list_debug.c:62
Read of size 8 at addr ffff88807c65e510 by task syz.0.1162/9360

CPU: 0 PID: 9360 Comm: syz.0.1162 Not tainted 6.6.93-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
Call Trace:
 <TASK>
 dump_stack_lvl+0x16c/0x230 lib/dump_stack.c:106
 print_address_description mm/kasan/report.c:364 [inline]
 print_report+0xac/0x230 mm/kasan/report.c:475
 kasan_report+0x151/0x180 mm/kasan/report.c:588
 __list_del_entry_valid_or_report+0x84/0x130 lib/list_debug.c:62
 __list_del_entry_valid include/linux/list.h:124 [inline]
 __list_del_entry include/linux/list.h:215 [inline]
 list_del_init include/linux/list.h:287 [inline]
 bt_accept_unlink+0x39/0x230 net/bluetooth/af_bluetooth.c:256
 l2cap_sock_teardown_cb+0x17e/0x450 net/bluetooth/l2cap_sock.c:1597
 l2cap_chan_del+0xaf/0x5e0 net/bluetooth/l2cap_core.c:655
 l2cap_conn_del+0x380/0x660 net/bluetooth/l2cap_core.c:1787
 hci_disconn_cfm include/net/bluetooth/hci_core.h:1982 [inline]
 hci_conn_hash_flush+0x107/0x220 net/bluetooth/hci_conn.c:2539
 hci_dev_close_sync+0x962/0xfb0 net/bluetooth/hci_sync.c:5217
 hci_dev_do_close net/bluetooth/hci_core.c:505 [inline]
 hci_unregister_dev+0x206/0x500 net/bluetooth/hci_core.c:2684
 vhci_release+0x83/0xd0 drivers/bluetooth/hci_vhci.c:666
 __fput+0x234/0x970 fs/file_table.c:384
 task_work_run+0x1ce/0x250 kernel/task_work.c:239
 exit_task_work include/linux/task_work.h:43 [inline]
 do_exit+0x903/0x23c0 kernel/exit.c:874
 do_group_exit+0x21b/0x2d0 kernel/exit.c:1023
 get_signal+0x12fc/0x1400 kernel/signal.c:2902
 arch_do_signal_or_restart+0x96/0x780 arch/x86/kernel/signal.c:310
 exit_to_user_mode_loop+0x70/0x110 kernel/entry/common.c:174
 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:210
 __syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline]
 syscall_exit_to_user_mode+0x1a/0x50 kernel/entry/common.c:302
 do_syscall_64+0x61/0xb0 arch/x86/entry/common.c:87
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7fb2df3c11e5
Code: Unable to access opcode bytes at 0x7fb2df3c11bb.
RSP: 002b:00007fb2e02d5f80 EFLAGS: 00000293 ORIG_RAX: 00000000000000e6
RAX: 0000000000000000 RBX: 00007fb2df5b5fa0 RCX: 00007fb2df3c11e5
RDX: 00007fb2e02d5fc0 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 00007fb2df410b39 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000000
R13: 0000000000000000 R14: 00007fb2df5b5fa0 R15: 00007ffd9d563668
 </TASK>

Allocated by task 9350:
 kasan_save_stack mm/kasan/common.c:45 [inline]
 kasan_set_track+0x4e/0x70 mm/kasan/common.c:52
 ____kasan_kmalloc mm/kasan/common.c:374 [inline]
 __kasan_kmalloc+0x8f/0xa0 mm/kasan/common.c:383
 kasan_kmalloc include/linux/kasan.h:198 [inline]
 __do_kmalloc_node mm/slab_common.c:1007 [inline]
 __kmalloc+0xb4/0x240 mm/slab_common.c:1020
 kmalloc include/linux/slab.h:604 [inline]
 kzalloc include/linux/slab.h:721 [inline]
 ops_init+0x8b/0x640 net/core/net_namespace.c:129
 setup_net+0x3a5/0xa00 net/core/net_namespace.c:343
 copy_net_ns+0x36d/0x5e0 net/core/net_namespace.c:520
 create_new_namespaces+0x3d3/0x6f0 kernel/nsproxy.c:110
 unshare_nsproxy_namespaces+0x11a/0x160 kernel/nsproxy.c:228
 ksys_unshare+0x4c0/0x890 kernel/fork.c:3439
 __do_sys_unshare kernel/fork.c:3510 [inline]
 __se_sys_unshare kernel/fork.c:3508 [inline]
 __x64_sys_unshare+0x38/0x40 kernel/fork.c:3508
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2

Last potentially related work creation:
 kasan_save_stack+0x3e/0x60 mm/kasan/common.c:45
 __kasan_record_aux_stack+0xaf/0xc0 mm/kasan/generic.c:492
 __call_rcu_common kernel/rcu/tree.c:2713 [inline]
 call_rcu+0x14f/0x920 kernel/rcu/tree.c:2829
 netlink_release+0x16d8/0x1ad0 net/netlink/af_netlink.c:812
 __sock_release net/socket.c:659 [inline]
 sock_close+0xbd/0x230 net/socket.c:1421
 __fput+0x234/0x970 fs/file_table.c:384
 task_work_run+0x1ce/0x250 kernel/task_work.c:239
 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
 exit_to_user_mode_loop+0xe6/0x110 kernel/entry/common.c:177
 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:210
 __syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline]
 syscall_exit_to_user_mode+0x1a/0x50 kernel/entry/common.c:302
 do_syscall_64+0x61/0xb0 arch/x86/entry/common.c:87
 entry_SYSCALL_64_after_hwframe+0x68/0xd2

Second to last potentially related work creation:
 kasan_save_stack+0x3e/0x60 mm/kasan/common.c:45
 __kasan_record_aux_stack+0xaf/0xc0 mm/kasan/generic.c:492
 __call_rcu_common kernel/rcu/tree.c:2713 [inline]
 call_rcu+0x14f/0x920 kernel/rcu/tree.c:2829
 netlink_release+0x16d8/0x1ad0 net/netlink/af_netlink.c:812
 __sock_release net/socket.c:659 [inline]
 sock_close+0xbd/0x230 net/socket.c:1421
 __fput+0x234/0x970 fs/file_table.c:384
 task_work_run+0x1ce/0x250 kernel/task_work.c:239
 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
 exit_to_user_mode_loop+0xe6/0x110 kernel/entry/common.c:177
 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:210
 __syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline]
 syscall_exit_to_user_mode+0x1a/0x50 kernel/entry/common.c:302
 do_syscall_64+0x61/0xb0 arch/x86/entry/common.c:87
 entry_SYSCALL_64_after_hwframe+0x68/0xd2

The buggy address belongs to the object at ffff88807c65e000
 which belongs to the cache kmalloc-2k of size 2048
The buggy address is located 248 bytes to the right of
 allocated 1048-byte region [ffff88807c65e000, ffff88807c65e418)

The buggy address belongs to the physical page:
page:ffffea0001f19600 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7c658
head:ffffea0001f19600 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0
anon flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000840 ffff888017842000 0000000000000000 dead000000000001
raw: 0000000000000000 0000000000080008 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5771, tgid 5771 (syz-executor), ts 92244557503, free_ts 92224799698
 set_page_owner include/linux/page_owner.h:31 [inline]
 post_alloc_hook+0x1cd/0x210 mm/page_alloc.c:1554
 prep_new_page mm/page_alloc.c:1561 [inline]
 get_page_from_freelist+0x195c/0x19f0 mm/page_alloc.c:3191
 __alloc_pages+0x1e3/0x460 mm/page_alloc.c:4457
 alloc_slab_page+0x5d/0x170 mm/slub.c:1876
 allocate_slab mm/slub.c:2023 [inline]
 new_slab+0x87/0x2e0 mm/slub.c:2076
 ___slab_alloc+0xc6d/0x12f0 mm/slub.c:3230
 __slab_alloc mm/slub.c:3329 [inline]
 __slab_alloc_node mm/slub.c:3382 [inline]
 slab_alloc_node mm/slub.c:3475 [inline]
 __kmem_cache_alloc_node+0x1a2/0x260 mm/slub.c:3524
 __do_kmalloc_node mm/slab_common.c:1006 [inline]
 __kmalloc+0xa4/0x240 mm/slab_common.c:1020
 kmalloc include/linux/slab.h:604 [inline]
 kzalloc include/linux/slab.h:721 [inline]
 rfkill_alloc+0xb1/0x2d0 net/rfkill/core.c:1006
 wiphy_new_nm+0x107b/0x1990 net/wireless/core.c:561
 ieee80211_alloc_hw_nm+0x3c8/0x1ee0 net/mac80211/main.c:697
 mac80211_hwsim_new_radio+0x1e0/0x4cf0 drivers/net/wireless/virtual/mac80211_hwsim.c:4969
 hwsim_new_radio_nl+0xd78/0x19d0 drivers/net/wireless/virtual/mac80211_hwsim.c:5983
 genl_family_rcv_msg_doit+0x209/0x2f0 net/netlink/genetlink.c:971
 genl_family_rcv_msg net/netlink/genetlink.c:1051 [inline]
 genl_rcv_msg+0x60b/0x790 net/netlink/genetlink.c:1066
 netlink_rcv_skb+0x216/0x480 net/netlink/af_netlink.c:2537
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1154 [inline]
 free_unref_page_prepare+0x7ce/0x8e0 mm/page_alloc.c:2336
 free_unref_page+0x32/0x2e0 mm/page_alloc.c:2429
 discard_slab mm/slub.c:2122 [inline]
 __unfreeze_partials+0x1cf/0x210 mm/slub.c:2662
 put_cpu_partial+0x17c/0x250 mm/slub.c:2738
 __slab_free+0x31d/0x410 mm/slub.c:3686
 qlink_free mm/kasan/quarantine.c:166 [inline]
 qlist_free_all+0x75/0xe0 mm/kasan/quarantine.c:185
 kasan_quarantine_reduce+0x143/0x160 mm/kasan/quarantine.c:292
 __kasan_slab_alloc+0x22/0x80 mm/kasan/common.c:305
 kasan_slab_alloc include/linux/kasan.h:188 [inline]
 slab_post_alloc_hook+0x6e/0x4d0 mm/slab.h:767
 slab_alloc_node mm/slub.c:3485 [inline]
 kmem_cache_alloc_node+0x150/0x330 mm/slub.c:3530
 __alloc_skb+0x108/0x2c0 net/core/skbuff.c:640
 alloc_skb include/linux/skbuff.h:1284 [inline]
 nlmsg_new include/net/netlink.h:999 [inline]
 netlink_ack+0x376/0x1110 net/netlink/af_netlink.c:2474
 netlink_rcv_skb+0x29a/0x480 net/netlink/af_netlink.c:2543
 genl_rcv+0x28/0x40 net/netlink/genetlink.c:1075
 netlink_unicast_kernel net/netlink/af_netlink.c:1323 [inline]
 netlink_unicast+0x750/0x8c0 net/netlink/af_netlink.c:1349
 netlink_sendmsg+0x8c1/0xbe0 net/netlink/af_netlink.c:1891

Memory state around the buggy address:
 ffff88807c65e400: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88807c65e480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88807c65e500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
                         ^
 ffff88807c65e580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88807c65e600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/06/17 00:08 linux-6.6.y c2603c511feb d1716036 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan KASAN: slab-out-of-bounds Read in bt_accept_unlink
* Struck through repros no longer work on HEAD.