bisecting fixing commit since cbfa1702aaf69b2311ea1b35e04f113c48368c67 building syzkaller on 6bfdbe8950b22b1c832478bd397754f3108df040 testing commit cbfa1702aaf69b2311ea1b35e04f113c48368c67 with gcc (GCC) 8.4.1 20210217 kernel signature: 091469ff5d53d1d046ea6b3978c45f5f426080cc828af163dcb905eb471520f6 all runs: crashed: KASAN: use-after-free Read in hci_chan_del testing current HEAD cb83ddcd5332fcc3efd52ba994976efc4dd6061e testing commit cb83ddcd5332fcc3efd52ba994976efc4dd6061e with gcc (GCC) 8.4.1 20210217 kernel signature: 3858b64678adceecc4f716ff569a4032e588a115c8b3568d363ac52fd218233d all runs: crashed: KASAN: use-after-free Read in hci_chan_del revisions tested: 2, total time: 21m34.218750344s (build: 14m59.207495111s, test: 6m6.958882257s) the crash still happens on HEAD commit msg: Linux 4.14.226 crash: KASAN: use-after-free Read in hci_chan_del wlan1: Creating new IBSS network, BSSID 50:50:50:50:50:50 wlan0: Created IBSS using preconfigured BSSID 50:50:50:50:50:50 IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready wlan0: Creating new IBSS network, BSSID 50:50:50:50:50:50 ================================================================== BUG: KASAN: use-after-free in hci_chan_del+0x12b/0x170 net/bluetooth/hci_conn.c:1564 Read of size 8 at addr ffff8881f2b6ad98 by task syz-executor.2/5782 CPU: 0 PID: 5782 Comm: syz-executor.2 Not tainted 4.14.226-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 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_chan_del+0x12b/0x170 net/bluetooth/hci_conn.c:1564 l2cap_conn_del.isra.23+0x3cf/0x610 net/bluetooth/l2cap_core.c:1739 l2cap_disconn_cfm net/bluetooth/l2cap_core.c:7441 [inline] l2cap_disconn_cfm+0x61/0x80 net/bluetooth/l2cap_core.c:7434 hci_disconn_cfm include/net/bluetooth/hci_core.h:1226 [inline] hci_conn_hash_flush+0x10b/0x200 net/bluetooth/hci_conn.c:1393 hci_dev_do_close+0x47a/0xb10 net/bluetooth/hci_core.c:1622 hci_unregister_dev+0x163/0x790 net/bluetooth/hci_core.c:3193 vhci_release+0x6b/0xe0 drivers/bluetooth/hci_vhci.c:354 __fput+0x232/0x740 fs/file_table.c:210 ____fput+0x9/0x10 fs/file_table.c:244 task_work_run+0xe5/0x170 kernel/task_work.c:113 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0x98b/0x2c90 kernel/exit.c:868 do_group_exit+0xf8/0x2c0 kernel/exit.c:965 SYSC_exit_group kernel/exit.c:976 [inline] SyS_exit_group+0x18/0x20 kernel/exit.c:974 do_syscall_64+0x1c7/0x5b0 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb RIP: 0033:0x465ad9 RSP: 002b:00007ffd6371f188 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 0000000000000064 RCX: 0000000000465ad9 RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000000 RBP: 00000000004ae538 R08: 000000000000000c R09: 00000000033523bc R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000016 R13: 00007ffd63720460 R14: 00000000033523bc R15: 0000000000000004 Allocated by task 5818: 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_le_conn_complete_evt net/bluetooth/hci_event.c:4606 [inline] hci_le_meta_evt+0x322a/0x4330 net/bluetooth/hci_event.c:5172 hci_event_packet+0x1486/0x70e0 net/bluetooth/hci_event.c:5432 hci_rx_work+0x356/0x8e0 net/bluetooth/hci_core.c:4246 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 5816: 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:598 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:4246 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 ffff8881f2b6ad80 which belongs to the cache kmalloc-128 of size 128 The buggy address is located 24 bytes inside of 128-byte region [ffff8881f2b6ad80, ffff8881f2b6ae00) The buggy address belongs to the page: page:ffffea0007cada80 count:1 mapcount:0 mapping:ffff8881f2b6a000 index:0x0 flags: 0x17ffe0000000100(slab) raw: 017ffe0000000100 ffff8881f2b6a000 0000000000000000 0000000100000015 raw: ffffea0007ca9be0 ffffea0007c9e420 ffff8881f6000640 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881f2b6ac80: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ffff8881f2b6ad00: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff8881f2b6ad80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881f2b6ae00: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ffff8881f2b6ae80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ================================================================== ieee80211 phy11: Selected rate control algorithm 'minstrel_ht' ieee80211 phy10: mac80211_hwsim_conf_tx (queue=0 txop=0 cw_min=15 cw_max=1023 aifs=2) ieee80211 phy11: hwaddr 02:00:00:00:0b:00 registered ieee80211 phy8: mac80211_hwsim_configure_filter ieee80211 phy12: Selected rate control algorithm 'minstrel_ht' ieee80211 phy9: mac80211_hwsim_configure_filter ieee80211 phy12: hwaddr 02:00:00:00:0c:00 registered ieee80211 phy11: mac80211_hwsim_start ieee80211 phy10: mac80211_hwsim_conf_tx (queue=1 txop=0 cw_min=15 cw_max=1023 aifs=2) list_del corruption, ffff8881f2b6ad80->prev is LIST_POISON2 (dead000000000200) ieee80211 phy10: mac80211_hwsim_conf_tx (queue=2 txop=0 cw_min=15 cw_max=1023 aifs=2) ieee80211 phy11: mac80211_hwsim_add_interface (type=1 mac_addr=02:00:00:00:0b:00) ieee80211 phy10: mac80211_hwsim_conf_tx (queue=3 txop=0 cw_min=15 cw_max=1023 aifs=2) ------------[ cut here ]------------ ieee80211 phy10: mac80211_hwsim_bss_info_changed(changed=0x2000 vif->addr=02:00:00:00:0a:00) kernel BUG at lib/list_debug.c:50! ieee80211 phy10: mac80211_hwsim_bss_info_changed(changed=0x8bfe vif->addr=02:00:00:00:0a:00) ieee80211 phy11: mac80211_hwsim_bss_info_changed(changed=0xe vif->addr=02:00:00:00:0b:00) ieee80211 phy10: mac80211_hwsim_bss_info_changed: BSSID changed: 50:50:50:50:50:50 ieee80211 phy11: ERP_CTS_PROT: 0 ieee80211 phy10: BCN EN: 1 (BI=100) ieee80211 phy11: ERP_PREAMBLE: 0 ieee80211 phy10: ERP_CTS_PROT: 0 invalid opcode: 0000 [#1] PREEMPT SMP KASAN Modules linked in: CPU: 0 PID: 5782 Comm: syz-executor.2 Tainted: G B 4.14.226-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 task: ffff8881e7ea6440 task.stack: ffff8881e8690000 RIP: 0010:__list_del_entry_valid.cold.1+0x12/0x4a lib/list_debug.c:48 RSP: 0018:ffff8881e8697a20 EFLAGS: 00010282 RAX: 000000000000004e RBX: ffff8881f2b6ad80 RCX: 0000000000000000 RDX: 000000000000004e RSI: ffffffff86cbec60 RDI: ffffed103d0d2f3b RBP: ffff8881e8697a38 R08: 0000000000000000 R09: 0000000000000000 R10: fffffbfff13446c5 R11: ffff8881e7ea6440 R12: dead000000000200 R13: ffff8881f3e17a80 R14: ffff8881e6b15470 R15: ffffffff889bfca0 FS: 0000000003352400(0000) GS:ffff8881f6600000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000537d08 CR3: 0000000007e6a004 CR4: 00000000001606f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: __list_del_entry include/linux/list.h:117 [inline] list_del_rcu include/linux/rculist.h:130 [inline] hci_chan_del+0x3f/0x170 net/bluetooth/hci_conn.c:1569 ieee80211 phy10: ERP_PREAMBLE: 0 l2cap_conn_del.isra.23+0x3cf/0x610 net/bluetooth/l2cap_core.c:1739 ieee80211 phy10: ERP_SLOT: 0 l2cap_disconn_cfm net/bluetooth/l2cap_core.c:7441 [inline] l2cap_disconn_cfm+0x61/0x80 net/bluetooth/l2cap_core.c:7434 hci_disconn_cfm include/net/bluetooth/hci_core.h:1226 [inline] hci_conn_hash_flush+0x10b/0x200 net/bluetooth/hci_conn.c:1393 hci_dev_do_close+0x47a/0xb10 net/bluetooth/hci_core.c:1622 hci_unregister_dev+0x163/0x790 net/bluetooth/hci_core.c:3193 vhci_release+0x6b/0xe0 drivers/bluetooth/hci_vhci.c:354 __fput+0x232/0x740 fs/file_table.c:210 ____fput+0x9/0x10 fs/file_table.c:244 task_work_run+0xe5/0x170 kernel/task_work.c:113 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0x98b/0x2c90 kernel/exit.c:868 ieee80211 phy10: HT: op_mode=0xb ieee80211 phy10: BASIC_RATES: 0x1 ieee80211 phy11: ERP_SLOT: 0 ieee80211 phy11: mac80211_hwsim_conf_tx (queue=0 txop=47 cw_min=3 cw_max=7 aifs=2) do_group_exit+0xf8/0x2c0 kernel/exit.c:965 SYSC_exit_group kernel/exit.c:976 [inline] SyS_exit_group+0x18/0x20 kernel/exit.c:974 do_syscall_64+0x1c7/0x5b0 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb RIP: 0033:0x465ad9 RSP: 002b:00007ffd6371f188 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 0000000000000064 RCX: 0000000000465ad9 RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000000 RBP: 00000000004ae538 R08: 000000000000000c R09: 00000000033523bc R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000016 R13: 00007ffd63720460 R14: 00000000033523bc R15: 0000000000000004 Code: 86 ieee80211 phy11: mac80211_hwsim_conf_tx (queue=1 txop=94 cw_min=7 cw_max=15 aifs=2) f9 ieee80211 phy11: mac80211_hwsim_conf_tx (queue=2 txop=0 cw_min=15 cw_max=1023 aifs=3) ff 0f 0b 48 89 f1 48 c7 c7 60 0d 04 87 48 89 de e8 e8 86 f9 ff 0f 0b 4c 89 e2 48 89 de 48 c7 c7 a0 0e 04 87 e8 d4 86 f9 ff <0f> 0b 4c ieee80211 phy11: mac80211_hwsim_conf_tx (queue=3 txop=0 cw_min=15 cw_max=1023 aifs=7) 89 ieee80211 phy11: mac80211_hwsim_bss_info_changed(changed=0x2000 vif->addr=02:00:00:00:0b:00) ea ieee80211 phy11: mac80211_hwsim_config (freq=2412(2412 - 0)/noht idle=1 ps=0 smps=static) 48 ieee80211 phy11: mac80211_hwsim_configure_filter 89 IPv6: ADDRCONF(NETDEV_UP): wlan1: link is not ready de ieee80211 phy11: mac80211_hwsim_configure_filter 48 c7 c7 40 0e 04 87 e8 c0 86 f9 ff 0f RIP: __list_del_entry_valid.cold.1+0x12/0x4a lib/list_debug.c:48 RSP: ffff8881e8697a20 ieee80211 phy12: mac80211_hwsim_start ---[ end trace 57668c1a9fe69dac ]--- ieee80211 phy12: mac80211_hwsim_add_interface (type=1 mac_addr=02:00:00:00:0c:00)