================================================================== BUG: KASAN: use-after-free in v4l2_open+0x32d/0x340 drivers/media/v4l2-core/v4l2-dev.c:432 Read of size 4 at addr ffff88807dcbc9b0 by task v4l_id/5396 CPU: 1 PID: 5396 Comm: v4l_id Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/09/2026 Call Trace: dump_stack_lvl+0x188/0x250 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_open+0x32d/0x340 drivers/media/v4l2-core/v4l2-dev.c:432 chrdev_open+0x585/0x5f0 fs/char_dev.c:414 do_dentry_open+0x7f7/0xf90 fs/open.c:826 do_open fs/namei.c:3616 [inline] path_openat+0x2718/0x2fb0 fs/namei.c:3750 do_filp_open+0x1df/0x400 fs/namei.c:3777 do_sys_openat2+0x14b/0x500 fs/open.c:1255 do_sys_open fs/open.c:1271 [inline] __do_sys_openat fs/open.c:1287 [inline] __se_sys_openat fs/open.c:1282 [inline] __x64_sys_openat+0x135/0x160 fs/open.c:1282 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:0x7f62f0b38407 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:00007ffc6c857610 EFLAGS: 00000202 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007f62f0a4a880 RCX: 00007f62f0b38407 RDX: 0000000000000000 RSI: 00007ffc6c858f1b RDI: ffffffffffffff9c RBP: 0000000000000002 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000000 R13: 00007ffc6c857860 R14: 00007f62f12c6000 R15: 000055931dfb64d8 The buggy address belongs to the page: page:ffffea0001f72f00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7dcbc head:ffffea0001f72f00 order:2 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010000(head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010000 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 2, migratetype Unmovable, gfp_mask 0x140dc0(GFP_USER|__GFP_COMP|__GFP_ZERO), pid 1108, ts 114123231384, free_ts 114087630885 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x24f6/0x2670 mm/page_alloc.c:4192 __alloc_pages+0x1ee/0x480 mm/page_alloc.c:5501 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:536 [inline] kmalloc include/linux/slab.h:600 [inline] kzalloc include/linux/slab.h:738 [inline] hid_allocate_device+0x23/0x4f0 drivers/hid/hid-core.c:2517 usbhid_probe+0x3bd/0xf50 drivers/hid/usbhid/hid-core.c:1376 usb_probe_interface+0x5be/0xae0 drivers/usb/core/driver.c:396 call_driver_probe drivers/base/dd.c:-1 [inline] really_probe+0x276/0xc70 drivers/base/dd.c:595 __driver_probe_device+0x1f5/0x390 drivers/base/dd.c:775 driver_probe_device+0x4f/0x420 drivers/base/dd.c:805 __device_attach_driver+0x2b0/0x500 drivers/base/dd.c:927 bus_for_each_drv+0x184/0x210 drivers/base/bus.c:429 __device_attach+0x2a7/0x480 drivers/base/dd.c:999 bus_probe_device+0xba/0x1d0 drivers/base/bus.c:489 device_add+0xbcf/0x1050 drivers/base/core.c:3427 usb_set_configuration+0x19d5/0x2030 drivers/usb/core/message.c:2223 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+0x8f/0x2a0 mm/page_alloc.c:3396 free_nonslab_page+0xde/0x150 mm/slub.c:3540 em28xx_free_v4l2 drivers/media/usb/em28xx/em28xx-video.c:2128 [inline] kref_put include/linux/kref.h:65 [inline] em28xx_v4l2_init+0x155a/0x2cd0 drivers/media/usb/em28xx/em28xx-video.c:2917 em28xx_init_extension+0x118/0x1c0 drivers/media/usb/em28xx/em28xx-core.c:1126 process_one_work+0x867/0xff0 kernel/workqueue.c:2310 process_scheduled_works kernel/workqueue.c:2373 [inline] worker_thread+0xe01/0x12a0 kernel/workqueue.c:2462 kthread+0x42e/0x520 kernel/kthread.c:334 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 Memory state around the buggy address: ffff88807dcbc880: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88807dcbc900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88807dcbc980: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff88807dcbca00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88807dcbca80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================