bisecting fixing commit since 13af6c74b14a883366e7702c40c52ff548096e7f building syzkaller on 02034dac31a9c4dfecfa163f445ef1921c442268 testing commit 13af6c74b14a883366e7702c40c52ff548096e7f with gcc (GCC) 8.4.1 20210217 kernel signature: cd63b6f2e11d05eff1b895c8ccc7db4f5f78b0c5222048046e6f7580b39b0023 all runs: crashed: KASAN: use-after-free Read in hci_send_acl testing current HEAD 125222814e7b8f84df767d6ab622aff2a6d2f234 testing commit 125222814e7b8f84df767d6ab622aff2a6d2f234 with gcc (GCC) 8.4.1 20210217 kernel signature: b45408e639ec8d52b00117c2ee50e690597272fad4adc248e035da90f5312063 all runs: crashed: KASAN: use-after-free Read in hci_send_acl revisions tested: 2, total time: 22m17.235838628s (build: 15m50.358849433s, test: 5m57.265541829s) the crash still happens on HEAD commit msg: Linux 4.19.182 crash: KASAN: use-after-free Read in hci_send_acl Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: hci0: command 0x0409 tx timeout Bluetooth: Wrong link type (-22) ================================================================== BUG: KASAN: use-after-free in hci_send_acl+0x6bd/0x7c0 net/bluetooth/hci_core.c:3654 Read of size 8 at addr ffff8881d8fb4f18 by task kworker/u5:6/7261 CPU: 1 PID: 7261 Comm: kworker/u5:6 Not tainted 4.19.182-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: hci0 hci_rx_work Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x17c/0x226 lib/dump_stack.c:118 print_address_description.cold.6+0x9/0x211 mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report mm/kasan/report.c:412 [inline] kasan_report.cold.7+0x242/0x2fe mm/kasan/report.c:396 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433 hci_send_acl+0x6bd/0x7c0 net/bluetooth/hci_core.c:3654 l2cap_send_cmd+0x631/0x830 net/bluetooth/l2cap_core.c:877 l2cap_information_req net/bluetooth/l2cap_core.c:4455 [inline] l2cap_bredr_sig_cmd net/bluetooth/l2cap_core.c:5447 [inline] l2cap_sig_channel net/bluetooth/l2cap_core.c:5798 [inline] l2cap_recv_frame+0x21ea/0xa430 net/bluetooth/l2cap_core.c:7023 l2cap_recv_acldata+0x756/0x8a0 net/bluetooth/l2cap_core.c:7594 hci_acldata_packet net/bluetooth/hci_core.c:4180 [inline] hci_rx_work+0x5d6/0x8f0 net/bluetooth/hci_core.c:4366 process_one_work+0x7b9/0x15a0 kernel/workqueue.c:2152 worker_thread+0x85/0xb60 kernel/workqueue.c:2295 kthread+0x347/0x410 kernel/kthread.c:259 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415 Allocated by task 1229: save_stack mm/kasan/kasan.c:448 [inline] set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc.part.1+0x62/0xf0 mm/kasan/kasan.c:553 kasan_kmalloc+0xaf/0xc0 mm/kasan/kasan.c:538 kmem_cache_alloc_trace+0x152/0x3a0 mm/slab.c:3625 kmalloc include/linux/slab.h:515 [inline] kzalloc include/linux/slab.h:709 [inline] hci_chan_create+0x7b/0x2e0 net/bluetooth/hci_conn.c:1668 l2cap_conn_add.part.17+0x15/0xb80 net/bluetooth/l2cap_core.c:7062 l2cap_conn_add net/bluetooth/l2cap_core.c:97 [inline] l2cap_connect_cfm+0x339/0xd50 net/bluetooth/l2cap_core.c:7379 hci_connect_cfm include/net/bluetooth/hci_core.h:1246 [inline] hci_remote_features_evt.isra.63+0x467/0xa80 net/bluetooth/hci_event.c:3009 hci_event_packet+0x10ac/0x7230 net/bluetooth/hci_event.c:5795 hci_rx_work+0x363/0x8f0 net/bluetooth/hci_core.c:4361 process_one_work+0x7b9/0x15a0 kernel/workqueue.c:2152 worker_thread+0x85/0xb60 kernel/workqueue.c:2295 kthread+0x347/0x410 kernel/kthread.c:259 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415 Freed by task 7261: save_stack mm/kasan/kasan.c:448 [inline] set_track mm/kasan/kasan.c:460 [inline] __kasan_slab_free+0x13c/0x220 mm/kasan/kasan.c:521 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528 __cache_free mm/slab.c:3503 [inline] kfree+0xcf/0x220 mm/slab.c:3822 hci_chan_del+0x11b/0x170 net/bluetooth/hci_conn.c:1698 amp_destroy_logical_link+0x9/0x10 net/bluetooth/amp.c:598 hci_disconn_loglink_complete_evt net/bluetooth/hci_event.c:4759 [inline] hci_event_packet+0x2e45/0x7230 net/bluetooth/hci_event.c:5922 hci_rx_work+0x363/0x8f0 net/bluetooth/hci_core.c:4361 process_one_work+0x7b9/0x15a0 kernel/workqueue.c:2152 worker_thread+0x85/0xb60 kernel/workqueue.c:2295 kthread+0x347/0x410 kernel/kthread.c:259 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415 The buggy address belongs to the object at ffff8881d8fb4f00 which belongs to the cache kmalloc-128 of size 128 The buggy address is located 24 bytes inside of 128-byte region [ffff8881d8fb4f00, ffff8881d8fb4f80) The buggy address belongs to the page: page:ffffea000763ed00 count:1 mapcount:0 mapping:ffff8881f6400640 index:0x0 flags: 0x17ffe0000000100(slab) raw: 017ffe0000000100 ffffea000766a048 ffffea0007636288 ffff8881f6400640 raw: 0000000000000000 ffff8881d8fb4000 0000000100000015 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881d8fb4e00: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ffff8881d8fb4e80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff8881d8fb4f00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881d8fb4f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881d8fb5000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== Bluetooth: hci1: command 0x0409 tx timeout Bluetooth: hci4: command 0x0409 tx timeout Bluetooth: Wrong link type (-22) Bluetooth: hci3: command 0x0409 tx timeout Bluetooth: hci2: command 0x0409 tx timeout Bluetooth: hci5: command 0x0409 tx timeout Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: hci0: command 0x041b tx timeout Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: hci1: command 0x041b tx timeout Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: hci5: command 0x041b tx timeout Bluetooth: hci2: command 0x041b tx timeout Bluetooth: Wrong link type (-22) Bluetooth: hci3: command 0x041b tx timeout Bluetooth: hci4: command 0x041b tx timeout Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: hci0: command 0x040f tx timeout Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: hci1: command 0x040f tx timeout Bluetooth: Wrong link type (-22) Bluetooth: hci3: command 0x040f tx timeout Bluetooth: hci2: command 0x040f tx timeout Bluetooth: hci4: command 0x040f tx timeout Bluetooth: Wrong link type (-22) Bluetooth: hci5: command 0x040f tx timeout Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: hci0: command 0x0419 tx timeout Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: hci1: command 0x0419 tx timeout Bluetooth: hci5: command 0x0419 tx timeout Bluetooth: hci4: command 0x0419 tx timeout Bluetooth: hci2: command 0x0419 tx timeout Bluetooth: hci3: command 0x0419 tx timeout Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22)