bisecting fixing commit since a89b48fe9308d976d9dcb2112e264d647f7efce4 building syzkaller on c585c7b0ea16dc4326bf5e8f2f00cc6638e2feb1 testing commit a89b48fe9308d976d9dcb2112e264d647f7efce4 compiler: gcc version 8.4.1 20210217 (GCC) kernel signature: 565e71f8a5714778f424f64826edc2fcb9bec35325f943aa57bec572be2ca4af run #0: crashed: KASAN: use-after-free Read in cd_forget run #1: crashed: KASAN: use-after-free Read in chrdev_open run #2: crashed: KASAN: use-after-free Read in chrdev_open run #3: crashed: KASAN: use-after-free Read in chrdev_open run #4: crashed: KASAN: use-after-free Read in chrdev_open run #5: crashed: KASAN: use-after-free Read in chrdev_open run #6: crashed: KASAN: use-after-free Read in chrdev_open run #7: crashed: KASAN: use-after-free Read in chrdev_open run #8: crashed: KASAN: use-after-free Read in chrdev_open run #9: crashed: KASAN: use-after-free Read in chrdev_open run #10: crashed: KASAN: use-after-free Read in chrdev_open run #11: crashed: KASAN: use-after-free Read in chrdev_open run #12: crashed: KASAN: use-after-free Read in chrdev_open run #13: crashed: KASAN: use-after-free Read in chrdev_open run #14: crashed: KASAN: use-after-free Read in chrdev_open run #15: crashed: KASAN: use-after-free Read in chrdev_open run #16: crashed: KASAN: use-after-free Read in chrdev_open run #17: crashed: KASAN: use-after-free Read in chrdev_open run #18: crashed: KASAN: use-after-free Read in chrdev_open run #19: crashed: KASAN: use-after-free Read in chrdev_open testing current HEAD 3f8a27f9e27bd78604c0709224cec0ec85a8b106 testing commit 3f8a27f9e27bd78604c0709224cec0ec85a8b106 compiler: gcc version 8.4.1 20210217 (GCC) kernel signature: b71cef70914afd1d50fbe21cbc028b3b27881b9a9471de04e8317dda6462f79d all runs: crashed: KASAN: use-after-free Read in chrdev_open revisions tested: 2, total time: 28m46.812846189s (build: 21m25.370021878s, test: 6m43.753508869s) the crash still happens on HEAD commit msg: Linux 4.19.211 crash: KASAN: use-after-free Read in chrdev_open IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready IPv6: ADDRCONF(NETDEV_UP): wlan1: link is not ready IPv6: ADDRCONF(NETDEV_UP): wlan1: link is not ready wlan0: Created IBSS using preconfigured BSSID 50:50:50:50:50:50 ================================================================== BUG: KASAN: use-after-free in __list_add_valid+0x7d/0xb0 lib/list_debug.c:23 wlan0: Creating new IBSS network, BSSID 50:50:50:50:50:50 Read of size 8 at addr ffff8880805cd980 by task syz-executor.2/9951 CPU: 1 PID: 9951 Comm: syz-executor.2 Not tainted 4.19.211-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/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_add_valid+0x7d/0xb0 lib/list_debug.c:23 __list_add include/linux/list.h:60 [inline] list_add include/linux/list.h:79 [inline] chrdev_open+0x382/0x5c0 fs/char_dev.c:405 do_dentry_open+0x3f1/0x1020 fs/open.c:796 vfs_open+0x9a/0xc0 fs/open.c:902 do_last fs/namei.c:3421 [inline] path_openat+0x925/0x2900 fs/namei.c:3537 do_filp_open+0x177/0x250 fs/namei.c:3567 do_sys_open+0x1dc/0x350 fs/open.c:1085 ksys_open include/linux/syscalls.h:1276 [inline] __do_sys_creat fs/open.c:1143 [inline] __se_sys_creat fs/open.c:1141 [inline] __x64_sys_creat+0x5c/0x80 fs/open.c:1141 do_syscall_64+0xd0/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x4665e9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f590f7a9188 EFLAGS: 00000246 ORIG_RAX: 0000000000000055 RAX: ffffffffffffffda RBX: 000000000056c038 RCX: 00000000004665e9 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000140 RBP: 00000000004bfcc4 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056c038 R13: 00007fff24d669df R14: 00007f590f7a9300 R15: 0000000000022000 Allocated by task 9934: 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 kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:490 kmem_cache_alloc+0x12e/0x390 mm/slab.c:3559 fuse_alloc_inode+0x1c/0x3b0 fs/fuse/inode.c:87 alloc_inode+0x56/0x150 fs/inode.c:211 iget5_locked fs/inode.c:1131 [inline] iget5_locked+0x4b/0xb0 fs/inode.c:1124 fuse_iget+0x196/0x700 fs/fuse/inode.c:307 fuse_lookup_name+0x343/0x590 fs/fuse/dir.c:341 fuse_lookup+0xf3/0x3b0 fs/fuse/dir.c:368 fuse_atomic_open+0x197/0x2f0 fs/fuse/dir.c:508 atomic_open fs/namei.c:3073 [inline] lookup_open+0xde5/0x1d00 fs/namei.c:3205 do_last fs/namei.c:3327 [inline] path_openat+0xf26/0x2900 fs/namei.c:3537 do_filp_open+0x177/0x250 fs/namei.c:3567 do_sys_open+0x1dc/0x350 fs/open.c:1085 ksys_open include/linux/syscalls.h:1276 [inline] __do_sys_creat fs/open.c:1143 [inline] __se_sys_creat fs/open.c:1141 [inline] __x64_sys_creat+0x5c/0x80 fs/open.c:1141 do_syscall_64+0xd0/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 3687: 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] kmem_cache_free+0x83/0x290 mm/slab.c:3765 fuse_i_callback+0x17/0x20 fs/fuse/inode.c:116 __rcu_reclaim kernel/rcu/rcu.h:236 [inline] rcu_do_batch kernel/rcu/tree.c:2584 [inline] invoke_rcu_callbacks kernel/rcu/tree.c:2897 [inline] __rcu_process_callbacks kernel/rcu/tree.c:2864 [inline] rcu_process_callbacks+0x93a/0x19b0 kernel/rcu/tree.c:2881 __do_softirq+0x25f/0x919 kernel/softirq.c:292 The buggy address belongs to the object at ffff8880805cd600 which belongs to the cache fuse_inode of size 1264 The buggy address is located 896 bytes inside of 1264-byte region [ffff8880805cd600, ffff8880805cdaf0) The buggy address belongs to the page: page:ffffea0002017340 count:1 mapcount:0 mapping:ffff8880b0eb6900 index:0xffff8880805cdffe flags: 0xfff00000000100(slab) raw: 00fff00000000100 ffffea0002016048 ffffea0002018648 ffff8880b0eb6900 raw: ffff8880805cdffe ffff8880805cd080 0000000100000002 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880805cd880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880805cd900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880805cd980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880805cda00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880805cda80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc ==================================================================