Bluetooth: hci5: Controller not accepting commands anymore: ncmd = 0 Bluetooth: hci5: Injecting HCI hardware error event Bluetooth: hci5: hardware error 0x00 ================================================================== BUG: KASAN: slab-use-after-free in hci_conn_hash_flush+0x89/0x220 Read of size 8 at addr ffff88803a3dc000 by task kworker/u5:0/12235 CPU: 0 PID: 12235 Comm: kworker/u5:0 Not tainted 6.4.0-rc3-syzkaller-00032-g933174ae28ba #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/16/2023 Workqueue: hci5 hci_error_reset Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:351 [inline] print_report+0x163/0x540 mm/kasan/report.c:462 kasan_report+0x176/0x1b0 mm/kasan/report.c:572 hci_conn_hash_flush+0x89/0x220 hci_dev_close_sync+0xa35/0x1020 net/bluetooth/hci_sync.c:4941 hci_dev_do_close net/bluetooth/hci_core.c:554 [inline] hci_error_reset+0xec/0x200 net/bluetooth/hci_core.c:1059 process_one_work+0x8a0/0x10e0 kernel/workqueue.c:2405 worker_thread+0xa63/0x1210 kernel/workqueue.c:2552 kthread+0x2b8/0x350 kernel/kthread.c:379 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Allocated by task 18543: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4f/0x70 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:383 kmalloc include/linux/slab.h:559 [inline] kzalloc include/linux/slab.h:680 [inline] hci_conn_add+0xc3/0x13a0 net/bluetooth/hci_conn.c:986 hci_connect_sco+0x8e/0x2b0 net/bluetooth/hci_conn.c:1663 sco_connect net/bluetooth/sco.c:264 [inline] sco_sock_connect+0x2b9/0x990 net/bluetooth/sco.c:610 __sys_connect_file net/socket.c:2003 [inline] __sys_connect+0x2cd/0x300 net/socket.c:2020 __do_sys_connect net/socket.c:2030 [inline] __se_sys_connect net/socket.c:2027 [inline] __x64_sys_connect+0x7a/0x90 net/socket.c:2027 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 12235: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4f/0x70 mm/kasan/common.c:52 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:521 ____kasan_slab_free+0xd6/0x120 mm/kasan/common.c:236 kasan_slab_free include/linux/kasan.h:162 [inline] slab_free_hook mm/slub.c:1781 [inline] slab_free_freelist_hook mm/slub.c:1807 [inline] slab_free mm/slub.c:3786 [inline] __kmem_cache_free+0x264/0x3c0 mm/slub.c:3799 device_release+0x95/0x1c0 kobject_cleanup lib/kobject.c:683 [inline] kobject_release lib/kobject.c:714 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x228/0x470 lib/kobject.c:731 hci_conn_del+0x321/0x5a0 net/bluetooth/hci_conn.c:1162 hci_conn_unlink+0x1e1/0x320 net/bluetooth/hci_conn.c:1087 hci_conn_hash_flush+0x198/0x220 net/bluetooth/hci_conn.c:2479 hci_dev_close_sync+0xa35/0x1020 net/bluetooth/hci_sync.c:4941 hci_dev_do_close net/bluetooth/hci_core.c:554 [inline] hci_error_reset+0xec/0x200 net/bluetooth/hci_core.c:1059 process_one_work+0x8a0/0x10e0 kernel/workqueue.c:2405 worker_thread+0xa63/0x1210 kernel/workqueue.c:2552 kthread+0x2b8/0x350 kernel/kthread.c:379 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Last potentially related work creation: kasan_save_stack+0x3f/0x60 mm/kasan/common.c:45 __kasan_record_aux_stack+0xb0/0xc0 mm/kasan/generic.c:491 insert_work+0x54/0x3d0 kernel/workqueue.c:1365 __queue_work+0xb37/0xf10 kernel/workqueue.c:1526 queue_delayed_work_on+0x15a/0x260 kernel/workqueue.c:1710 sco_chan_del+0xeb/0x1d0 net/bluetooth/sco.c:169 sco_sock_close net/bluetooth/sco.c:469 [inline] sco_sock_release+0xb3/0x320 net/bluetooth/sco.c:1267 __sock_release net/socket.c:653 [inline] sock_close+0xd1/0x230 net/socket.c:1397 __fput+0x3b7/0x890 fs/file_table.c:321 task_work_run+0x24a/0x300 kernel/task_work.c:179 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0x68f/0x2290 kernel/exit.c:871 do_group_exit+0x206/0x2c0 kernel/exit.c:1021 get_signal+0x1701/0x17e0 kernel/signal.c:2874 arch_do_signal_or_restart+0x91/0x670 arch/x86/kernel/signal.c:306 exit_to_user_mode_loop+0x6a/0x100 kernel/entry/common.c:168 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:204 irqentry_exit_to_user_mode+0x9/0x40 kernel/entry/common.c:310 exc_page_fault+0x71e/0x910 arch/x86/mm/fault.c:1593 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570 The buggy address belongs to the object at ffff88803a3dc000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 0 bytes inside of freed 4096-byte region [ffff88803a3dc000, ffff88803a3dd000) The buggy address belongs to the physical page: page:ffffea0000e8f600 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x3a3d8 head:ffffea0000e8f600 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000010200 ffff888012442140 ffffea0000e46600 dead000000000002 raw: 0000000000000000 0000000000040004 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 0x1d2820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 900, tgid 900 (kworker/0:2), ts 1458678107386, free_ts 1447722470336 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x1e6/0x210 mm/page_alloc.c:1731 prep_new_page mm/page_alloc.c:1738 [inline] get_page_from_freelist+0x321c/0x33a0 mm/page_alloc.c:3502 __alloc_pages+0x255/0x670 mm/page_alloc.c:4768 alloc_slab_page+0x6a/0x160 mm/slub.c:1851 allocate_slab mm/slub.c:1998 [inline] new_slab+0x84/0x2f0 mm/slub.c:2051 ___slab_alloc+0xa85/0x10a0 mm/slub.c:3192 __slab_alloc mm/slub.c:3291 [inline] __slab_alloc_node mm/slub.c:3344 [inline] slab_alloc_node mm/slub.c:3441 [inline] __kmem_cache_alloc_node+0x1b8/0x290 mm/slub.c:3490 __do_kmalloc_node mm/slab_common.c:965 [inline] __kmalloc_node_track_caller+0xa5/0x230 mm/slab_common.c:986 kmalloc_reserve+0xfe/0x240 net/core/skbuff.c:585 __alloc_skb+0x1b1/0x420 net/core/skbuff.c:654 alloc_skb include/linux/skbuff.h:1288 [inline] nsim_dev_trap_skb_build drivers/net/netdevsim/dev.c:751 [inline] nsim_dev_trap_report drivers/net/netdevsim/dev.c:808 [inline] nsim_dev_trap_report_work+0x250/0xa90 drivers/net/netdevsim/dev.c:853 process_one_work+0x8a0/0x10e0 kernel/workqueue.c:2405 worker_thread+0xa63/0x1210 kernel/workqueue.c:2552 kthread+0x2b8/0x350 kernel/kthread.c:379 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1302 [inline] free_unref_page_prepare+0x903/0xa30 mm/page_alloc.c:2564 free_unref_page+0x37/0x3f0 mm/page_alloc.c:2659 qlist_free_all+0x22/0x60 mm/kasan/quarantine.c:185 kasan_quarantine_reduce+0x14b/0x160 mm/kasan/quarantine.c:292 __kasan_slab_alloc+0x23/0x70 mm/kasan/common.c:305 kasan_slab_alloc include/linux/kasan.h:186 [inline] slab_post_alloc_hook+0x68/0x3a0 mm/slab.h:711 slab_alloc_node mm/slub.c:3451 [inline] kmem_cache_alloc_node+0x157/0x350 mm/slub.c:3496 __alloc_skb+0x181/0x420 net/core/skbuff.c:644 alloc_skb include/linux/skbuff.h:1288 [inline] alloc_skb_with_frags+0xa8/0x750 net/core/skbuff.c:6378 sock_alloc_send_pskb+0x919/0xa50 net/core/sock.c:2729 unix_dgram_sendmsg+0x5b5/0x2050 net/unix/af_unix.c:1944 sock_sendmsg_nosec net/socket.c:724 [inline] sock_sendmsg net/socket.c:747 [inline] sock_write_iter+0x397/0x520 net/socket.c:1140 do_iter_write+0x7b1/0xcb0 fs/read_write.c:860 vfs_writev fs/read_write.c:933 [inline] do_writev+0x27f/0x470 fs/read_write.c:976 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff88803a3dbf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88803a3dbf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88803a3dc000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88803a3dc080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88803a3dc100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================