================================================================== 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 ffff8881cddb88c8 by task v4l_id/381 CPU: 1 PID: 381 Comm: v4l_id Not tainted 5.7.0-rc6-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+0xef/0x16e lib/dump_stack.c:118 print_address_description.constprop.0.cold+0xd3/0x415 mm/kasan/report.c:382 __kasan_report.cold+0x37/0x7d mm/kasan/report.c:511 kasan_report+0x33/0x50 mm/kasan/common.c:625 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+0x11a/0x570 drivers/media/usb/em28xx/em28xx-video.c:2163 v4l2_open+0x20f/0x3d0 drivers/media/v4l2-core/v4l2-dev.c:423 chrdev_open+0x219/0x5c0 fs/char_dev.c:414 do_dentry_open+0x4ac/0x1160 fs/open.c:797 do_open fs/namei.c:3229 [inline] path_openat+0x1a0b/0x2740 fs/namei.c:3346 do_filp_open+0x192/0x260 fs/namei.c:3373 do_sys_openat2+0x585/0x7d0 fs/open.c:1148 do_sys_open+0xc3/0x140 fs/open.c:1164 do_syscall_64+0xb6/0x5a0 arch/x86/entry/common.c:295 entry_SYSCALL_64_after_hwframe+0x49/0xb3 RIP: 0033:0x7f6bcd693840 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:00007ffcdb1d05b8 EFLAGS: 00000246 ORIG_RAX: 0000000000000002 RAX: ffffffffffffffda RBX: 00007ffcdb1d0728 RCX: 00007f6bcd693840 RDX: 00007f6bcd67fea0 RSI: 0000000000000000 RDI: 00007ffcdb1d1f25 RBP: 0000000000000003 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000002 R11: 0000000000000246 R12: 000055891b31b8d0 R13: 00007ffcdb1d0720 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 137: save_stack+0x1b/0x40 mm/kasan/common.c:49 set_track mm/kasan/common.c:57 [inline] __kasan_kmalloc mm/kasan/common.c:495 [inline] __kasan_kmalloc.constprop.0+0xbf/0xd0 mm/kasan/common.c:468 slab_post_alloc_hook mm/slab.h:586 [inline] slab_alloc_node mm/slub.c:2797 [inline] slab_alloc mm/slub.c:2805 [inline] kmem_cache_alloc+0xd8/0x300 mm/slub.c:2810 getname_flags fs/namei.c:138 [inline] getname_flags+0xd2/0x5b0 fs/namei.c:128 user_path_at_empty+0x2a/0x50 fs/namei.c:2632 user_path_at include/linux/namei.h:59 [inline] do_faccessat+0x248/0x7a0 fs/open.c:398 do_syscall_64+0xb6/0x5a0 arch/x86/entry/common.c:295 entry_SYSCALL_64_after_hwframe+0x49/0xb3 Freed by task 137: save_stack+0x1b/0x40 mm/kasan/common.c:49 set_track mm/kasan/common.c:57 [inline] kasan_set_free_info mm/kasan/common.c:317 [inline] __kasan_slab_free+0x117/0x160 mm/kasan/common.c:456 slab_free_hook mm/slub.c:1455 [inline] slab_free_freelist_hook mm/slub.c:1488 [inline] slab_free mm/slub.c:3045 [inline] kmem_cache_free+0x9b/0x360 mm/slub.c:3061 putname+0xe1/0x120 fs/namei.c:259 filename_lookup+0x282/0x3e0 fs/namei.c:2362 user_path_at include/linux/namei.h:59 [inline] do_faccessat+0x248/0x7a0 fs/open.c:398 do_syscall_64+0xb6/0x5a0 arch/x86/entry/common.c:295 entry_SYSCALL_64_after_hwframe+0x49/0xb3 The buggy address belongs to the object at ffff8881cddb8000 which belongs to the cache names_cache of size 4096 The buggy address is located 2248 bytes inside of 4096-byte region [ffff8881cddb8000, ffff8881cddb9000) The buggy address belongs to the page: page:ffffea0007376e00 refcount:1 mapcount:0 mapping:00000000b8cf32e4 index:0x0 head:ffffea0007376e00 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x200000000010200(slab|head) raw: 0200000000010200 dead000000000100 dead000000000122 ffff8881da11e000 raw: 0000000000000000 0000000000070007 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881cddb8780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881cddb8800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8881cddb8880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881cddb8900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881cddb8980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================