Bluetooth: hci0 command 0x041b tx timeout ================================================================== BUG: KASAN: use-after-free in hci_conn_drop include/net/bluetooth/hci_core.h:963 [inline] BUG: KASAN: use-after-free in sco_chan_del+0x3b2/0x3d0 net/bluetooth/sco.c:148 Read of size 1 at addr ffff8880973a4735 by task syz-executor112/6500 CPU: 0 PID: 6500 Comm: syz-executor112 Not tainted 4.14.193-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x1b2/0x283 lib/dump_stack.c:58 print_address_description.cold+0x54/0x1d3 mm/kasan/report.c:252 kasan_report_error.cold+0x8a/0x194 mm/kasan/report.c:351 kasan_report mm/kasan/report.c:409 [inline] __asan_report_load1_noabort+0x68/0x70 mm/kasan/report.c:427 hci_conn_drop include/net/bluetooth/hci_core.h:963 [inline] sco_chan_del+0x3b2/0x3d0 net/bluetooth/sco.c:148 __sco_sock_close+0xb0/0x670 net/bluetooth/sco.c:433 sco_sock_close net/bluetooth/sco.c:447 [inline] sco_sock_release+0x6a/0x370 net/bluetooth/sco.c:1009 __sock_release+0xcd/0x2b0 net/socket.c:602 sock_close+0x15/0x20 net/socket.c:1139 __fput+0x25f/0x7a0 fs/file_table.c:210 task_work_run+0x11f/0x190 kernel/task_work.c:113 get_signal+0x18a3/0x1ca0 kernel/signal.c:2234 do_signal+0x7c/0x1550 arch/x86/kernel/signal.c:814 exit_to_usermode_loop+0x160/0x200 arch/x86/entry/common.c:160 prepare_exit_to_usermode arch/x86/entry/common.c:199 [inline] syscall_return_slowpath arch/x86/entry/common.c:270 [inline] do_syscall_64+0x4a3/0x640 arch/x86/entry/common.c:297 entry_SYSCALL_64_after_hwframe+0x46/0xbb RIP: 0033:0x4470b9 RSP: 002b:00007f6cbec83db8 EFLAGS: 00000246 ORIG_RAX: 000000000000002a RAX: fffffffffffffffc RBX: 00000000006dbc28 RCX: 00000000004470b9 RDX: 0000000000000008 RSI: 00000000200001c0 RDI: 0000000000000004 RBP: 00000000006dbc20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000006dbc2c R13: 00007ffdfcdc5a6f R14: 00007f6cbec849c0 R15: 00000000006dbc2c Allocated by task 6392: save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc+0xeb/0x160 mm/kasan/kasan.c:551 kmem_cache_alloc_trace+0x131/0x3d0 mm/slab.c:3618 kmalloc include/linux/slab.h:488 [inline] kzalloc include/linux/slab.h:661 [inline] hci_conn_add+0x53/0x12f0 net/bluetooth/hci_conn.c:501 hci_connect_sco+0x265/0x7d0 net/bluetooth/hci_conn.c:1119 sco_connect net/bluetooth/sco.c:240 [inline] sco_sock_connect+0x26c/0x860 net/bluetooth/sco.c:576 SYSC_connect net/socket.c:1655 [inline] SyS_connect+0x1f4/0x240 net/socket.c:1636 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb Freed by task 6388: save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0xc3/0x1a0 mm/kasan/kasan.c:524 __cache_free mm/slab.c:3496 [inline] kfree+0xc9/0x250 mm/slab.c:3815 device_release+0xf0/0x1a0 drivers/base/core.c:831 kobject_cleanup lib/kobject.c:646 [inline] kobject_release lib/kobject.c:675 [inline] kref_put include/linux/kref.h:70 [inline] kobject_put+0x1f3/0x2d0 lib/kobject.c:692 put_device+0x1c/0x30 drivers/base/core.c:2014 hci_conn_del+0x235/0x620 net/bluetooth/hci_conn.c:611 hci_phy_link_complete_evt.isra.0+0x4d0/0x6c0 net/bluetooth/hci_event.c:4355 hci_event_packet+0x2592/0x7c7a net/bluetooth/hci_event.c:5429 hci_rx_work+0x3e6/0x970 net/bluetooth/hci_core.c:4244 process_one_work+0x793/0x14a0 kernel/workqueue.c:2116 worker_thread+0x5cc/0xff0 kernel/workqueue.c:2250 kthread+0x30d/0x420 kernel/kthread.c:232 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404 The buggy address belongs to the object at ffff8880973a4700 which belongs to the cache kmalloc-4096 of size 4096 The buggy address is located 53 bytes inside of 4096-byte region [ffff8880973a4700, ffff8880973a5700) The buggy address belongs to the page: page:ffffea00025ce900 count:1 mapcount:0 mapping:ffff8880973a4700 index:0x0 compound_mapcount: 0 flags: 0xfffe0000008100(slab|head) raw: 00fffe0000008100 ffff8880973a4700 0000000000000000 0000000100000001 raw: ffffea0002641420 ffffea00025aeba0 ffff88812fe52dc0 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880973a4600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880973a4680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880973a4700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880973a4780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880973a4800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================