bisecting fixing commit since ca4f2c56d4162a4a5236f2099b55453fb98296f9 building syzkaller on 0487ea6f5d997a8363eba0d2eb0ea7a925444555 testing commit ca4f2c56d4162a4a5236f2099b55453fb98296f9 with gcc (GCC) 8.4.1 20210217 kernel signature: 6ef78598e6cb13932bd87d220fbd903042d269aa1839b92fde141d28be97e164 all runs: crashed: KASAN: use-after-free Read in hci_send_acl testing current HEAD 3242aa3a635c0958671ee1e4b0958dcc7c4e5c79 testing commit 3242aa3a635c0958671ee1e4b0958dcc7c4e5c79 with gcc (GCC) 8.4.1 20210217 kernel signature: 9f32478d5f7c2908ba4870b50df5be023fdc4a987a922c67714b0cdbba8d8048 all runs: crashed: KASAN: use-after-free Read in hci_send_acl revisions tested: 2, total time: 22m28.590423911s (build: 15m19.895013301s, test: 6m13.510243936s) the crash still happens on HEAD commit msg: Linux 4.14.222 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) device veth1_macvtap entered promiscuous mode ================================================================== BUG: KASAN: use-after-free in hci_send_acl+0x6bd/0x7c0 net/bluetooth/hci_core.c:3540 Read of size 8 at addr ffff8881d87bc918 by task kworker/u5:2/7127 CPU: 0 PID: 7127 Comm: kworker/u5:2 Not tainted 4.14.222-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: hci0 hci_rx_work IPv6: ADDRCONF(NETDEV_UP): veth0_to_batadv: link is not ready Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x14b/0x1e7 lib/dump_stack.c:58 print_address_description.cold.6+0x9/0x1ca mm/kasan/report.c:252 kasan_report_error mm/kasan/report.c:351 [inline] kasan_report mm/kasan/report.c:409 [inline] kasan_report.cold.7+0x11a/0x2d3 mm/kasan/report.c:393 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:430 hci_send_acl+0x6bd/0x7c0 net/bluetooth/hci_core.c:3540 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+0x2615/0x9e10 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:4066 [inline] hci_rx_work+0x5c9/0x8e0 net/bluetooth/hci_core.c:4249 process_one_work+0x74f/0x1620 kernel/workqueue.c:2116 worker_thread+0xcc/0xee0 kernel/workqueue.c:2250 kthread+0x338/0x400 kernel/kthread.c:232 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404 Allocated by task 7127: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc.part.1+0x62/0xf0 mm/kasan/kasan.c:551 kasan_kmalloc+0xaf/0xc0 mm/kasan/kasan.c:536 kmem_cache_alloc_trace+0x152/0x3f0 mm/slab.c:3618 kmalloc include/linux/slab.h:488 [inline] kzalloc include/linux/slab.h:661 [inline] hci_chan_create+0x7b/0x2e0 net/bluetooth/hci_conn.c:1549 l2cap_conn_add.part.16+0x15/0xbd0 net/bluetooth/l2cap_core.c:7062 l2cap_conn_add net/bluetooth/l2cap_core.c:97 [inline] l2cap_connect_cfm+0x319/0xd20 net/bluetooth/l2cap_core.c:7379 hci_connect_cfm include/net/bluetooth/hci_core.h:1211 [inline] hci_remote_features_evt.isra.61+0x459/0xa70 net/bluetooth/hci_event.c:2745 hci_event_packet+0x1240/0x70e0 net/bluetooth/hci_event.c:5326 hci_rx_work+0x356/0x8e0 net/bluetooth/hci_core.c:4244 process_one_work+0x74f/0x1620 kernel/workqueue.c:2116 worker_thread+0xcc/0xee0 kernel/workqueue.c:2250 kthread+0x338/0x400 kernel/kthread.c:232 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404 Freed by task 7127: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0xab/0x190 mm/kasan/kasan.c:524 __cache_free mm/slab.c:3496 [inline] kfree+0xcc/0x270 mm/slab.c:3815 hci_chan_del+0x11b/0x170 net/bluetooth/hci_conn.c:1579 amp_destroy_logical_link+0x9/0x10 net/bluetooth/amp.c:595 hci_disconn_loglink_complete_evt net/bluetooth/hci_event.c:4437 [inline] hci_event_packet+0x1aa4/0x70e0 net/bluetooth/hci_event.c:5453 hci_rx_work+0x356/0x8e0 net/bluetooth/hci_core.c:4244 process_one_work+0x74f/0x1620 kernel/workqueue.c:2116 worker_thread+0xcc/0xee0 kernel/workqueue.c:2250 kthread+0x338/0x400 kernel/kthread.c:232 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404 The buggy address belongs to the object at ffff8881d87bc900 which belongs to the cache kmalloc-128 of size 128 The buggy address is located 24 bytes inside of 128-byte region [ffff8881d87bc900, ffff8881d87bc980) The buggy address belongs to the page: page:ffffea000761ef00 count:1 mapcount:0 mapping:ffff8881d87bc000 index:0x0 flags: 0x17ffe0000000100(slab) raw: 017ffe0000000100 ffff8881d87bc000 0000000000000000 0000000100000015 raw: ffffea00076bef60 ffffea000763fb60 ffff8881f6000640 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881d87bc800: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ffff8881d87bc880: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff8881d87bc900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881d87bc980: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ffff8881d87bca00: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ==================================================================