================================================================== BUG: KASAN: slab-use-after-free in v4l2_fh_init drivers/media/v4l2-core/v4l2-fh.c:25 [inline] BUG: KASAN: slab-use-after-free in v4l2_fh_open+0xc8/0x430 drivers/media/v4l2-core/v4l2-fh.c:63 Read of size 8 at addr ffff888034144738 by task v4l_id/7816 CPU: 0 UID: 0 PID: 7816 Comm: v4l_id Not tainted 6.14.0-syzkaller-09584-g7d06015d936c #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:408 [inline] print_report+0x16e/0x5b0 mm/kasan/report.c:521 kasan_report+0x143/0x180 mm/kasan/report.c:634 v4l2_fh_init drivers/media/v4l2-core/v4l2-fh.c:25 [inline] v4l2_fh_open+0xc8/0x430 drivers/media/v4l2-core/v4l2-fh.c:63 em28xx_v4l2_open+0x14c/0x9e0 drivers/media/usb/em28xx/em28xx-video.c:2153 v4l2_open+0x22f/0x370 drivers/media/v4l2-core/v4l2-dev.c:429 chrdev_open+0x514/0x600 fs/char_dev.c:414 do_dentry_open+0xdec/0x1960 fs/open.c:956 vfs_open+0x3b/0x370 fs/open.c:1086 do_open fs/namei.c:3845 [inline] path_openat+0x2caf/0x35d0 fs/namei.c:4004 do_filp_open+0x284/0x4e0 fs/namei.c:4031 do_sys_openat2+0x12b/0x1d0 fs/open.c:1429 do_sys_open fs/open.c:1444 [inline] __do_sys_openat fs/open.c:1460 [inline] __se_sys_openat fs/open.c:1455 [inline] __x64_sys_openat+0x249/0x2a0 fs/open.c:1455 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7ff0809169a4 Code: 24 20 48 8d 44 24 30 48 89 44 24 28 64 8b 04 25 18 00 00 00 85 c0 75 2c 44 89 e2 48 89 ee bf 9c ff ff ff b8 01 01 00 00 0f 05 <48> 3d 00 f0 ff ff 76 60 48 8b 15 55 a4 0d 00 f7 d8 64 89 02 48 83 RSP: 002b:00007fff7f7e3b50 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007fff7f7e3d68 RCX: 00007ff0809169a4 RDX: 0000000000000000 RSI: 00007fff7f7e4f1b RDI: 00000000ffffff9c RBP: 00007fff7f7e4f1b R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fff7f7e3d80 R14: 0000564a09c3f670 R15: 00007ff080e5ca80 Allocated by task 24: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0x9d/0xb0 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:260 [inline] __kmalloc_cache_noprof+0x236/0x370 mm/slub.c:4349 kmalloc_noprof include/linux/slab.h:902 [inline] kzalloc_noprof include/linux/slab.h:1036 [inline] em28xx_v4l2_init+0xfd/0x2f70 drivers/media/usb/em28xx/em28xx-video.c:2532 em28xx_init_extension+0x120/0x1c0 drivers/media/usb/em28xx/em28xx-core.c:1117 process_one_work kernel/workqueue.c:3238 [inline] process_scheduled_works+0xac3/0x18e0 kernel/workqueue.c:3319 worker_thread+0x870/0xd50 kernel/workqueue.c:3400 kthread+0x7b7/0x940 kernel/kthread.c:464 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:153 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Freed by task 24: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:576 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x59/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2376 [inline] slab_free mm/slub.c:4633 [inline] kfree+0x198/0x430 mm/slub.c:4832 em28xx_free_v4l2 drivers/media/usb/em28xx/em28xx-video.c:2118 [inline] kref_put include/linux/kref.h:65 [inline] em28xx_v4l2_init+0x16fc/0x2f70 drivers/media/usb/em28xx/em28xx-video.c:2901 em28xx_init_extension+0x120/0x1c0 drivers/media/usb/em28xx/em28xx-core.c:1117 process_one_work kernel/workqueue.c:3238 [inline] process_scheduled_works+0xac3/0x18e0 kernel/workqueue.c:3319 worker_thread+0x870/0xd50 kernel/workqueue.c:3400 kthread+0x7b7/0x940 kernel/kthread.c:464 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:153 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 The buggy address belongs to the object at ffff888034144000 which belongs to the cache kmalloc-8k of size 8192 The buggy address is located 1848 bytes inside of freed 8192-byte region [ffff888034144000, ffff888034146000) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x34140 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 anon flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88801b042280 0000000000000000 0000000000000001 raw: 0000000000000000 0000000080020002 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff88801b042280 0000000000000000 0000000000000001 head: 0000000000000000 0000000080020002 00000000f5000000 0000000000000000 head: 00fff00000000003 ffffea0000d05001 ffffffffffffffff 0000000000000000 head: 0000000000000008 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0x52820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 3467, tgid 3467 (kworker/u8:9), ts 200327029013, free_ts 200326708797 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f4/0x240 mm/page_alloc.c:1551 prep_new_page mm/page_alloc.c:1559 [inline] get_page_from_freelist+0x3695/0x37e0 mm/page_alloc.c:3477 __alloc_frozen_pages_noprof+0x2c5/0x7b0 mm/page_alloc.c:4740 alloc_pages_mpol+0x339/0x690 mm/mempolicy.c:2301 alloc_slab_page mm/slub.c:2446 [inline] allocate_slab+0x8f/0x3a0 mm/slub.c:2610 new_slab mm/slub.c:2663 [inline] ___slab_alloc+0xc3b/0x1500 mm/slub.c:3849 __slab_alloc+0x58/0xa0 mm/slub.c:3939 __slab_alloc_node mm/slub.c:4014 [inline] slab_alloc_node mm/slub.c:4175 [inline] __do_kmalloc_node mm/slub.c:4317 [inline] __kmalloc_noprof+0x2ea/0x4d0 mm/slub.c:4330 kmalloc_noprof include/linux/slab.h:906 [inline] kzalloc_noprof include/linux/slab.h:1036 [inline] ieee802_11_parse_elems_full+0x16d/0x2f10 net/mac80211/parse.c:1013 ieee802_11_parse_elems_crc net/mac80211/ieee80211_i.h:2402 [inline] ieee802_11_parse_elems net/mac80211/ieee80211_i.h:2409 [inline] ieee80211_rx_mgmt_probe_beacon net/mac80211/ibss.c:1577 [inline] ieee80211_ibss_rx_queued_mgmt+0x4e6/0x2e20 net/mac80211/ibss.c:1608 ieee80211_iface_process_skb net/mac80211/iface.c:1622 [inline] ieee80211_iface_work+0x933/0x1100 net/mac80211/iface.c:1676 cfg80211_wiphy_work+0x2f0/0x490 net/wireless/core.c:435 process_one_work kernel/workqueue.c:3238 [inline] process_scheduled_works+0xac3/0x18e0 kernel/workqueue.c:3319 worker_thread+0x870/0xd50 kernel/workqueue.c:3400 kthread+0x7b7/0x940 kernel/kthread.c:464 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:153 page last free pid 5824 tgid 5824 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_frozen_pages+0xe16/0x10f0 mm/page_alloc.c:2660 discard_slab mm/slub.c:2707 [inline] __put_partials+0x160/0x1c0 mm/slub.c:3176 put_cpu_partial+0x17e/0x250 mm/slub.c:3251 __slab_free+0x294/0x390 mm/slub.c:4503 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x9a/0x140 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x14f/0x170 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x23/0x80 mm/kasan/common.c:329 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4138 [inline] slab_alloc_node mm/slub.c:4187 [inline] kmem_cache_alloc_noprof+0x1e1/0x390 mm/slub.c:4194 new_handle fs/jbd2/transaction.c:457 [inline] jbd2__journal_start+0x14d/0x5d0 fs/jbd2/transaction.c:484 __ext4_journal_start_sb+0x239/0x600 fs/ext4/ext4_jbd2.c:114 __ext4_journal_start fs/ext4/ext4_jbd2.h:242 [inline] ext4_dirty_inode+0x92/0x110 fs/ext4/inode.c:6083 __mark_inode_dirty+0x2ee/0xe90 fs/fs-writeback.c:2527 generic_update_time fs/inode.c:2064 [inline] inode_update_time fs/inode.c:2077 [inline] __file_update_time fs/inode.c:2305 [inline] file_update_time+0x3d2/0x450 fs/inode.c:2335 ext4_page_mkwrite+0x214/0x1130 fs/ext4/inode.c:6204 do_page_mkwrite+0x15c/0x350 mm/memory.c:3256 wp_page_shared mm/memory.c:3657 [inline] do_wp_page+0x23d2/0x49b0 mm/memory.c:3807 Memory state around the buggy address: ffff888034144600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888034144680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888034144700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888034144780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888034144800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================