Bluetooth: hci0: hardware error 0x00 ================================================================== BUG: KASAN: use-after-free in __list_del_entry_valid+0xf2/0x110 lib/list_debug.c:59 Read of size 8 at addr ffff888050cb0868 by task kworker/u19:1/26933 CPU: 2 PID: 26933 Comm: kworker/u19:1 Not tainted 6.0.0-rc6-syzkaller-00030-g06f7db949993 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 Workqueue: hci0 hci_error_reset Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:317 [inline] print_report.cold+0x2ba/0x719 mm/kasan/report.c:433 kasan_report+0xb1/0x1e0 mm/kasan/report.c:495 __list_del_entry_valid+0xf2/0x110 lib/list_debug.c:59 __list_del_entry include/linux/list.h:134 [inline] list_del include/linux/list.h:148 [inline] klist_release+0x66/0x480 lib/klist.c:189 kref_put include/linux/kref.h:65 [inline] klist_dec_and_del lib/klist.c:206 [inline] klist_put+0x151/0x1d0 lib/klist.c:217 device_del+0x243/0xc80 drivers/base/core.c:3683 hci_conn_del_sysfs+0xdc/0x180 net/bluetooth/hci_sysfs.c:78 hci_conn_cleanup+0x315/0x7b0 net/bluetooth/hci_conn.c:147 hci_conn_del+0x29b/0x790 net/bluetooth/hci_conn.c:1022 hci_conn_hash_flush+0x197/0x260 net/bluetooth/hci_conn.c:2367 hci_dev_close_sync+0x55d/0x1130 net/bluetooth/hci_sync.c:4476 hci_dev_do_close+0x2d/0x70 net/bluetooth/hci_core.c:554 hci_error_reset+0x96/0x130 net/bluetooth/hci_core.c:1050 process_one_work+0x991/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e4/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Allocated by task 3706: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:437 [inline] ____kasan_kmalloc mm/kasan/common.c:516 [inline] ____kasan_kmalloc mm/kasan/common.c:475 [inline] __kasan_kmalloc+0xa9/0xd0 mm/kasan/common.c:525 kmalloc_array_node include/linux/slab.h:695 [inline] kcalloc_node include/linux/slab.h:700 [inline] memcg_alloc_slab_cgroups+0x8b/0x140 mm/memcontrol.c:2830 account_slab mm/slab.h:630 [inline] allocate_slab+0x2db/0x3d0 mm/slub.c:1985 new_slab mm/slub.c:2029 [inline] ___slab_alloc+0x7f1/0xe10 mm/slub.c:3031 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3118 slab_alloc_node mm/slub.c:3209 [inline] slab_alloc mm/slub.c:3251 [inline] __kmem_cache_alloc_lru mm/slub.c:3258 [inline] kmem_cache_alloc+0x38c/0x3b0 mm/slub.c:3268 anon_vma_chain_alloc mm/rmap.c:141 [inline] anon_vma_clone+0xe0/0x600 mm/rmap.c:287 anon_vma_fork+0x82/0x640 mm/rmap.c:350 dup_mmap kernel/fork.c:658 [inline] dup_mm+0xa52/0x13a0 kernel/fork.c:1525 copy_mm kernel/fork.c:1577 [inline] copy_process+0x3ca6/0x7090 kernel/fork.c:2254 kernel_clone+0xe7/0xab0 kernel/fork.c:2671 __do_compat_sys_ia32_clone+0x9e/0xd0 arch/x86/kernel/sys_ia32.c:254 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 The buggy address belongs to the object at ffff888050cb0800 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 104 bytes inside of 512-byte region [ffff888050cb0800, ffff888050cb0a00) The buggy address belongs to the physical page: page:ffffea0001432c00 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888050cb3800 pfn:0x50cb0 head:ffffea0001432c00 order:2 compound_mapcount:0 compound_pincount:0 flags: 0x4fff00000010200(slab|head|node=1|zone=1|lastcpupid=0x7ff) raw: 04fff00000010200 ffffea00012c9d08 ffffea0001d1cf08 ffff888011842c80 raw: ffff888050cb3800 0000000000100007 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0xd2a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 3712, tgid 3712 (kworker/u19:2), ts 228689053543, free_ts 228647329541 prep_new_page mm/page_alloc.c:2532 [inline] get_page_from_freelist+0x109b/0x2ce0 mm/page_alloc.c:4283 __alloc_pages+0x1c7/0x510 mm/page_alloc.c:5515 alloc_pages+0x1a6/0x270 mm/mempolicy.c:2270 alloc_slab_page mm/slub.c:1824 [inline] allocate_slab+0x27e/0x3d0 mm/slub.c:1969 new_slab mm/slub.c:2029 [inline] ___slab_alloc+0x7f1/0xe10 mm/slub.c:3031 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3118 slab_alloc_node mm/slub.c:3209 [inline] __kmalloc_node_track_caller+0x2f2/0x380 mm/slub.c:4955 kmalloc_reserve net/core/skbuff.c:362 [inline] __alloc_skb+0xd9/0x2f0 net/core/skbuff.c:434 alloc_skb include/linux/skbuff.h:1257 [inline] bt_skb_alloc include/net/bluetooth/bluetooth.h:469 [inline] hci_prepare_cmd+0x2f/0x2a0 net/bluetooth/hci_request.c:219 hci_send_cmd+0x3c/0x160 net/bluetooth/hci_core.c:2979 hci_conn_request_evt+0x415/0x8a0 net/bluetooth/hci_event.c:3296 hci_event_func net/bluetooth/hci_event.c:7443 [inline] hci_event_packet+0x952/0xfd0 net/bluetooth/hci_event.c:7495 hci_rx_work+0xae7/0x1230 net/bluetooth/hci_core.c:4007 process_one_work+0x991/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e4/0x3a0 kernel/kthread.c:376 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1449 [inline] free_pcp_prepare+0x5e4/0xd20 mm/page_alloc.c:1499 free_unref_page_prepare mm/page_alloc.c:3380 [inline] free_unref_page+0x19/0x4d0 mm/page_alloc.c:3476 __stack_depot_save+0x168/0x500 lib/stackdepot.c:489 kasan_save_stack+0x2e/0x40 mm/kasan/common.c:39 kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:437 [inline] ____kasan_kmalloc mm/kasan/common.c:516 [inline] ____kasan_kmalloc mm/kasan/common.c:475 [inline] __kasan_kmalloc+0xa9/0xd0 mm/kasan/common.c:525 kmalloc include/linux/slab.h:600 [inline] __hw_addr_create net/core/dev_addr_lists.c:60 [inline] __hw_addr_add_ex+0x22d/0x7e0 net/core/dev_addr_lists.c:118 __dev_mc_add net/core/dev_addr_lists.c:867 [inline] dev_mc_add+0xbd/0x110 net/core/dev_addr_lists.c:885 igmp6_group_added+0x4f0/0x5b0 net/ipv6/mcast.c:680 __ipv6_dev_mc_inc+0x847/0xec0 net/ipv6/mcast.c:949 ipv6_add_dev+0xb6e/0x1390 net/ipv6/addrconf.c:465 addrconf_notify+0x6f9/0x1c10 net/ipv6/addrconf.c:3528 notifier_call_chain+0xb5/0x200 kernel/notifier.c:87 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:1945 call_netdevice_notifiers_extack net/core/dev.c:1983 [inline] call_netdevice_notifiers net/core/dev.c:1997 [inline] register_netdevice+0x1127/0x1680 net/core/dev.c:10103 __ip_tunnel_create+0x398/0x570 net/ipv4/ip_tunnel.c:267 ip_tunnel_init_net+0x2e8/0x9f0 net/ipv4/ip_tunnel.c:1073 Memory state around the buggy address: ffff888050cb0700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888050cb0780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888050cb0800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888050cb0880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888050cb0900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================