bisecting fixing commit since 6ca2f514c57864e3085a65c5e9d2adca4144bc4c building syzkaller on 6972b10616d785401dea17cec890cca8916424a7 testing commit 6ca2f514c57864e3085a65c5e9d2adca4144bc4c compiler: gcc version 8.4.1 20210217 (GCC) kernel signature: ac134f53923f5a61afe7bee4d89b0a21deb054f27f32f3e9f5a2d81ae56bf7e7 all runs: crashed: KASAN: use-after-free Read in klist_dec_and_del testing current HEAD b172b44fcb1771e083aad806fa96f3f60e2ddfac testing commit b172b44fcb1771e083aad806fa96f3f60e2ddfac compiler: gcc version 8.4.1 20210217 (GCC) kernel signature: 4591ebc98cdbef5f9ab476fc1a7a678cd000d585abb481e63bae25dd6116aba0 all runs: crashed: KASAN: use-after-free Read in klist_dec_and_del revisions tested: 2, total time: 27m59.381219479s (build: 21m1.243659661s, test: 6m26.574141345s) the crash still happens on HEAD commit msg: Linux 4.19.206 crash: KASAN: use-after-free Read in klist_dec_and_del kobject_add_internal failed for hci1:200 with -EEXIST, don't try to register things with the same name in the same directory. Bluetooth: hci1: failed to register connection device wlan1: Creating new IBSS network, BSSID 50:50:50:50:50:50 ================================================================== wlan0: Created IBSS using preconfigured BSSID 50:50:50:50:50:50 BUG: KASAN: use-after-free in __list_del_entry_valid+0xf1/0x100 lib/list_debug.c:51 Read of size 8 at addr ffff888098cd3aa0 by task kworker/u5:3/8477 CPU: 0 PID: 8477 Comm: kworker/u5:3 Not tainted 4.19.206-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 wlan0: Creating new IBSS network, BSSID 50:50:50:50:50:50 Workqueue: hci1 hci_rx_work Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x17c/0x226 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 mm/kasan/report.c:412 [inline] kasan_report.cold.7+0x242/0x2fe mm/kasan/report.c:396 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433 __list_del_entry_valid+0xf1/0x100 lib/list_debug.c:51 __list_del_entry include/linux/list.h:117 [inline] list_del include/linux/list.h:125 [inline] klist_release lib/klist.c:190 [inline] kref_put include/linux/kref.h:70 [inline] klist_dec_and_del+0x69/0x450 lib/klist.c:207 klist_put+0x6c/0x110 lib/klist.c:218 klist_del+0xe/0x10 lib/klist.c:231 device_del+0x15c/0xa60 drivers/base/core.c:2321 hci_conn_del_sysfs+0xba/0x150 net/bluetooth/hci_sysfs.c:78 hci_conn_cleanup+0x1ff/0x4e0 net/bluetooth/hci_conn.c:128 hci_conn_del+0x22c/0x6b0 net/bluetooth/hci_conn.c:611 hci_disconn_complete_evt.isra.60+0x5b1/0xda0 net/bluetooth/hci_event.c:2678 hci_event_packet+0x10c0/0x68e0 net/bluetooth/hci_event.c:5787 hci_rx_work+0x385/0xa70 net/bluetooth/hci_core.c:4366 process_one_work+0x7b9/0x15a0 kernel/workqueue.c:2153 worker_thread+0x85/0xb60 kernel/workqueue.c:2296 kthread+0x347/0x410 kernel/kthread.c:259 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415 Allocated by task 8477: 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] device_private_init drivers/base/core.c:2036 [inline] device_add+0xc7e/0x16b0 drivers/base/core.c:2081 hci_conn_add_sysfs+0x8e/0x160 net/bluetooth/hci_sysfs.c:53 hci_conn_complete_evt.isra.52+0x7f4/0x1300 net/bluetooth/hci_event.c:2445 hci_event_packet+0x916/0x68e0 net/bluetooth/hci_event.c:5779 hci_rx_work+0x385/0xa70 net/bluetooth/hci_core.c:4366 process_one_work+0x7b9/0x15a0 kernel/workqueue.c:2153 worker_thread+0x85/0xb60 kernel/workqueue.c:2296 kthread+0x347/0x410 kernel/kthread.c:259 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415 Freed by task 8477: 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 device_add+0x46b/0x16b0 drivers/base/core.c:2214 hci_conn_add_sysfs+0x8e/0x160 net/bluetooth/hci_sysfs.c:53 hci_sync_conn_complete_evt.isra.111+0x8bc/0xa50 net/bluetooth/hci_event.c:4091 hci_event_packet+0x1a08/0x68e0 net/bluetooth/hci_event.c:5869 hci_rx_work+0x385/0xa70 net/bluetooth/hci_core.c:4366 process_one_work+0x7b9/0x15a0 kernel/workqueue.c:2153 worker_thread+0x85/0xb60 kernel/workqueue.c:2296 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 ffff888098cd3a40 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 96 bytes inside of 256-byte region [ffff888098cd3a40, ffff888098cd3b40) The buggy address belongs to the page: page:ffffea00026334c0 count:1 mapcount:0 mapping:ffff88813bff67c0 index:0x0 flags: 0xfff00000000100(slab) raw: 00fff00000000100 ffffea00027d8248 ffffea0002a94cc8 ffff88813bff67c0 raw: 0000000000000000 ffff888098cd3040 000000010000000c 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888098cd3980: 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc ffff888098cd3a00: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb >ffff888098cd3a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888098cd3b00: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff888098cd3b80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================