bisecting fixing commit since ca4f2c56d4162a4a5236f2099b55453fb98296f9 building syzkaller on 0487ea6f5d997a8363eba0d2eb0ea7a925444555 testing commit ca4f2c56d4162a4a5236f2099b55453fb98296f9 with gcc (GCC) 8.1.0 kernel signature: f6a8c0209a533ea32cd17d0ff5169bb3be2adb0cbea7b15818cdcd3de4d31635 all runs: crashed: KASAN: use-after-free Read in hci_send_acl testing current HEAD 1752938529c614a8ed4432ecce6ebc95d3b87207 testing commit 1752938529c614a8ed4432ecce6ebc95d3b87207 with gcc (GCC) 8.1.0 kernel signature: cc133f50c3fca812a4fc63cd5e36c4aff2e0918732b50a3adff896f933b0a56f all runs: crashed: KASAN: use-after-free Read in hci_send_acl revisions tested: 2, total time: 25m29.842113823s (build: 19m16.338049156s, test: 5m41.712229246s) the crash still happens on HEAD commit msg: Linux 4.14.213 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:3540 Read of size 8 at addr ffff8881d69900d8 by task kworker/u5:0/1203 CPU: 0 PID: 1203 Comm: kworker/u5:0 Not tainted 4.14.213-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:17 [inline] dump_stack+0x14b/0x1f1 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.cold.7+0x11a/0x2d4 mm/kasan/report.c:409 __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+0x2613/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+0x5d4/0x8d0 net/bluetooth/hci_core.c:4249 process_one_work+0x74f/0x1620 kernel/workqueue.c:2116 worker_thread+0xcc/0xed0 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 7206: 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/0x70c2 net/bluetooth/hci_event.c:5326 hci_rx_work+0x30e/0x8d0 net/bluetooth/hci_core.c:4244 process_one_work+0x74f/0x1620 kernel/workqueue.c:2116 worker_thread+0xcc/0xed0 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 1203: 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/0x70c2 net/bluetooth/hci_event.c:5453 hci_rx_work+0x30e/0x8d0 net/bluetooth/hci_core.c:4244 process_one_work+0x74f/0x1620 kernel/workqueue.c:2116 worker_thread+0xcc/0xed0 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 ffff8881d69900c0 which belongs to the cache kmalloc-128 of size 128 The buggy address is located 24 bytes inside of 128-byte region [ffff8881d69900c0, ffff8881d6990140) The buggy address belongs to the page: page:ffffea00075a6400 count:1 mapcount:0 mapping:ffff8881d6990000 index:0x0 flags: 0x17ffe0000000100(slab) raw: 017ffe0000000100 ffff8881d6990000 0000000000000000 0000000100000015 raw: ffffea00077a2de0 ffffea00075a64e0 ffff8881f6000640 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881d698ff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881d6990000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8881d6990080: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ^ ffff8881d6990100: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff8881d6990180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================