syzbot


KASAN: slab-use-after-free Read in skb_dequeue

Status: moderation: reported on 2025/06/07 00:10
Subsystems: bluetooth
[Documentation on labels]
Reported-by: syzbot+8a25818899ba4e66ede2@syzkaller.appspotmail.com
First crash: 32d, last: 32d
Similar bugs (4)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-54 KASAN: use-after-free Read in skb_dequeue syz 1 1418d 1418d 0/2 auto-obsoleted due to no activity on 2023/04/23 02:47
upstream general protection fault in skb_dequeue (3) wireless C done 6 875d 884d 22/29 fixed on 2023/06/08 14:41
upstream general protection fault in skb_dequeue (2) bluetooth C inconclusive done 9 1363d 1448d 0/29 auto-closed as invalid on 2022/10/03 17:36
linux-4.19 KASAN: use-after-free Read in skb_dequeue (2) C done 2 1388d 1418d 1/1 fixed on 2021/10/15 14:38

Sample crash report:
==================================================================
BUG: KASAN: slab-use-after-free in __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
BUG: KASAN: slab-use-after-free in _raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:162
Read of size 1 at addr ffff888106250918 by task kworker/u33:6/5952

CPU: 2 UID: 0 PID: 5952 Comm: kworker/u33:6 Not tainted 6.15.0-syzkaller-10954-gd00a83477e7a #0 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
Workqueue: hci1 hci_rx_work
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:94 [inline]
 dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120
 print_address_description mm/kasan/report.c:408 [inline]
 print_report+0xcd/0x680 mm/kasan/report.c:521
 kasan_report+0xe0/0x110 mm/kasan/report.c:634
 __kasan_check_byte+0x36/0x50 mm/kasan/common.c:557
 kasan_check_byte include/linux/kasan.h:399 [inline]
 lock_acquire kernel/locking/lockdep.c:5845 [inline]
 lock_acquire+0xfc/0x350 kernel/locking/lockdep.c:5828
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
 _raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:162
 skb_dequeue+0x20/0x180 net/core/skbuff.c:3895
 hci_conn_tx_dequeue+0xe7/0x1e0 net/bluetooth/hci_conn.c:3024
 hci_num_comp_pkts_evt+0x337/0xd10 net/bluetooth/hci_event.c:4441
 hci_event_func net/bluetooth/hci_event.c:7511 [inline]
 hci_event_packet+0xa10/0x11c0 net/bluetooth/hci_event.c:7565
 hci_rx_work+0x2c5/0x16b0 net/bluetooth/hci_core.c:4036
 process_one_work+0x9cf/0x1b70 kernel/workqueue.c:3238
 process_scheduled_works kernel/workqueue.c:3321 [inline]
 worker_thread+0x6c8/0xf10 kernel/workqueue.c:3402
 kthread+0x3c5/0x780 kernel/kthread.c:464
 ret_from_fork+0x5d7/0x6f0 arch/x86/kernel/process.c:148
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
 </TASK>

Allocated by task 5298:
 kasan_save_stack+0x33/0x60 mm/kasan/common.c:47
 kasan_save_track+0x14/0x30 mm/kasan/common.c:68
 poison_kmalloc_redzone mm/kasan/common.c:377 [inline]
 __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:394
 kmalloc_noprof include/linux/slab.h:905 [inline]
 kzalloc_noprof include/linux/slab.h:1039 [inline]
 __hci_conn_add+0x130/0x1b70 net/bluetooth/hci_conn.c:939
 hci_conn_add_unset+0x6d/0x100 net/bluetooth/hci_conn.c:1051
 le_conn_complete_evt+0x791/0x1d70 net/bluetooth/hci_event.c:5665
 hci_le_conn_complete_evt+0x23c/0x370 net/bluetooth/hci_event.c:5817
 hci_le_meta_evt+0x354/0x5e0 net/bluetooth/hci_event.c:7200
 hci_event_func net/bluetooth/hci_event.c:7508 [inline]
 hci_event_packet+0x685/0x11c0 net/bluetooth/hci_event.c:7565
 hci_rx_work+0x2c5/0x16b0 net/bluetooth/hci_core.c:4036
 process_one_work+0x9cf/0x1b70 kernel/workqueue.c:3238
 process_scheduled_works kernel/workqueue.c:3321 [inline]
 worker_thread+0x6c8/0xf10 kernel/workqueue.c:3402
 kthread+0x3c5/0x780 kernel/kthread.c:464
 ret_from_fork+0x5d7/0x6f0 arch/x86/kernel/process.c:148
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245

