bisecting fixing commit since 811218eceeaa7618652e1b8d11caeff67ab42072 building syzkaller on a52ee10ae11c1342cfca60cf3957619bcf92bd1a testing commit 811218eceeaa7618652e1b8d11caeff67ab42072 with gcc (GCC) 8.4.1 20210217 kernel signature: 0ab2501262b59e92e6b1ade8efa3adb47901c110c06ce4a52d6c32445f68d284 all runs: crashed: KASAN: use-after-free Read in chrdev_open testing current HEAD 3c8c23092588a23bf1856a64f58c37f477a413be testing commit 3c8c23092588a23bf1856a64f58c37f477a413be with gcc (GCC) 8.4.1 20210217 kernel signature: e1e757963ca39177a846474414e5d3ddaac5befb41b5644049db875597ec20bc all runs: crashed: KASAN: use-after-free Read in chrdev_open revisions tested: 2, total time: 23m45.575917428s (build: 16m44.236131327s, test: 6m41.038398076s) the crash still happens on HEAD commit msg: Linux 4.19.190 crash: KASAN: use-after-free Read in chrdev_open wlan1: Creating new IBSS network, BSSID 50:50:50:50:50:50 IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready ================================================================== BUG: KASAN: use-after-free in __list_add_valid+0x7d/0xb0 lib/list_debug.c:23 Read of size 8 at addr ffff88808135ec00 by task syz-executor.0/10067 CPU: 0 PID: 10067 Comm: syz-executor.0 Not tainted 4.19.190-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:0x465b09 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:00007f5a80188188 EFLAGS: 00000246 ORIG_RAX: 0000000000000055 RAX: ffffffffffffffda RBX: 000000000056c158 RCX: 0000000000465b09 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 00000000200001c0 RBP: 00000000004b069f R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056c158 R13: 00007ffc4b2c884f R14: 00007f5a80188300 R15: 0000000000022000 Allocated by task 9991: 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 9: 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 ffff88808135e880 which belongs to the cache fuse_inode of size 1264 The buggy address is located 896 bytes inside of 1264-byte region [ffff88808135e880, ffff88808135ed70) The buggy address belongs to the page: page:ffffea000204d780 count:1 mapcount:0 mapping:ffff8882396e0e00 index:0xffff88808135effe flags: 0xfff00000000100(slab) raw: 00fff00000000100 ffffea000204d508 ffffea000204cec8 ffff8882396e0e00 raw: ffff88808135effe ffff88808135e300 0000000100000002 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88808135eb00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88808135eb80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88808135ec00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88808135ec80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88808135ed00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc ==================================================================