================================================================== BUG: KASAN: slab-use-after-free in __list_del_entry_valid_or_report+0x1d4/0x200 lib/list_debug.c:62 Read of size 8 at addr ffff88804db99550 by task syz.6.989/9502 CPU: 3 UID: 255 PID: 9502 Comm: syz.6.989 Not tainted 6.14.0-rc4-syzkaller-00212-g276f98efb64a #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:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:408 [inline] print_report+0xc3/0x670 mm/kasan/report.c:521 kasan_report+0xd9/0x110 mm/kasan/report.c:634 __list_del_entry_valid_or_report+0x1d4/0x200 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+0x34/0x2e0 net/bluetooth/af_bluetooth.c:256 l2cap_sock_teardown_cb+0x1a3/0x3c0 net/bluetooth/l2cap_sock.c:1600 l2cap_chan_del+0xba/0x8f0 net/bluetooth/l2cap_core.c:655 l2cap_conn_del+0x37f/0x730 net/bluetooth/l2cap_core.c:1786 hci_disconn_cfm include/net/bluetooth/hci_core.h:2069 [inline] hci_conn_hash_flush+0x44a/0x790 net/bluetooth/hci_conn.c:2698 hci_dev_close_sync+0x603/0x11a0 net/bluetooth/hci_sync.c:5197 hci_dev_do_close+0x2e/0x90 net/bluetooth/hci_core.c:482 hci_unregister_dev+0x213/0x620 net/bluetooth/hci_core.c:2677 vhci_release+0x79/0xf0 drivers/bluetooth/hci_vhci.c:664 __fput+0x3ff/0xb70 fs/file_table.c:464 task_work_run+0x14e/0x250 kernel/task_work.c:227 exit_task_work include/linux/task_work.h:40 [inline] do_exit+0xad8/0x2d70 kernel/exit.c:938 do_group_exit+0xd3/0x2a0 kernel/exit.c:1087 get_signal+0x24ed/0x26c0 kernel/signal.c:3036 arch_do_signal_or_restart+0x90/0x7e0 arch/x86/kernel/signal.c:337 exit_to_user_mode_loop kernel/entry/common.c:111 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:329 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0x150/0x2a0 kernel/entry/common.c:218 do_syscall_64+0xda/0x250 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f664a9bfa25 Code: Unable to access opcode bytes at 0x7f664a9bf9fb. RSP: 002b:00007f664b7e8ea0 EFLAGS: 00000293 ORIG_RAX: 00000000000000e6 RAX: fffffffffffffdfc RBX: 0000000000000058 RCX: 00007f664a9bfa25 RDX: 00007f664b7e8ee0 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 00007f664aa0e2a0 R08: 0000000000000000 R09: 0000000000000058 R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f664aba5fa0 R15: 00007ffeb1b9ff08 Allocated by task 9387: 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:901 [inline] kzalloc_noprof include/linux/slab.h:1037 [inline] copy_verifier_state kernel/bpf/verifier.c:1667 [inline] copy_verifier_state+0xad7/0xe70 kernel/bpf/verifier.c:1635 push_stack+0x1d9/0x550 kernel/bpf/verifier.c:1935 check_cond_jmp_op+0xb56/0x7a80 kernel/bpf/verifier.c:16101 do_check kernel/bpf/verifier.c:19252 [inline] do_check_common+0x7c17/0xb960 kernel/bpf/verifier.c:22273 do_check_main kernel/bpf/verifier.c:22364 [inline] bpf_check+0x775c/0xabe0 kernel/bpf/verifier.c:23160 bpf_prog_load+0xe3c/0x2480 kernel/bpf/syscall.c:2952 __sys_bpf+0x4043/0x49c0 kernel/bpf/syscall.c:5795 __do_sys_bpf kernel/bpf/syscall.c:5902 [inline] __se_sys_bpf kernel/bpf/syscall.c:5900 [inline] __x64_sys_bpf+0x78/0xc0 kernel/bpf/syscall.c:5900 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 9387: 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:2353 [inline] slab_free mm/slub.c:4609 [inline] kfree+0x2c4/0x4d0 mm/slub.c:4757 free_func_state kernel/bpf/verifier.c:1608 [inline] free_func_state kernel/bpf/verifier.c:1603 [inline] free_verifier_state+0xa3/0x1c0 kernel/bpf/verifier.c:1617 pop_stack+0x1d8/0x300 kernel/bpf/verifier.c:1910 do_check kernel/bpf/verifier.c:19241 [inline] do_check_common+0x79a6/0xb960 kernel/bpf/verifier.c:22273 do_check_main kernel/bpf/verifier.c:22364 [inline] bpf_check+0x775c/0xabe0 kernel/bpf/verifier.c:23160 bpf_prog_load+0xe3c/0x2480 kernel/bpf/syscall.c:2952 __sys_bpf+0x4043/0x49c0 kernel/bpf/syscall.c:5795 __do_sys_bpf kernel/bpf/syscall.c:5902 [inline] __se_sys_bpf kernel/bpf/syscall.c:5900 [inline] __x64_sys_bpf+0x78/0xc0 kernel/bpf/syscall.c:5900 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88804db99000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 1360 bytes inside of freed 2048-byte region [ffff88804db99000, ffff88804db99800) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff88804db9a000 pfn:0x4db98 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000240(workingset|head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000240 ffff88801b042f00 ffffea0001357210 ffffea0000c66c10 raw: ffff88804db9a000 0000000000080002 00000000f5000000 0000000000000000 head: 00fff00000000240 ffff88801b042f00 ffffea0001357210 ffffea0000c66c10 head: ffff88804db9a000 0000000000080002 00000000f5000000 0000000000000000 head: 00fff00000000003 ffffea000136e601 ffffffffffffffff 0000000000000000 head: 0000000000000008 0000000000000000 00000000ffffffff 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 5938, tgid 5938 (syz-executor), ts 44431703672, free_ts 0 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x181/0x1b0 mm/page_alloc.c:1551 prep_new_page mm/page_alloc.c:1559 [inline] get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3477 __alloc_frozen_pages_noprof+0x221/0x2470 mm/page_alloc.c:4739 alloc_pages_mpol+0x1fc/0x540 mm/mempolicy.c:2270 alloc_slab_page mm/slub.c:2423 [inline] allocate_slab mm/slub.c:2587 [inline] new_slab+0x23d/0x330 mm/slub.c:2640 ___slab_alloc+0xc5d/0x1720 mm/slub.c:3826 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3916 __slab_alloc_node mm/slub.c:3991 [inline] slab_alloc_node mm/slub.c:4152 [inline] __do_kmalloc_node mm/slub.c:4293 [inline] __kmalloc_node_noprof+0x2f0/0x510 mm/slub.c:4300 kmalloc_node_noprof include/linux/slab.h:928 [inline] qdisc_alloc+0xbb/0xc50 net/sched/sch_generic.c:947 qdisc_create_dflt+0x73/0x430 net/sched/sch_generic.c:1009 attach_one_default_qdisc net/sched/sch_generic.c:1175 [inline] netdev_for_each_tx_queue include/linux/netdevice.h:2590 [inline] attach_default_qdiscs net/sched/sch_generic.c:1193 [inline] dev_activate+0x63a/0x12b0 net/sched/sch_generic.c:1252 __dev_open+0x3e4/0x540 net/core/dev.c:1644 __dev_change_flags+0x561/0x720 net/core/dev.c:9254 dev_change_flags+0x8f/0x160 net/core/dev.c:9326 do_setlink.constprop.0+0x699/0x3f80 net/core/rtnetlink.c:3118 rtnl_changelink net/core/rtnetlink.c:3733 [inline] __rtnl_newlink net/core/rtnetlink.c:3885 [inline] rtnl_newlink+0x1306/0x1d60 net/core/rtnetlink.c:4022 page_owner free stack trace missing Memory state around the buggy address: ffff88804db99400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88804db99480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88804db99500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88804db99580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88804db99600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================