Freed by task 7641:
 kasan_save_stack+0x33/0x60 mm/kasan/common.c:47
 kasan_save_track+0x14/0x30 mm/kasan/common.c:68
 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:576
 poison_slab_object mm/kasan/common.c:247 [inline]
 __kasan_slab_free+0x51/0x70 mm/kasan/common.c:264
 kasan_slab_free include/linux/kasan.h:233 [inline]
 slab_free_hook mm/slub.c:2380 [inline]
 slab_free mm/slub.c:4642 [inline]
 kfree+0x2b4/0x4d0 mm/slub.c:4841
 device_release+0xa4/0x240 drivers/base/core.c:2568
 kobject_cleanup lib/kobject.c:689 [inline]
 kobject_release lib/kobject.c:720 [inline]
 kref_put include/linux/kref.h:65 [inline]
 kobject_put+0x1e7/0x5a0 lib/kobject.c:737
 put_device+0x1f/0x30 drivers/base/core.c:3800
 hci_conn_put include/net/bluetooth/hci_core.h:1618 [inline]
 hci_disconnect_all_sync.constprop.0+0x10c/0x3c0 net/bluetooth/hci_sync.c:5644
 hci_suspend_sync+0x770/0xab0 net/bluetooth/hci_sync.c:6120
 hci_suspend_dev+0x308/0x500 net/bluetooth/hci_core.c:2812
 hci_suspend_notifier+0x28d/0x2f0 net/bluetooth/hci_core.c:2392
 notifier_call_chain+0xbc/0x410 kernel/notifier.c:85
 notifier_call_chain_robust kernel/notifier.c:120 [inline]
 blocking_notifier_call_chain_robust kernel/notifier.c:345 [inline]
 blocking_notifier_call_chain_robust+0xc8/0x160 kernel/notifier.c:333
 pm_notifier_call_chain_robust+0x27/0x60 kernel/power/main.c:102
 snapshot_open+0x189/0x2b0 kernel/power/user.c:77
 misc_open+0x35d/0x420 drivers/char/misc.c:179
 chrdev_open+0x231/0x6a0 fs/char_dev.c:414
 do_dentry_open+0x741/0x1c10 fs/open.c:964
 vfs_open+0x82/0x3f0 fs/open.c:1094
 do_open fs/namei.c:3887 [inline]
 path_openat+0x1de4/0x2cb0 fs/namei.c:4046
 do_filp_open+0x20b/0x470 fs/namei.c:4073
 do_sys_openat2+0x11b/0x1d0 fs/open.c:1437
 do_sys_open fs/open.c:1452 [inline]
 __do_sys_openat fs/open.c:1468 [inline]
 __se_sys_openat fs/open.c:1463 [inline]
 __x64_sys_openat+0x174/0x210 fs/open.c:1463
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xcd/0x4c0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

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

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106250
head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0x57ff00000000040(head|node=1|zone=2|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 057ff00000000040 ffff88801b843180 ffffea0000a63e00 dead000000000002
raw: 0000000000000000 0000000000020002 00000000f5000000 0000000000000000
head: 057ff00000000040 ffff88801b843180 ffffea0000a63e00 dead000000000002
head: 0000000000000000 0000000000020002 00000000f5000000 0000000000000000
head: 057ff00000000003 ffffea0004189401 00000000ffffffff 00000000ffffffff
head: ffffffffffffffff 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 1, tgid 1 (swapper/0), ts 8313732893, free_ts 0
 set_page_owner include/linux/page_owner.h:32 [inline]
 post_alloc_hook+0x1c0/0x230 mm/page_alloc.c:1704
 prep_new_page mm/page_alloc.c:1712 [inline]
 get_page_from_freelist+0x1321/0x3890 mm/page_alloc.c:3669
 __alloc_frozen_pages_noprof+0x261/0x23f0 mm/page_alloc.c:4959
 alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2419
 alloc_slab_page mm/slub.c:2450 [inline]
 allocate_slab mm/slub.c:2618 [inline]
 new_slab+0x23b/0x330 mm/slub.c:2672
 ___slab_alloc+0xd9c/0x1940 mm/slub.c:3858
 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3948
 __slab_alloc_node mm/slub.c:4023 [inline]
 slab_alloc_node mm/slub.c:4184 [inline]
 __do_kmalloc_node mm/slub.c:4326 [inline]
 __kmalloc_noprof+0x2f2/0x510 mm/slub.c:4339
 kmalloc_noprof include/linux/slab.h:909 [inline]
 kmalloc_array_noprof include/linux/slab.h:948 [inline]
 fb_show_logo_line drivers/video/fbdev/core/fb_logo.c:313 [inline]
 fb_show_logo+0x1133/0x23e0 drivers/video/fbdev/core/fb_logo.c:502
 fbcon_switch+0xfc4/0x14c0 drivers/video/fbdev/core/fbcon.c:2201
 redraw_screen+0x2c1/0x760 drivers/tty/vt/vt.c:957
 con2fb_init_display drivers/video/fbdev/core/fbcon.c:828 [inline]
 set_con2fb_map+0x79b/0x1060 drivers/video/fbdev/core/fbcon.c:889
 do_fb_registered drivers/video/fbdev/core/fbcon.c:2998 [inline]
 fbcon_fb_registered+0x21d/0x6a0 drivers/video/fbdev/core/fbcon.c:3014
 do_register_framebuffer+0x470/0x7c0 drivers/video/fbdev/core/fbmem.c:455
 register_framebuffer+0x23/0x40 drivers/video/fbdev/core/fbmem.c:521
 __drm_fb_helper_initial_config_and_unlock+0xdb7/0x17b0 drivers/gpu/drm/drm_fb_helper.c:1851
page_owner free stack trace missing

Memory state around the buggy address:
 ffff888106250800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888106250880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888106250900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                            ^
 ffff888106250980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888106250a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/06/03 00:01 upstream d00a83477e7a a30356b7 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream KASAN: slab-use-after-free Read in skb_dequeue
* Struck through repros no longer work on HEAD.