================================================================== 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 ffff888079c94900 by task v4l_id/4440 CPU: 1 PID: 4440 Comm: v4l_id Not tainted 5.15.184-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/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:0x7f8153cbc407 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:00007ffee1551700 EFLAGS: 00000202 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007f8153bce880 RCX: 00007f8153cbc407 RDX: 0000000000000000 RSI: 00007ffee1551f1d RDI: ffffffffffffff9c RBP: 0000000000000002 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000000 R13: 00007ffee1551950 R14: 00007f815444a000 R15: 000056030284c4d8 The buggy address belongs to the page: page:ffffea0001e72500 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x79c94 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 ffffea0000a96c08 ffff8880b91409b0 0000000000000000 raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 2, migratetype Unmovable, gfp_mask 0x140dc0(GFP_USER|__GFP_COMP|__GFP_ZERO), pid 4212, ts 80631738801, free_ts 81334508344 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:5466 kmalloc_order+0x40/0x150 mm/slab_common.c:986 kmalloc_order_trace+0x14/0xf0 mm/slab_common.c:1002 kmalloc_large include/linux/slab.h:533 [inline] kmalloc include/linux/slab.h:597 [inline] kzalloc include/linux/slab.h:735 [inline] em28xx_v4l2_init+0xe2/0x2e50 drivers/media/usb/em28xx/em28xx-video.c:2542 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 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 free_nonslab_page+0xe2/0x150 mm/slub.c:3535 em28xx_free_v4l2 drivers/media/usb/em28xx/em28xx-video.c:2128 [inline] kref_put include/linux/kref.h:65 [inline] em28xx_v4l2_init+0x1649/0x2e50 drivers/media/usb/em28xx/em28xx-video.c:2911 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: ffff888079c94800: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888079c94880: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888079c94900: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888079c94980: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888079c94a00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================