bisecting fixing commit since 258f0cf7ac3b788a14c0d01aab3c4aea02f8c86e building syzkaller on 37bccd4ed9e71025cd84e857f9ffca4ec8451c6b testing commit 258f0cf7ac3b788a14c0d01aab3c4aea02f8c86e with gcc (GCC) 8.1.0 kernel signature: 45585ee43e84a3d90e24190f36ac3849d83d68cf892756cdbd25ac3542f21817 run #0: crashed: KASAN: use-after-free Read in l2cap_chan_close run #1: crashed: KASAN: use-after-free Write in ex_handler_refcount run #2: crashed: KASAN: use-after-free Read in l2cap_chan_close run #3: crashed: KASAN: use-after-free Read in l2cap_chan_close run #4: crashed: KASAN: use-after-free Read in l2cap_chan_close run #5: crashed: KASAN: use-after-free Write in ex_handler_refcount run #6: crashed: KASAN: use-after-free Read in l2cap_chan_close run #7: basic kernel testing failed: failed to copy test binary to VM: failed to run ["scp" "-P" "22" "-F" "/dev/null" "-o" "UserKnownHostsFile=/dev/null" "-o" "BatchMode=yes" "-o" "IdentitiesOnly=yes" "-o" "StrictHostKeyChecking=no" "-o" "ConnectTimeout=10" "-i" "/syzkaller/jobs/linux/workdir/image/key" "/tmp/syz-executor496288432" "root@10.128.1.46:./syz-executor496288432"]: exit status 1 Connection timed out during banner exchange lost connection run #8: basic kernel testing failed: failed to copy test binary to VM: failed to run ["scp" "-P" "22" "-F" "/dev/null" "-o" "UserKnownHostsFile=/dev/null" "-o" "BatchMode=yes" "-o" "IdentitiesOnly=yes" "-o" "StrictHostKeyChecking=no" "-o" "ConnectTimeout=10" "-i" "/syzkaller/jobs/linux/workdir/image/key" "/tmp/syz-executor676461922" "root@10.128.0.47:./syz-executor676461922"]: exit status 1 Connection timed out during banner exchange lost connection run #9: OK testing current HEAD 3fc898571b974f9a05e4e5c1fe17b18548207091 testing commit 3fc898571b974f9a05e4e5c1fe17b18548207091 with gcc (GCC) 8.1.0 kernel signature: 8efadc95662b8696383b0e587c44fd6faac050618a965dc17692733f72367805 run #0: crashed: KASAN: use-after-free Read in l2cap_chan_close run #1: crashed: KASAN: use-after-free Read in l2cap_chan_close run #2: crashed: KASAN: use-after-free Write in ex_handler_refcount run #3: crashed: KASAN: use-after-free Read in l2cap_chan_close run #4: crashed: KASAN: use-after-free Write in ex_handler_refcount run #5: crashed: KASAN: use-after-free Read in l2cap_chan_close run #6: crashed: KASAN: use-after-free Read in l2cap_chan_close run #7: crashed: KASAN: use-after-free Read in l2cap_chan_close run #8: crashed: KASAN: use-after-free Write in ex_handler_refcount run #9: crashed: KASAN: use-after-free Write in ex_handler_refcount revisions tested: 2, total time: 32m43.940980295s (build: 17m26.767187289s, test: 14m39.77689714s) the crash still happens on HEAD commit msg: Linux 4.19.128 crash: KASAN: use-after-free Write in ex_handler_refcount IPv6: ADDRCONF(NETDEV_CHANGE): veth1_to_batadv: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): batadv_slave_1: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): veth1_to_batadv: link becomes ready Bluetooth: psm cannot be added err -98 ================================================================== BUG: KASAN: use-after-free in ex_handler_refcount+0x141/0x180 arch/x86/mm/extable.c:49 Write of size 4 at addr ffff88808b745258 by task kworker/1:1/24 CPU: 1 PID: 24 Comm: kworker/1:1 Not tainted 4.19.128-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: events do_enable_set Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x123/0x177 lib/dump_stack.c:118 print_address_description.cold.8+0x9/0x1ff mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report.cold.9+0x242/0x309 mm/kasan/report.c:412 __asan_report_store4_noabort+0x17/0x20 mm/kasan/report.c:437 ex_handler_refcount+0x141/0x180 arch/x86/mm/extable.c:49 fixup_exception+0x7c/0xb3 arch/x86/mm/extable.c:197 do_trap_no_signal arch/x86/kernel/traps.c:209 [inline] do_trap+0x63/0x240 arch/x86/kernel/traps.c:258 do_error_trap+0x189/0x350 arch/x86/kernel/traps.c:303 do_invalid_op+0x1b/0x20 arch/x86/kernel/traps.c:316 invalid_op+0x14/0x20 arch/x86/entry/entry_64.S:1038 RIP: 0010:csum_partial_copy_generic+0x63f9/0x83a7 Code: 0b 48 8d 8f 80 00 00 00 0f 0b 48 8d 8b 80 00 00 00 0f 0b 48 8d 0f 0f 0b 48 8d 0f 0f 0b 48 8d 8f b8 02 00 00 0f 0b 48 8d 4f 18 <0f> 0b 48 8d 8f b8 02 00 00 0f 0b 48 8d 4b 18 0f 0b 48 8d 4b 18 0f RSP: 0018:ffff8880a99ffc40 EFLAGS: 00010296 RAX: 0000000000000000 RBX: dffffc0000000000 RCX: ffff88808b745258 RDX: 1ffffffff0f9aacb RSI: 0000000000000000 RDI: ffff88808b745240 RBP: ffff8880a99ffc40 R08: fffffbfff1210571 R09: fffffbfff1210570 R10: fffffbfff1210570 R11: ffffffff89082b83 R12: ffff8880a99ffd30 R13: ffff8880a99ffcb0 R14: ffff8880a99ffcb0 R15: ffff8880a99ffcb0 do_enable_set+0x48a/0x8b0 net/bluetooth/6lowpan.c:1087 process_one_work+0x830/0x1670 kernel/workqueue.c:2155 worker_thread+0x85/0xb60 kernel/workqueue.c:2298 kthread+0x324/0x3e0 kernel/kthread.c:246 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415 Allocated by task 2862: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:553 kmem_cache_alloc_trace+0x152/0x740 mm/slab.c:3625 kmalloc include/linux/slab.h:515 [inline] kzalloc include/linux/slab.h:709 [inline] l2cap_chan_create+0x41/0x340 net/bluetooth/l2cap_core.c:441 chan_create+0xa/0xc0 net/bluetooth/6lowpan.c:652 bt_6lowpan_listen net/bluetooth/6lowpan.c:971 [inline] do_enable_set+0x4af/0x8b0 net/bluetooth/6lowpan.c:1090 process_one_work+0x830/0x1670 kernel/workqueue.c:2155 worker_thread+0x85/0xb60 kernel/workqueue.c:2298 kthread+0x324/0x3e0 kernel/kthread.c:246 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415 Freed by task 2862: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] __kasan_slab_free+0x102/0x150 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 l2cap_chan_destroy+0x132/0x1a0 net/bluetooth/l2cap_core.c:479 kref_put include/linux/kref.h:70 [inline] l2cap_chan_put+0x1e/0x20 net/bluetooth/l2cap_core.c:493 do_enable_set+0x48a/0x8b0 net/bluetooth/6lowpan.c:1087 process_one_work+0x830/0x1670 kernel/workqueue.c:2155 worker_thread+0x85/0xb60 kernel/workqueue.c:2298 kthread+0x324/0x3e0 kernel/kthread.c:246 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415 The buggy address belongs to the object at ffff88808b745240 which belongs to the cache kmalloc-2048 of size 2048 The buggy address is located 24 bytes inside of 2048-byte region [ffff88808b745240, ffff88808b745a40) The buggy address belongs to the page: page:ffffea00022dd100 count:1 mapcount:0 mapping:ffff88812c29cc40 index:0x0 compound_mapcount: 0 flags: 0xfffe0000008100(slab|head) raw: 00fffe0000008100 ffffea0002951588 ffffea00022d1b88 ffff88812c29cc40 raw: 0000000000000000 ffff88808b744140 0000000100000003 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88808b745100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88808b745180: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff88808b745200: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ^ ffff88808b745280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88808b745300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================