================================================================== 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+0xc7/0x430 drivers/media/v4l2-core/v4l2-fh.c:63 Read of size 8 at addr ffff88807cc14738 by task v4l_id/16714 CPU: 0 UID: 0 PID: 16714 Comm: v4l_id Not tainted 6.16.0-rc2-syzkaller-00082-gfb4d33ab452e #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Call Trace: dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:408 [inline] print_report+0xd2/0x2b0 mm/kasan/report.c:521 kasan_report+0x118/0x150 mm/kasan/report.c:634 v4l2_fh_init drivers/media/v4l2-core/v4l2-fh.c:25 [inline] v4l2_fh_open+0xc7/0x430 drivers/media/v4l2-core/v4l2-fh.c:63 em28xx_v4l2_open+0x157/0x9a0 drivers/media/usb/em28xx/em28xx-video.c:2153 v4l2_open+0x20f/0x360 drivers/media/v4l2-core/v4l2-dev.c:429 chrdev_open+0x4cc/0x5e0 fs/char_dev.c:414 do_dentry_open+0xdf3/0x1970 fs/open.c:964 vfs_open+0x3b/0x340 fs/open.c:1094 do_open fs/namei.c:3896 [inline] path_openat+0x2ee5/0x3830 fs/namei.c:4055 do_filp_open+0x1fa/0x410 fs/namei.c:4082 do_sys_openat2+0x121/0x1c0 fs/open.c:1437 do_sys_open fs/open.c:1452 [inline] __do_sys_openat fs/open.c:1468 [inline] __se_sys_openat fs/open.c:1463 [inline] __x64_sys_openat+0x138/0x170 fs/open.c:1463 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f032fea7407 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:00007ffc18bf6ef0 EFLAGS: 00000202 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007f0330578880 RCX: 00007f032fea7407 RDX: 0000000000000000 RSI: 00007ffc18bf8f1d RDI: ffffffffffffff9c RBP: 0000000000000002 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000000 R13: 00007ffc18bf7140 R14: 00007f033067d000 R15: 0000561b29bad4d8 Allocated by task 5919: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:260 [inline] __kmalloc_cache_noprof+0x230/0x3d0 mm/slub.c:4359 kmalloc_noprof include/linux/slab.h:905 [inline] kzalloc_noprof include/linux/slab.h:1039 [inline] em28xx_v4l2_init+0x10b/0x2e70 drivers/media/usb/em28xx/em28xx-video.c:2532 em28xx_init_extension+0x11d/0x1c0 drivers/media/usb/em28xx/em28xx-core.c:1117 process_one_work kernel/workqueue.c:3238 [inline] process_scheduled_works+0xae1/0x17b0 kernel/workqueue.c:3321 worker_thread+0x8a0/0xda0 kernel/workqueue.c:3402 kthread+0x70e/0x8a0 kernel/kthread.c:464 ret_from_fork+0x3f9/0x770 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Freed by task 5919: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x46/0x50 mm/kasan/generic.c:576 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x62/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2381 [inline] slab_free mm/slub.c:4643 [inline] kfree+0x18e/0x440 mm/slub.c:4842 em28xx_free_v4l2 drivers/media/usb/em28xx/em28xx-video.c:2118 [inline] kref_put include/linux/kref.h:65 [inline] em28xx_v4l2_init+0x1683/0x2e70 drivers/media/usb/em28xx/em28xx-video.c:2901 em28xx_init_extension+0x11d/0x1c0 drivers/media/usb/em28xx/em28xx-core.c:1117 process_one_work kernel/workqueue.c:3238 [inline] process_scheduled_works+0xae1/0x17b0 kernel/workqueue.c:3321 worker_thread+0x8a0/0xda0 kernel/workqueue.c:3402 kthread+0x70e/0x8a0 kernel/kthread.c:464 ret_from_fork+0x3f9/0x770 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 The buggy address belongs to the object at ffff88807cc14000 which belongs to the cache kmalloc-8k of size 8192 The buggy address is located 1848 bytes inside of freed 8192-byte region [ffff88807cc14000, ffff88807cc16000) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7cc10 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88801a442280 ffffea00015ca000 dead000000000002 raw: 0000000000000000 0000000080020002 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff88801a442280 ffffea00015ca000 dead000000000002 head: 0000000000000000 0000000080020002 00000000f5000000 0000000000000000 head: 00fff00000000003 ffffea0001f30401 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000008 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0x528c0(GFP_NOWAIT|__GFP_IO|__GFP_FS|__GFP_NORETRY|__GFP_COMP), pid 14943, tgid 14940 (syz.2.3382), ts 438969975378, free_ts 438966247503 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1704 prep_new_page mm/page_alloc.c:1712 [inline] get_page_from_freelist+0x21e4/0x22c0 mm/page_alloc.c:3669 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:4959 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2419 alloc_slab_page mm/slub.c:2451 [inline] allocate_slab+0x8a/0x3b0 mm/slub.c:2619 new_slab mm/slub.c:2673 [inline] ___slab_alloc+0xbfc/0x1480 mm/slub.c:3859 __slab_alloc mm/slub.c:3949 [inline] __slab_alloc_node mm/slub.c:4024 [inline] slab_alloc_node mm/slub.c:4185 [inline] __do_kmalloc_node mm/slub.c:4327 [inline] __kvmalloc_node_noprof+0x429/0x5f0 mm/slub.c:5015 kvmalloc_array_node_noprof include/linux/slab.h:1065 [inline] table_instance_alloc net/openvswitch/flow_table.c:160 [inline] ovs_flow_tbl_init+0x3f8/0x800 net/openvswitch/flow_table.c:429 ovs_dp_cmd_new+0x24b/0xaf0 net/openvswitch/datapath.c:1832 genl_family_rcv_msg_doit+0x215/0x300 net/netlink/genetlink.c:1115 genl_family_rcv_msg net/netlink/genetlink.c:1195 [inline] genl_rcv_msg+0x60e/0x790 net/netlink/genetlink.c:1210 netlink_rcv_skb+0x205/0x470 net/netlink/af_netlink.c:2534 genl_rcv+0x28/0x40 net/netlink/genetlink.c:1219 netlink_unicast_kernel net/netlink/af_netlink.c:1313 [inline] netlink_unicast+0x758/0x8d0 net/netlink/af_netlink.c:1339 netlink_sendmsg+0x805/0xb30 net/netlink/af_netlink.c:1883 sock_sendmsg_nosec net/socket.c:712 [inline] __sock_sendmsg+0x21c/0x270 net/socket.c:727 page last free pid 13669 tgid 13669 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1248 [inline] __free_frozen_pages+0xc71/0xe70 mm/page_alloc.c:2706 __folio_put+0x21b/0x2c0 mm/swap.c:112 put_netmem net/core/skbuff.c:7375 [inline] skb_page_unref include/linux/skbuff_ref.h:43 [inline] __skb_frag_unref include/linux/skbuff_ref.h:56 [inline] skb_release_data+0x49a/0x7c0 net/core/skbuff.c:1081 skb_release_all net/core/skbuff.c:1152 [inline] __kfree_skb+0x55/0x70 net/core/skbuff.c:1166 tcp_clean_rtx_queue net/ipv4/tcp_input.c:3441 [inline] tcp_ack+0x2013/0x62b0 net/ipv4/tcp_input.c:4049 tcp_rcv_established+0x7e4/0x1de0 net/ipv4/tcp_input.c:6297 tcp_v4_do_rcv+0xa23/0xce0 net/ipv4/tcp_ipv4.c:1925 tcp_v4_rcv+0x2676/0x2f00 net/ipv4/tcp_ipv4.c:2363 ip_protocol_deliver_rcu+0x221/0x440 net/ipv4/ip_input.c:205 ip_local_deliver_finish+0x2fb/0x580 net/ipv4/ip_input.c:233 NF_HOOK+0x30c/0x3a0 include/linux/netfilter.h:317 dst_input include/net/dst.h:469 [inline] ip_sublist_rcv_finish+0x21d/0x2a0 net/ipv4/ip_input.c:578 ip_list_rcv_finish net/ipv4/ip_input.c:627 [inline] ip_sublist_rcv+0x6e7/0x9b0 net/ipv4/ip_input.c:635 ip_list_rcv+0x3e2/0x430 net/ipv4/ip_input.c:669 __netif_receive_skb_list_ptype net/core/dev.c:6020 [inline] __netif_receive_skb_list_core+0x7d2/0x800 net/core/dev.c:6067 __netif_receive_skb_list net/core/dev.c:6119 [inline] netif_receive_skb_list_internal+0x975/0xcc0 net/core/dev.c:6210 Memory state around the buggy address: ffff88807cc14600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807cc14680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88807cc14700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88807cc14780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807cc14800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================