syzbot


KASAN: slab-use-after-free Read in l2cap_recv_acldata (2)

Status: moderation: reported on 2025/09/10 21:00
Subsystems: bluetooth
[Documentation on labels]
Reported-by: syzbot+d32d77220b92eddd89ad@syzkaller.appspotmail.com
First crash: 5d12h, last: 3d00h
Similar bugs (2)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: slab-use-after-free Read in l2cap_recv_acldata bluetooth 19 1 439d 435d 0/29 auto-obsoleted due to no activity on 2024/10/07 16:15
upstream BUG: sleeping function called from invalid context in hci_cmd_sync_submit bluetooth 19 C done done 3400 557d 801d 0/29 auto-obsoleted due to no activity on 2024/05/13 05:09

Sample crash report:
==================================================================
BUG: KASAN: slab-use-after-free in l2cap_recv_acldata+0x78/0x1210 net/bluetooth/l2cap_core.c:7520
Read of size 8 at addr ffff888060511198 by task kworker/u9:6/5851

CPU: 0 UID: 0 PID: 5851 Comm: kworker/u9:6 Not tainted syzkaller #0 PREEMPT_{RT,(full)} 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
Workqueue: hci1 hci_rx_work
Call Trace:
 <TASK>
 dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120
 print_address_description mm/kasan/report.c:378 [inline]
 print_report+0xca/0x240 mm/kasan/report.c:482
 kasan_report+0x118/0x150 mm/kasan/report.c:595
 l2cap_recv_acldata+0x78/0x1210 net/bluetooth/l2cap_core.c:7520
 hci_acldata_packet net/bluetooth/hci_core.c:3833 [inline]
 hci_rx_work+0x5bb/0xe80 net/bluetooth/hci_core.c:4076
 process_one_work kernel/workqueue.c:3236 [inline]
 process_scheduled_works+0xade/0x17b0 kernel/workqueue.c:3319
 worker_thread+0x8a0/0xda0 kernel/workqueue.c:3400
 kthread+0x70e/0x8a0 kernel/kthread.c:463
 ret_from_fork+0x3f9/0x770 arch/x86/kernel/process.c:148
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
 </TASK>

Allocated by task 10198:
 kasan_save_stack mm/kasan/common.c:47 [inline]
 kasan_save_track+0x3e/0x80 mm/kasan/common.c:68
 poison_kmalloc_redzone mm/kasan/common.c:388 [inline]
 __kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:405
 kasan_kmalloc include/linux/kasan.h:260 [inline]
 __kmalloc_cache_noprof+0x1a8/0x320 mm/slub.c:4407
 kmalloc_noprof include/linux/slab.h:905 [inline]
 kzalloc_noprof include/linux/slab.h:1039 [inline]
 __hci_conn_add+0x34c/0x1c10 net/bluetooth/hci_conn.c:949
 le_conn_complete_evt+0x3d6/0x1220 net/bluetooth/hci_event.c:5645
 hci_le_conn_complete_evt+0x187/0x450 net/bluetooth/hci_event.c:5797
 hci_event_func net/bluetooth/hci_event.c:7542 [inline]
 hci_event_packet+0x78f/0x1200 net/bluetooth/hci_event.c:7599
 hci_rx_work+0x46a/0xe80 net/bluetooth/hci_core.c:4071
 process_one_work kernel/workqueue.c:3236 [inline]
 process_scheduled_works+0xade/0x17b0 kernel/workqueue.c:3319
 worker_thread+0x8a0/0xda0 kernel/workqueue.c:3400
 kthread+0x70e/0x8a0 kernel/kthread.c:463
 ret_from_fork+0x3f9/0x770 arch/x86/kernel/process.c:148
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245

The buggy address belongs to the object at ffff888060510000
 which belongs to the cache kmalloc-8k of size 8192
