bisecting fixing commit since 291009f656e8eaebbdfd3a8d99f6b190a9ce9deb building syzkaller on a52ee10ae11c1342cfca60cf3957619bcf92bd1a testing commit 291009f656e8eaebbdfd3a8d99f6b190a9ce9deb with gcc (GCC) 10.2.1 20210217 kernel signature: 1ef186fdf3b441ce865fe65f74af12a41fe3782ad94651aad6f64371cb923f45 all runs: crashed: KASAN: use-after-free Read in v4l2_fh_init testing current HEAD f296bfd5cd04cbb49b8fc9585adc280ab2b58624 testing commit f296bfd5cd04cbb49b8fc9585adc280ab2b58624 with gcc (GCC) 10.2.1 20210217 kernel signature: 86c33489af710a9c4d8ad79f2484dc13ad8069d62356eb9922e1415c20f81982 all runs: crashed: KASAN: use-after-free Read in v4l2_fh_init revisions tested: 2, total time: 20m10.244679198s (build: 12m39.647129877s, test: 6m57.321436492s) the crash still happens on HEAD commit msg: Merge tag 'nfs-for-5.12-2' of git://git.linux-nfs.org/projects/anna/linux-nfs crash: KASAN: use-after-free Read in v4l2_fh_init ================================================================== BUG: KASAN: use-after-free in v4l2_fh_init+0x274/0x2c0 drivers/media/v4l2-core/v4l2-fh.c:25 Read of size 8 at addr ffff8880165148b8 by task v4l_id/10112 CPU: 0 PID: 10112 Comm: v4l_id Not tainted 5.12.0-rc2-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:79 [inline] dump_stack+0x93/0xc2 lib/dump_stack.c:120 print_address_description.constprop.0.cold+0x5b/0x2f8 mm/kasan/report.c:232 __kasan_report mm/kasan/report.c:399 [inline] kasan_report.cold+0x7c/0xd8 mm/kasan/report.c:416 v4l2_fh_init+0x274/0x2c0 drivers/media/v4l2-core/v4l2-fh.c:25 v4l2_fh_open+0x78/0xb0 drivers/media/v4l2-core/v4l2-fh.c:63 em28xx_v4l2_open+0xd6/0x430 drivers/media/usb/em28xx/em28xx-video.c:2163 v4l2_open+0x1e3/0x370 drivers/media/v4l2-core/v4l2-dev.c:428 chrdev_open+0x20f/0x650 fs/char_dev.c:414 do_dentry_open+0x42a/0xfb0 fs/open.c:826 do_open fs/namei.c:3365 [inline] path_openat+0x9ee/0x22b0 fs/namei.c:3498 do_filp_open+0x16d/0x390 fs/namei.c:3525 do_sys_openat2+0x11e/0x360 fs/open.c:1187 do_sys_open fs/open.c:1203 [inline] __do_sys_open fs/open.c:1211 [inline] __se_sys_open fs/open.c:1207 [inline] __x64_sys_open+0xfd/0x1a0 fs/open.c:1207 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7fdf48ba9840 Code: 73 01 c3 48 8b 0d 68 77 20 00 f7 d8 64 89 01 48 83 c8 ff c3 66 0f 1f 44 00 00 83 3d 89 bb 20 00 00 75 10 b8 02 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 31 c3 48 83 ec 08 e8 1e f6 ff ff 48 89 04 24 RSP: 002b:00007ffe9d14e2b8 EFLAGS: 00000246 ORIG_RAX: 0000000000000002 RAX: ffffffffffffffda RBX: 00007ffe9d14e428 RCX: 00007fdf48ba9840 RDX: 00007fdf48b95ea0 RSI: 0000000000000000 RDI: 00007ffe9d14ff1f RBP: 0000000000000003 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000002 R11: 0000000000000246 R12: 000055c1339c38d0 R13: 00007ffe9d14e420 R14: 0000000000000000 R15: 0000000000000000 The buggy address belongs to the page: page:00000000aa5248e2 refcount:0 mapcount:-128 mapping:0000000000000000 index:0x0 pfn:0x16514 flags: 0xfff00000000000() raw: 00fff00000000000 ffffea000099eb08 ffffea0000ef4c08 0000000000000000 raw: 0000000000000000 0000000000000002 00000000ffffff7f 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888016514780: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888016514800: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888016514880: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888016514900: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888016514980: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================