Bluetooth: hci0: hardware error 0x00 ================================================================== BUG: KASAN: use-after-free in instrument_atomic_read include/linux/instrumented.h:71 [inline] BUG: KASAN: use-after-free in atomic_long_read include/linux/atomic/atomic-instrumented.h:1265 [inline] BUG: KASAN: use-after-free in __mutex_unlock_slowpath+0xa6/0x5e0 kernel/locking/mutex.c:916 Read of size 8 at addr ffff888015f644b8 by task kworker/u5:0/47 CPU: 0 PID: 47 Comm: kworker/u5:0 Not tainted 5.19.0-rc7-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Workqueue: hci0 hci_error_reset Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x57/0x7d lib/dump_stack.c:106 print_address_description.constprop.0.cold+0xeb/0x495 mm/kasan/report.c:313 print_report mm/kasan/report.c:429 [inline] kasan_report.cold+0xf4/0x1c6 mm/kasan/report.c:491 check_region_inline mm/kasan/generic.c:183 [inline] kasan_check_range+0x13d/0x180 mm/kasan/generic.c:189 instrument_atomic_read include/linux/instrumented.h:71 [inline] atomic_long_read include/linux/atomic/atomic-instrumented.h:1265 [inline] __mutex_unlock_slowpath+0xa6/0x5e0 kernel/locking/mutex.c:916 l2cap_chan_unlock include/net/bluetooth/l2cap.h:860 [inline] l2cap_conn_del+0x3a4/0x720 net/bluetooth/l2cap_core.c:1925 hci_disconn_cfm include/net/bluetooth/hci_core.h:1583 [inline] hci_conn_hash_flush+0xfb/0x210 net/bluetooth/hci_conn.c:1475 hci_dev_close_sync+0x462/0xef0 net/bluetooth/hci_sync.c:4151 hci_dev_do_close+0x23/0x60 net/bluetooth/hci_core.c:553 hci_error_reset+0x79/0xf0 net/bluetooth/hci_core.c:1039 process_one_work+0x865/0x13d0 kernel/workqueue.c:2289 worker_thread+0x598/0xec0 kernel/workqueue.c:2436 kthread+0x299/0x340 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Allocated by task 47: 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:436 [inline] ____kasan_kmalloc mm/kasan/common.c:515 [inline] ____kasan_kmalloc mm/kasan/common.c:474 [inline] __kasan_kmalloc+0xa9/0xd0 mm/kasan/common.c:524 kmalloc include/linux/slab.h:600 [inline] kzalloc include/linux/slab.h:733 [inline] l2cap_chan_create+0x39/0x530 net/bluetooth/l2cap_core.c:463 a2mp_chan_open net/bluetooth/a2mp.c:771 [inline] amp_mgr_create+0x80/0x8e0 net/bluetooth/a2mp.c:862 a2mp_channel_create+0x61/0x120 net/bluetooth/a2mp.c:894 l2cap_data_channel net/bluetooth/l2cap_core.c:7569 [inline] l2cap_recv_frame+0x3da7/0x7e80 net/bluetooth/l2cap_core.c:7724 hci_acldata_packet net/bluetooth/hci_core.c:3634 [inline] hci_rx_work+0x3bf/0xba0 net/bluetooth/hci_core.c:3825 process_one_work+0x865/0x13d0 kernel/workqueue.c:2289 worker_thread+0x598/0xec0 kernel/workqueue.c:2436 kthread+0x299/0x340 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Freed by task 47: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track+0x21/0x30 mm/kasan/common.c:45 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:370 ____kasan_slab_free mm/kasan/common.c:366 [inline] ____kasan_slab_free+0x166/0x1a0 mm/kasan/common.c:328 kasan_slab_free include/linux/kasan.h:200 [inline] slab_free_hook mm/slub.c:1754 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1780 slab_free mm/slub.c:3536 [inline] kfree+0xd6/0x4d0 mm/slub.c:4584 l2cap_conn_del+0x39c/0x720 net/bluetooth/l2cap_core.c:1923 hci_disconn_cfm include/net/bluetooth/hci_core.h:1583 [inline] hci_conn_hash_flush+0xfb/0x210 net/bluetooth/hci_conn.c:1475 hci_dev_close_sync+0x462/0xef0 net/bluetooth/hci_sync.c:4151 hci_dev_do_close+0x23/0x60 net/bluetooth/hci_core.c:553 hci_error_reset+0x79/0xf0 net/bluetooth/hci_core.c:1039 process_one_work+0x865/0x13d0 kernel/workqueue.c:2289 worker_thread+0x598/0xec0 kernel/workqueue.c:2436 kthread+0x299/0x340 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 The buggy address belongs to the object at ffff888015f64000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 1208 bytes inside of 2048-byte region [ffff888015f64000, ffff888015f64800) The buggy address belongs to the physical page: page:ffffea000057d800 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888015f67000 pfn:0x15f60 head:ffffea000057d800 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffffea000059c208 ffffea0001da7c08 ffff888010842000 raw: ffff888015f67000 0000000000080001 00000001ffffffff 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 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 3620, tgid 3620 (kworker/1:3), ts 63711870858, free_ts 63700203002 prep_new_page mm/page_alloc.c:2456 [inline] get_page_from_freelist+0x1290/0x3b70 mm/page_alloc.c:4198 __alloc_pages+0x1c7/0x510 mm/page_alloc.c:5426 alloc_slab_page mm/slub.c:1824 [inline] allocate_slab+0x26c/0x3c0 mm/slub.c:1969 new_slab mm/slub.c:2029 [inline] ___slab_alloc+0x9c4/0xe20 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+0x2cb/0x360 mm/slub.c:4979 kmalloc_reserve net/core/skbuff.c:354 [inline] __alloc_skb+0x8a/0x270 net/core/skbuff.c:426 alloc_skb include/linux/skbuff.h:1426 [inline] alloc_skb_with_frags+0x73/0x6f0 net/core/skbuff.c:5992 sock_alloc_send_pskb+0x636/0x7c0 net/core/sock.c:2662 sock_alloc_send_skb include/net/sock.h:1831 [inline] mld_newpack.isra.0+0x1b4/0x770 net/ipv6/mcast.c:1748 add_grhead+0x273/0x370 net/ipv6/mcast.c:1851 add_grec+0xc87/0x1060 net/ipv6/mcast.c:1989 mld_send_cr net/ipv6/mcast.c:2115 [inline] mld_ifc_work+0x3bb/0xa90 net/ipv6/mcast.c:2653 process_one_work+0x865/0x13d0 kernel/workqueue.c:2289 worker_thread+0x598/0xec0 kernel/workqueue.c:2436 kthread+0x299/0x340 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:1371 [inline] free_pcp_prepare+0x549/0xd20 mm/page_alloc.c:1421 free_unref_page_prepare mm/page_alloc.c:3343 [inline] free_unref_page+0x19/0x6a0 mm/page_alloc.c:3438 __unfreeze_partials+0x17c/0x1a0 mm/slub.c:2548 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0xa2/0xc0 mm/kasan/common.c:446 kasan_slab_alloc include/linux/kasan.h:224 [inline] slab_post_alloc_hook mm/slab.h:750 [inline] slab_alloc_node mm/slub.c:3243 [inline] slab_alloc mm/slub.c:3251 [inline] __kmem_cache_alloc_lru mm/slub.c:3258 [inline] kmem_cache_alloc+0x204/0x3b0 mm/slub.c:3268 vm_area_alloc+0x17/0xf0 kernel/fork.c:459 mmap_region+0x74e/0x11d0 mm/mmap.c:1776 do_mmap+0x5c4/0xd80 mm/mmap.c:1587 vm_mmap_pgoff+0x163/0x210 mm/util.c:552 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff888015f64380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888015f64400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888015f64480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888015f64500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888015f64580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================