================================================================== 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 ffff8880367d88b8 by task v4l_id/8558 CPU: 0 PID: 8558 Comm: v4l_id Not tainted 5.11.0-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+0x107/0x163 lib/dump_stack.c:120 print_address_description.constprop.0.cold+0x5b/0x2c6 mm/kasan/report.c:230 __kasan_report mm/kasan/report.c:396 [inline] kasan_report.cold+0x79/0xd5 mm/kasan/report.c:413 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:423 chrdev_open+0x266/0x770 fs/char_dev.c:414 do_dentry_open+0x4b9/0x11b0 fs/open.c:817 do_open fs/namei.c:3254 [inline] path_openat+0x1b9a/0x2730 fs/namei.c:3371 do_filp_open+0x17e/0x3c0 fs/namei.c:3398 do_sys_openat2+0x16d/0x420 fs/open.c:1172 do_sys_open fs/open.c:1188 [inline] __do_sys_open fs/open.c:1196 [inline] __se_sys_open fs/open.c:1192 [inline] __x64_sys_open+0x119/0x1c0 fs/open.c:1192 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7f1b6b279840 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:00007ffec8393f28 EFLAGS: 00000246 ORIG_RAX: 0000000000000002 RAX: ffffffffffffffda RBX: 00007ffec8394098 RCX: 00007f1b6b279840 RDX: 00007f1b6b265ea0 RSI: 0000000000000000 RDI: 00007ffec8394f1f RBP: 0000000000000003 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000002 R11: 0000000000000246 R12: 000055c0ace068d0 R13: 00007ffec8394090 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 8523: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:401 [inline] ____kasan_kmalloc.constprop.0+0x7f/0xa0 mm/kasan/common.c:429 kasan_kmalloc include/linux/kasan.h:219 [inline] kmem_cache_alloc_trace+0x1e0/0x400 mm/slab.c:3554 kmalloc include/linux/slab.h:552 [inline] kzalloc include/linux/slab.h:682 [inline] em28xx_v4l2_init drivers/media/usb/em28xx/em28xx-video.c:2542 [inline] em28xx_v4l2_init.cold+0x93/0x329d drivers/media/usb/em28xx/em28xx-video.c:2520 em28xx_init_extension+0x12f/0x1f0 drivers/media/usb/em28xx/em28xx-core.c:1128 request_module_async+0x5d/0x70 drivers/media/usb/em28xx/em28xx-cards.c:3360 process_one_work+0x98d/0x15f0 kernel/workqueue.c:2275 process_scheduled_works kernel/workqueue.c:2337 [inline] worker_thread+0x7da/0x1120 kernel/workqueue.c:2426 kthread+0x3b1/0x4a0 kernel/kthread.c:292 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296 Freed by task 8523: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track+0x1c/0x30 mm/kasan/common.c:46 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:356 ____kasan_slab_free+0xb0/0xe0 mm/kasan/common.c:362 kasan_slab_free include/linux/kasan.h:192 [inline] __cache_free mm/slab.c:3424 [inline] kfree+0xed/0x270 mm/slab.c:3760 kref_put.isra.0+0x6f/0xa0 include/linux/kref.h:65 em28xx_v4l2_init drivers/media/usb/em28xx/em28xx-video.c:2911 [inline] em28xx_v4l2_init.cold+0x263/0x329d drivers/media/usb/em28xx/em28xx-video.c:2520 em28xx_init_extension+0x12f/0x1f0 drivers/media/usb/em28xx/em28xx-core.c:1128 request_module_async+0x5d/0x70 drivers/media/usb/em28xx/em28xx-cards.c:3360 process_one_work+0x98d/0x15f0 kernel/workqueue.c:2275 process_scheduled_works kernel/workqueue.c:2337 [inline] worker_thread+0x7da/0x1120 kernel/workqueue.c:2426 kthread+0x3b1/0x4a0 kernel/kthread.c:292 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296 The buggy address belongs to the object at ffff8880367d8000 which belongs to the cache kmalloc-16k of size 16384 The buggy address is located 2232 bytes inside of 16384-byte region [ffff8880367d8000, ffff8880367dc000) The buggy address belongs to the page: page:000000001d9248b1 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x367d8 head:000000001d9248b1 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head) raw: 00fff00000010200 ffffea00004c8608 ffff888010c41c50 ffff888010c40b00 raw: 0000000000000000 ffff8880367d8000 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880367d8780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880367d8800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880367d8880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880367d8900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880367d8980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================