bisecting fixing commit since 13af6c74b14a883366e7702c40c52ff548096e7f building syzkaller on 02034dac31a9c4dfecfa163f445ef1921c442268 testing commit 13af6c74b14a883366e7702c40c52ff548096e7f with gcc (GCC) 8.1.0 kernel signature: e84cd829565b748850c0643416659f3ea9ad9a8f8f993b331ba565e83e70b61e all runs: crashed: KASAN: use-after-free Read in hci_send_acl testing current HEAD 3207316b3beec7e38e5dbe2f463df0cec71e0b97 testing commit 3207316b3beec7e38e5dbe2f463df0cec71e0b97 with gcc (GCC) 8.1.0 kernel signature: 525129ad7144c01efffe71ec22fac057d12deae72b4bf9db83bff66ec14ec248 all runs: crashed: KASAN: use-after-free Read in hci_send_acl revisions tested: 2, total time: 23m40.337270579s (build: 17m43.199140461s, test: 5m21.304898767s) the crash still happens on HEAD commit msg: Linux 4.19.164 crash: KASAN: use-after-free Read in hci_send_acl Bluetooth: hci3: command 0x0409 tx timeout Bluetooth: hci5: command 0x0409 tx timeout Bluetooth: hci4: 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:3652 Read of size 8 at addr ffff8881d723fb58 by task kworker/u5:5/7325 CPU: 1 PID: 7325 Comm: kworker/u5:5 Not tainted 4.19.164-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/0x22a 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.cold.7+0x242/0x307 mm/kasan/report.c:412 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433 hci_send_acl+0x6bd/0x7c0 net/bluetooth/hci_core.c:3652 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/0xa440 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:4178 [inline] hci_rx_work+0x5e1/0x8e0 net/bluetooth/hci_core.c:4364 process_one_work+0x7b9/0x15a0 kernel/workqueue.c:2155 worker_thread+0x85/0xb60 kernel/workqueue.c:2298 kthread+0x347/0x410 kernel/kthread.c:259 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415 Allocated by task 7292: 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/0x7215 net/bluetooth/hci_event.c:5795 hci_rx_work+0x31b/0x8e0 net/bluetooth/hci_core.c:4359 process_one_work+0x7b9/0x15a0 kernel/workqueue.c:2155 worker_thread+0x85/0xb60 kernel/workqueue.c:2298 kthread+0x347/0x410 kernel/kthread.c:259 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415 Freed by task 7325: 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:595 hci_disconn_loglink_complete_evt net/bluetooth/hci_event.c:4759 [inline] hci_event_packet+0x2e45/0x7215 net/bluetooth/hci_event.c:5922 hci_rx_work+0x31b/0x8e0 net/bluetooth/hci_core.c:4359 process_one_work+0x7b9/0x15a0 kernel/workqueue.c:2155 worker_thread+0x85/0xb60 kernel/workqueue.c:2298 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 ffff8881d723fb40 which belongs to the cache kmalloc-128 of size 128 The buggy address is located 24 bytes inside of 128-byte region [ffff8881d723fb40, ffff8881d723fbc0) The buggy address belongs to the page: page:ffffea00075c8fc0 count:1 mapcount:0 mapping:ffff8881f6400640 index:0x0 flags: 0x17ffe0000000100(slab) raw: 017ffe0000000100 ffffea000766af08 ffffea00075a9108 ffff8881f6400640 raw: 0000000000000000 ffff8881d723f000 0000000100000015 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881d723fa00: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff8881d723fa80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8881d723fb00: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ^ ffff8881d723fb80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff8881d723fc00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================