================================================================== BUG: KASAN: slab-use-after-free in __list_del_entry_valid_or_report+0x14c/0x1c0 lib/list_debug.c:49 Read of size 8 at addr ffff8880217feb08 by task syz.3.792/8202 CPU: 0 UID: 0 PID: 8202 Comm: syz.3.792 Not tainted 6.11.0-rc7-syzkaller-00149-g0babf683783d #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:93 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:119 print_address_description mm/kasan/report.c:377 [inline] print_report+0xc3/0x620 mm/kasan/report.c:488 kasan_report+0xd9/0x110 mm/kasan/report.c:601 __list_del_entry_valid_or_report+0x14c/0x1c0 lib/list_debug.c:49 __list_del_entry_valid include/linux/list.h:124 [inline] __list_del_entry include/linux/list.h:215 [inline] list_del include/linux/list.h:229 [inline] mgmt_pending_remove+0x1e/0x160 net/bluetooth/mgmt_util.c:314 cmd_status_rsp net/bluetooth/mgmt.c:1451 [inline] cmd_complete_rsp+0x119/0x160 net/bluetooth/mgmt.c:1465 mgmt_pending_foreach+0xdf/0x140 net/bluetooth/mgmt_util.c:259 mgmt_index_removed+0x11f/0x2e0 net/bluetooth/mgmt.c:9402 hci_sock_bind+0xc73/0x1830 net/bluetooth/hci_sock.c:1307 __sys_bind_socket net/socket.c:1833 [inline] __sys_bind_socket net/socket.c:1825 [inline] __sys_bind+0x1eb/0x220 net/socket.c:1857 __do_sys_bind net/socket.c:1865 [inline] __se_sys_bind net/socket.c:1863 [inline] __ia32_sys_bind+0x71/0xb0 net/socket.c:1863 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x73/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e RIP: 0023:0xf7f92579 Code: b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00 RSP: 002b:00000000f56f556c EFLAGS: 00000296 ORIG_RAX: 0000000000000169 RAX: ffffffffffffffda RBX: 0000000000000008 RCX: 0000000020000040 RDX: 0000000000000006 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000296 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 8204: 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:370 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:387 kmalloc_noprof include/linux/slab.h:681 [inline] kzalloc_noprof include/linux/slab.h:807 [inline] mgmt_pending_new+0x5b/0x290 net/bluetooth/mgmt_util.c:269 mgmt_pending_add+0x36/0x160 net/bluetooth/mgmt_util.c:296 remove_adv_monitor+0x124/0x1b0 net/bluetooth/mgmt.c:5493 hci_mgmt_cmd net/bluetooth/hci_sock.c:1712 [inline] hci_sock_sendmsg+0x1528/0x25e0 net/bluetooth/hci_sock.c:1832 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg net/socket.c:745 [inline] sock_write_iter+0x50a/0x5c0 net/socket.c:1160 new_sync_write fs/read_write.c:497 [inline] vfs_write+0x6b6/0x1140 fs/read_write.c:590 ksys_write+0x1f8/0x260 fs/read_write.c:643 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x73/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e Freed by task 67: 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:579 poison_slab_object+0xf7/0x160 mm/kasan/common.c:240 __kasan_slab_free+0x32/0x50 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2256 [inline] slab_free mm/slub.c:4477 [inline] kfree+0x12a/0x3b0 mm/slub.c:4598 mgmt_remove_adv_monitor_complete+0x1b7/0x2e0 net/bluetooth/mgmt.c:5458 hci_cmd_sync_work+0x1f9/0x410 net/bluetooth/hci_sync.c:330 process_one_work+0x958/0x1ad0 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x6c8/0xf00 kernel/workqueue.c:3393 kthread+0x2c1/0x3a0 kernel/kthread.c:389 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 The buggy address belongs to the object at ffff8880217feb00 which belongs to the cache kmalloc-96 of size 96 The buggy address is located 8 bytes inside of freed 96-byte region [ffff8880217feb00, ffff8880217feb60) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x217fe flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: 0xfdffffff(slab) raw: 00fff00000000000 ffff88801ac42280 ffffea0000a54d40 dead000000000004 raw: 0000000000000000 0000000000200020 00000001fdffffff 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 0x152820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL), pid 34, tgid 34 (ksoftirqd/3), ts 53439982140, free_ts 53081067267 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1500 prep_new_page mm/page_alloc.c:1508 [inline] get_page_from_freelist+0x1351/0x2e50 mm/page_alloc.c:3446 __alloc_pages_noprof+0x22b/0x2460 mm/page_alloc.c:4702 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline] alloc_pages_node_noprof include/linux/gfp.h:296 [inline] alloc_slab_page+0x4e/0xf0 mm/slub.c:2325 allocate_slab mm/slub.c:2488 [inline] new_slab+0x84/0x260 mm/slub.c:2541 ___slab_alloc+0xdac/0x1870 mm/slub.c:3727 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3817 __slab_alloc_node mm/slub.c:3870 [inline] slab_alloc_node mm/slub.c:4029 [inline] __do_kmalloc_node mm/slub.c:4161 [inline] __kmalloc_noprof+0x379/0x410 mm/slub.c:4174 kmalloc_noprof include/linux/slab.h:685 [inline] kzalloc_noprof include/linux/slab.h:807 [inline] cfg80211_inform_single_bss_data+0x59b/0x1e20 net/wireless/scan.c:2307 cfg80211_inform_bss_data+0x254/0x3b50 net/wireless/scan.c:3159 cfg80211_inform_bss_frame_data+0x253/0x8a0 net/wireless/scan.c:3254 ieee80211_bss_info_update+0x311/0xab0 net/mac80211/scan.c:226 ieee80211_scan_rx+0x474/0xac0 net/mac80211/scan.c:340 __ieee80211_rx_handle_packet net/mac80211/rx.c:5225 [inline] ieee80211_rx_list+0x1bb8/0x2ec0 net/mac80211/rx.c:5462 ieee80211_rx_napi+0xdd/0x400 net/mac80211/rx.c:5485 ieee80211_rx include/net/mac80211.h:5124 [inline] ieee80211_handle_queued_frames+0xd5/0x130 net/mac80211/main.c:439 page last free pid 5421 tgid 5421 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1101 [inline] free_unref_page+0x64a/0xe40 mm/page_alloc.c:2619 vfree+0x181/0x7a0 mm/vmalloc.c:3367 kvfree+0x33/0x50 mm/util.c:694 kvm_destroy_vm virt/kvm/kvm_main.c:1361 [inline] kvm_put_kvm+0x8f7/0xb70 virt/kvm/kvm_main.c:1386 kvm_vm_release+0x42/0x60 virt/kvm/kvm_main.c:1409 __fput+0x408/0xbb0 fs/file_table.c:422 task_work_run+0x14e/0x250 kernel/task_work.c:228 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] exit_to_user_mode_loop kernel/entry/common.c:114 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0x27b/0x2a0 kernel/entry/common.c:218 __do_fast_syscall_32+0x80/0x120 arch/x86/entry/common.c:389 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e Memory state around the buggy address: ffff8880217fea00: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc ffff8880217fea80: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc >ffff8880217feb00: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ^ ffff8880217feb80: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ffff8880217fec00: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc ================================================================== ---------------- Code disassembly (best guess), 2 bytes skipped: 0: 10 06 adc %al,(%rsi) 2: 03 74 b4 01 add 0x1(%rsp,%rsi,4),%esi 6: 10 07 adc %al,(%rdi) 8: 03 74 b0 01 add 0x1(%rax,%rsi,4),%esi c: 10 08 adc %cl,(%rax) e: 03 74 d8 01 add 0x1(%rax,%rbx,8),%esi 1e: 00 51 52 add %dl,0x52(%rcx) 21: 55 push %rbp 22: 89 e5 mov %esp,%ebp 24: 0f 34 sysenter 26: cd 80 int $0x80 * 28: 5d pop %rbp <-- trapping instruction 29: 5a pop %rdx 2a: 59 pop %rcx 2b: c3 ret 2c: 90 nop 2d: 90 nop 2e: 90 nop 2f: 90 nop 30: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi 37: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi