bisecting fixing commit since c076c79e03c6094e578df5d210fde808b3ad32e6 building syzkaller on 4ca1c0ea446d2c09b1fb49a85ae645e3754f1058 testing commit c076c79e03c6094e578df5d210fde808b3ad32e6 with gcc (GCC) 8.1.0 kernel signature: 139c3ab5861a052b8f109609351bf7bf4c9854323d9f6f25bf956892082fcafb run #0: crashed: WARNING: ODEBUG bug in bt_link_release run #1: crashed: WARNING: ODEBUG bug in corrupted run #2: crashed: WARNING: ODEBUG bug in corrupted run #3: crashed: WARNING: ODEBUG bug in bt_link_release run #4: crashed: WARNING: ODEBUG bug in corrupted run #5: crashed: WARNING: ODEBUG bug in bt_link_release run #6: crashed: WARNING: ODEBUG bug in bt_link_release run #7: crashed: WARNING: ODEBUG bug in bt_link_release run #8: crashed: WARNING: ODEBUG bug in bt_link_release run #9: crashed: WARNING: ODEBUG bug in corrupted testing current HEAD daefdc9eb24bfa11ab77a4b2a9c3923f1051fe0b testing commit daefdc9eb24bfa11ab77a4b2a9c3923f1051fe0b with gcc (GCC) 8.1.0 kernel signature: 172b751c130a06367786d197aba92540157608b5c6b3b28fcf3174fc447d9bcb run #0: crashed: WARNING: ODEBUG bug in bt_link_release run #1: crashed: WARNING: ODEBUG bug in bt_link_release run #2: crashed: KASAN: use-after-free Write in sco_chan_del run #3: crashed: KASAN: use-after-free Write in sco_chan_del run #4: crashed: KASAN: use-after-free Write in sco_chan_del run #5: crashed: KASAN: use-after-free Write in sco_chan_del run #6: crashed: WARNING: ODEBUG bug in bt_link_release run #7: crashed: WARNING: ODEBUG bug in bt_link_release run #8: crashed: WARNING: ODEBUG bug in bt_link_release run #9: crashed: KASAN: use-after-free Write in sco_chan_del revisions tested: 2, total time: 25m47.405795918s (build: 19m25.30067802s, test: 5m42.911218625s) the crash still happens on HEAD commit msg: Linux 4.19.161 crash: KASAN: use-after-free Write in sco_chan_del batman_adv: batadv0: Interface activated: batadv_slave_1 IPv6: ADDRCONF(NETDEV_CHANGE): batadv_slave_1: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): veth1_to_batadv: link becomes ready ================================================================== BUG: KASAN: use-after-free in atomic_dec_and_test include/asm-generic/atomic-instrumented.h:259 [inline] BUG: KASAN: use-after-free in hci_conn_drop include/net/bluetooth/hci_core.h:972 [inline] BUG: KASAN: use-after-free in sco_chan_del+0xe0/0x3d0 net/bluetooth/sco.c:148 Write of size 4 at addr ffff8881d60beb50 by task syz-executor.4/7313 CPU: 1 PID: 7313 Comm: syz-executor.4 Not tainted 4.19.161-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 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 check_memory_region_inline mm/kasan/kasan.c:260 [inline] check_memory_region+0x13c/0x1b0 mm/kasan/kasan.c:267 kasan_check_write+0x14/0x20 mm/kasan/kasan.c:278 atomic_dec_and_test include/asm-generic/atomic-instrumented.h:259 [inline] hci_conn_drop include/net/bluetooth/hci_core.h:972 [inline] sco_chan_del+0xe0/0x3d0 net/bluetooth/sco.c:148 __sco_sock_close+0x2e6/0x510 net/bluetooth/sco.c:433 sco_sock_close+0x26/0x40 net/bluetooth/sco.c:447 sco_sock_release+0x43/0x200 net/bluetooth/sco.c:1008 __sock_release+0xc2/0x290 net/socket.c:579 sock_close+0x10/0x20 net/socket.c:1140 __fput+0x249/0x7f0 fs/file_table.c:278 ____fput+0x9/0x10 fs/file_table.c:309 task_work_run+0x108/0x180 kernel/task_work.c:113 get_signal+0x1359/0x1970 kernel/signal.c:2400 do_signal+0x87/0x1860 arch/x86/kernel/signal.c:821 exit_to_usermode_loop+0x159/0x1e0 arch/x86/entry/common.c:163 prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline] syscall_return_slowpath arch/x86/entry/common.c:271 [inline] do_syscall_64+0x413/0x4e0 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45ccd9 Code: 2d b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 fb b5 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f18301e3c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002a RAX: fffffffffffffffc RBX: 0000000000002140 RCX: 000000000045ccd9 RDX: 0000000000000008 RSI: 00000000200000c0 RDI: 0000000000000004 RBP: 000000000078bf40 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000078bf0c R13: 00007ffc6376d8bf R14: 00007f18301e49c0 R15: 000000000078bf0c Allocated by task 7313: 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_conn_add+0x55/0x1130 net/bluetooth/hci_conn.c:501 hci_connect_sco+0x1a3/0x680 net/bluetooth/hci_conn.c:1238 sco_connect net/bluetooth/sco.c:240 [inline] sco_sock_connect+0x244/0x820 net/bluetooth/sco.c:576 __sys_connect+0x20d/0x2d0 net/socket.c:1663 __do_sys_connect net/socket.c:1674 [inline] __se_sys_connect net/socket.c:1671 [inline] __x64_sys_connect+0x6e/0xb0 net/socket.c:1671 do_syscall_64+0xd0/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 7277: 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 bt_link_release+0x10/0x20 net/bluetooth/hci_sysfs.c:14 device_release+0x71/0x1d0 drivers/base/core.c:1061 kobject_cleanup lib/kobject.c:662 [inline] kobject_release lib/kobject.c:691 [inline] kref_put include/linux/kref.h:70 [inline] kobject_put+0x115/0x1f0 lib/kobject.c:708 put_device+0x12/0x20 drivers/base/core.c:2251 hci_conn_put include/net/bluetooth/hci_core.h:957 [inline] hci_conn_cleanup+0x2cc/0x520 net/bluetooth/hci_conn.c:134 hci_conn_del+0x220/0x5f0 net/bluetooth/hci_conn.c:611 hci_phy_link_complete_evt.isra.126+0x494/0x650 net/bluetooth/hci_event.c:4676 hci_event_packet+0x2b8e/0x7215 net/bluetooth/hci_event.c:5911 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 ffff8881d60beb40 which belongs to the cache kmalloc-4096 of size 4096 The buggy address is located 16 bytes inside of 4096-byte region [ffff8881d60beb40, ffff8881d60bfb40) The buggy address belongs to the page: page:ffffea0007582f80 count:1 mapcount:0 mapping:ffff8881f6400dc0 index:0x0 compound_mapcount: 0 flags: 0x17ffe0000008100(slab|head) raw: 017ffe0000008100 ffffea0007583188 ffffea000759cb88 ffff8881f6400dc0 raw: 0000000000000000 ffff8881d60beb40 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881d60bea00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881d60bea80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8881d60beb00: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ^ ffff8881d60beb80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881d60bec00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================