The buggy address is located 4504 bytes inside of
 freed 8192-byte region [ffff888060510000, ffff888060512000)

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff888060514000 pfn:0x60510
head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0x80000000000240(workingset|head|node=0|zone=1)
page_type: f5(slab)
raw: 0080000000000240 ffff888019842280 ffffea0000d74410 ffffea0000c4cc10
raw: ffff888060514000 0000000000020001 00000000f5000000 0000000000000000
head: 0080000000000240 ffff888019842280 ffffea0000d74410 ffffea0000c4cc10
head: ffff888060514000 0000000000020001 00000000f5000000 0000000000000000
head: 0080000000000003 ffffea0001814401 00000000ffffffff 00000000ffffffff
head: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000008
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 11275, tgid 11272 (syz.3.886), ts 1197750807532, free_ts 1197280318099
 set_page_owner include/linux/page_owner.h:32 [inline]
 post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1851
 prep_new_page mm/page_alloc.c:1859 [inline]
 get_page_from_freelist+0x2119/0x21b0 mm/page_alloc.c:3858
 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5148
 alloc_pages_mpol+0xd1/0x380 mm/mempolicy.c:2416
 alloc_slab_page mm/slub.c:2492 [inline]
 allocate_slab+0x8a/0x370 mm/slub.c:2660
 new_slab mm/slub.c:2714 [inline]
 ___slab_alloc+0x8d1/0xdc0 mm/slub.c:3901
 __slab_alloc mm/slub.c:3992 [inline]
 __slab_alloc_node mm/slub.c:4067 [inline]
 slab_alloc_node mm/slub.c:4228 [inline]
 __kmalloc_cache_noprof+0xe6/0x320 mm/slub.c:4402
 kmalloc_noprof include/linux/slab.h:905 [inline]
 kzalloc_noprof include/linux/slab.h:1039 [inline]
 ceph_create_client+0x6f/0x2c0 net/ceph/ceph_common.c:717
 create_fs_client fs/ceph/super.c:829 [inline]
 ceph_get_tree+0x1cf/0x1820 fs/ceph/super.c:1321
 vfs_get_tree+0x8f/0x2b0 fs/super.c:1815
 vfs_cmd_create+0xa2/0x200 fs/fsopen.c:225
 __do_sys_fsconfig fs/fsopen.c:467 [inline]
 __se_sys_fsconfig+0x794/0x8e0 fs/fsopen.c:344
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
page last free pid 5826 tgid 5826 stack trace:
 reset_page_owner include/linux/page_owner.h:25 [inline]
 free_pages_prepare mm/page_alloc.c:1395 [inline]
 __free_frozen_pages+0xb59/0xce0 mm/page_alloc.c:2895
 discard_slab mm/slub.c:2758 [inline]
 __put_partials+0x159/0x1a0 mm/slub.c:3223
 __slab_free+0x2b3/0x390 mm/slub.c:4565
 qlink_free mm/kasan/quarantine.c:163 [inline]
 qlist_free_all+0x97/0x140 mm/kasan/quarantine.c:179
 kasan_quarantine_reduce+0x148/0x160 mm/kasan/quarantine.c:286
 __kasan_slab_alloc+0x22/0x80 mm/kasan/common.c:340
 kasan_slab_alloc include/linux/kasan.h:250 [inline]
 slab_post_alloc_hook mm/slub.c:4191 [inline]
 slab_alloc_node mm/slub.c:4240 [inline]
 kmem_cache_alloc_node_noprof+0x14e/0x330 mm/slub.c:4292
 __alloc_skb+0x112/0x2d0 net/core/skbuff.c:659
 alloc_skb_fclone include/linux/skbuff.h:1386 [inline]
 tcp_stream_alloc_skb+0x3d/0x340 net/ipv4/tcp.c:892
 tcp_sendmsg_locked+0xf3e/0x5620 net/ipv4/tcp.c:1198
 tcp_sendmsg+0x2f/0x50 net/ipv4/tcp.c:1393
 sock_sendmsg_nosec net/socket.c:714 [inline]
 __sock_sendmsg+0x19c/0x270 net/socket.c:729
 sock_write_iter+0x25e/0x330 net/socket.c:1179
 new_sync_write fs/read_write.c:593 [inline]
 vfs_write+0x5d2/0xb40 fs/read_write.c:686
 ksys_write+0x14b/0x260 fs/read_write.c:738
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94

Memory state around the buggy address:
 ffff888060511080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888060511100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888060511180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                            ^
 ffff888060511200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888060511280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/09/09 09:15 upstream f777d1112ee5 d291dd2d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root KASAN: slab-use-after-free Read in l2cap_recv_acldata
2025/09/06 20:58 upstream b236920731dd d291dd2d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root KASAN: slab-use-after-free Read in l2cap_recv_acldata
* Struck through repros no longer work on HEAD.