bisecting fixing commit since 13af6c74b14a883366e7702c40c52ff548096e7f building syzkaller on 02034dac31a9c4dfecfa163f445ef1921c442268 testing commit 13af6c74b14a883366e7702c40c52ff548096e7f with gcc (GCC) 8.1.0 kernel signature: 1188c3892ac9540d16e85185abac7b306c373433c7ff0f895c27f9dbb746b96f all runs: crashed: KASAN: use-after-free Read in hci_send_acl testing current HEAD daefdc9eb24bfa11ab77a4b2a9c3923f1051fe0b testing commit daefdc9eb24bfa11ab77a4b2a9c3923f1051fe0b with gcc (GCC) 8.1.0 kernel signature: 6ffdde0c39e8a93bea067640ffe3fb9b9fb57b587d5be9596d725a6238f218e9 all runs: crashed: KASAN: use-after-free Read in hci_send_acl revisions tested: 2, total time: 30m48.331896722s (build: 24m17.734932971s, test: 5m39.207070789s) the crash still happens on HEAD commit msg: Linux 4.19.161 crash: KASAN: use-after-free Read in hci_send_acl IPv6: ADDRCONF(NETDEV_CHANGE): veth1_to_batadv: link becomes ready Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) 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 ffff8881d7a7e9d8 by task kworker/u5:0/1228 CPU: 0 PID: 1228 Comm: kworker/u5:0 Not tainted 4.19.161-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 7278: 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:5792 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 1228: 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:4754 [inline] hci_event_packet+0x2e45/0x7215 net/bluetooth/hci_event.c:5919 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 ffff8881d7a7e9c0 which belongs to the cache kmalloc-128 of size 128 The buggy address is located 24 bytes inside of 128-byte region [ffff8881d7a7e9c0, ffff8881d7a7ea40) The buggy address belongs to the page: page:ffffea00075e9f80 count:1 mapcount:0 mapping:ffff8881f6400640 index:0x0 flags: 0x17ffe0000000100(slab) raw: 017ffe0000000100 ffffea000763b508 ffffea00075c8c48 ffff8881f6400640 raw: 0000000000000000 ffff8881d7a7e000 0000000100000015 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881d7a7e880: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff8881d7a7e900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8881d7a7e980: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ^ ffff8881d7a7ea00: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff8881d7a7ea80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================