================================================================== BUG: KASAN: use-after-free in v4l2_fh_init drivers/media/v4l2-core/v4l2-fh.c:25 [inline] BUG: KASAN: use-after-free in v4l2_fh_open+0xc6/0x430 drivers/media/v4l2-core/v4l2-fh.c:63 Read of size 8 at addr ffff88802a87c900 by task v4l_id/4682 CPU: 1 PID: 4682 Comm: v4l_id Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/18/2025 Call Trace: dump_stack_lvl+0x168/0x230 lib/dump_stack.c:106 print_address_description+0x60/0x2d0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0xdf/0x130 mm/kasan/report.c:451 v4l2_fh_init drivers/media/v4l2-core/v4l2-fh.c:25 [inline] v4l2_fh_open+0xc6/0x430 drivers/media/v4l2-core/v4l2-fh.c:63 em28xx_v4l2_open+0x152/0x990 drivers/media/usb/em28xx/em28xx-video.c:2163 v4l2_open+0x20b/0x360 drivers/media/v4l2-core/v4l2-dev.c:427 chrdev_open+0x597/0x670 fs/char_dev.c:414 do_dentry_open+0x7ff/0xf80 fs/open.c:826 do_open fs/namei.c:3608 [inline] path_openat+0x2682/0x2f30 fs/namei.c:3742 do_filp_open+0x1b3/0x3e0 fs/namei.c:3769 do_sys_openat2+0x142/0x4a0 fs/open.c:1253 do_sys_open fs/open.c:1269 [inline] __do_sys_openat fs/open.c:1285 [inline] __se_sys_openat fs/open.c:1280 [inline] __x64_sys_openat+0x135/0x160 fs/open.c:1280 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7f7ca49b1407 Code: 48 89 fa 4c 89 df e8 38 aa 00 00 8b 93 08 03 00 00 59 5e 48 83 f8 fc 74 1a 5b c3 0f 1f 84 00 00 00 00 00 48 8b 44 24 10 0f 05 <5b> c3 0f 1f 80 00 00 00 00 83 e2 39 83 fa 08 75 de e8 23 ff ff ff RSP: 002b:00007ffea3d516f0 EFLAGS: 00000202 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007f7ca48c3880 RCX: 00007f7ca49b1407 RDX: 0000000000000000 RSI: 00007ffea3d52f1c RDI: ffffffffffffff9c RBP: 0000000000000002 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000000 R13: 00007ffea3d51940 R14: 00007f7ca513f000 R15: 000055b4b1c3a4d8 The buggy address belongs to the page: page:ffffea0000aa1f00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2a87c flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 0000000000000000 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x100cc0(GFP_USER), pid 4652, ts 116621054078, free_ts 116552008527 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x1b77/0x1c60 mm/page_alloc.c:4192 __alloc_pages+0x1e1/0x470 mm/page_alloc.c:5487 __get_free_pages+0x8/0x30 mm/page_alloc.c:5524 kasan_populate_vmalloc_pte+0x21/0xc0 mm/kasan/shadow.c:266 apply_to_pte_range mm/memory.c:2573 [inline] apply_to_pmd_range mm/memory.c:2617 [inline] apply_to_pud_range mm/memory.c:2653 [inline] apply_to_p4d_range mm/memory.c:2689 [inline] __apply_to_page_range+0x983/0xd10 mm/memory.c:2725 alloc_vmap_area+0x19f7/0x1b20 mm/vmalloc.c:1572 __get_vm_area_node+0x14f/0x2d0 mm/vmalloc.c:2430 __vmalloc_node_range+0xef/0x8b0 mm/vmalloc.c:3027 alloc_thread_stack_node kernel/fork.c:246 [inline] dup_task_struct+0x3f5/0xb30 kernel/fork.c:899 copy_process+0x5b3/0x3e00 kernel/fork.c:2121 kernel_clone+0x219/0x930 kernel/fork.c:2679 __do_sys_clone3 kernel/fork.c:2954 [inline] __se_sys_clone3+0x2d5/0x360 kernel/fork.c:2938 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1340 [inline] free_pcp_prepare mm/page_alloc.c:1391 [inline] free_unref_page_prepare+0x637/0x6c0 mm/page_alloc.c:3317 free_unref_page+0x94/0x280 mm/page_alloc.c:3396 stack_depot_save+0x418/0x440 lib/stackdepot.c:335 kasan_save_stack mm/kasan/common.c:40 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc mm/kasan/common.c:513 [inline] __kasan_kmalloc+0xcc/0xf0 mm/kasan/common.c:522 kmalloc include/linux/slab.h:604 [inline] kzalloc include/linux/slab.h:735 [inline] class_dir_create_and_add drivers/base/core.c:2957 [inline] get_device_parent+0x2d6/0x3f0 drivers/base/core.c:3021 device_add+0x335/0xfb0 drivers/base/core.c:3333 input_register_device+0xa5b/0x1140 drivers/input/input.c:2412 em28xx_register_snapshot_button+0x2d8/0x460 drivers/media/usb/em28xx/em28xx-input.c:610 em28xx_init_buttons drivers/media/usb/em28xx/em28xx-input.c:648 [inline] em28xx_ir_init+0x625/0x1db0 drivers/media/usb/em28xx/em28xx-input.c:715 em28xx_init_extension+0x118/0x1b0 drivers/media/usb/em28xx/em28xx-core.c:1126 process_one_work+0x863/0x1000 kernel/workqueue.c:2310 worker_thread+0xaa8/0x12a0 kernel/workqueue.c:2457 kthread+0x436/0x520 kernel/kthread.c:334 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 Memory state around the buggy address: ffff88802a87c800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88802a87c880: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88802a87c900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff88802a87c980: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88802a87ca00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================