================================================================== BUG: KASAN: use-after-free in v4l2_fh_init+0x279/0x2c0 drivers/media/v4l2-core/v4l2-fh.c:25 Read of size 8 at addr ffff88801eee08b8 by task v4l_id/9107 CPU: 1 PID: 9107 Comm: v4l_id Not tainted 5.12.0-rc4-next-20210326-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+0x141/0x1d7 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+0x279/0x2c0 drivers/media/v4l2-core/v4l2-fh.c:25 v4l2_fh_open+0x88/0xc0 drivers/media/v4l2-core/v4l2-fh.c:63 em28xx_v4l2_open+0x11c/0x570 drivers/media/usb/em28xx/em28xx-video.c:2163 v4l2_open+0x21c/0x3f0 drivers/media/v4l2-core/v4l2-dev.c:429 chrdev_open+0x266/0x770 fs/char_dev.c:414 do_dentry_open+0x4b9/0x11b0 fs/open.c:826 do_open fs/namei.c:3359 [inline] path_openat+0x1c0e/0x27e0 fs/namei.c:3492 do_filp_open+0x17e/0x3c0 fs/namei.c:3519 do_sys_openat2+0x16d/0x420 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+0x119/0x1c0 fs/open.c:1207 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f8597eb3840 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:00007ffc5a835b18 EFLAGS: 00000246 ORIG_RAX: 0000000000000002 RAX: ffffffffffffffda RBX: 00007ffc5a835c88 RCX: 00007f8597eb3840 RDX: 00007f8597e9fea0 RSI: 0000000000000000 RDI: 00007ffc5a835f1f RBP: 0000000000000003 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000002 R11: 0000000000000246 R12: 000055cc51aa48d0 R13: 00007ffc5a835c80 R14: 0000000000000000 R15: 0000000000000000 The buggy address belongs to the page: page:ffffea00007bb800 refcount:0 mapcount:-128 mapping:0000000000000000 index:0x0 pfn:0x1eee0 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 ffffea0000900708 ffff88813fffb910 0000000000000000 raw: 0000000000000000 0000000000000002 00000000ffffff7f 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88801eee0780: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88801eee0800: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88801eee0880: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88801eee0900: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88801eee0980: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================