================================================================== 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+0xac/0x420 drivers/media/v4l2-core/v4l2-fh.c:64 Read of size 8 at addr ffff888077e2c740 by task v4l_id/6151 CPU: 0 UID: 0 PID: 6151 Comm: v4l_id Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025 Call Trace: dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xca/0x240 mm/kasan/report.c:482 kasan_report+0x118/0x150 mm/kasan/report.c:595 v4l2_fh_init drivers/media/v4l2-core/v4l2-fh.c:25 [inline] v4l2_fh_open+0xac/0x420 drivers/media/v4l2-core/v4l2-fh.c:64 em28xx_v4l2_open+0x157/0x9a0 drivers/media/usb/em28xx/em28xx-video.c:2153 v4l2_open+0x1bf/0x3a0 drivers/media/v4l2-core/v4l2-dev.c:433 chrdev_open+0x4cc/0x5e0 fs/char_dev.c:414 do_dentry_open+0x953/0x13f0 fs/open.c:962 vfs_open+0x3b/0x340 fs/open.c:1094 do_open fs/namei.c:3975 [inline] path_openat+0x2efb/0x3860 fs/namei.c:4134 do_filp_open+0x1fa/0x410 fs/namei.c:4161 do_sys_openat2+0x121/0x1c0 fs/open.c:1434 do_sys_open fs/open.c:1449 [inline] __do_sys_openat fs/open.c:1465 [inline] __se_sys_openat fs/open.c:1460 [inline] __x64_sys_openat+0x138/0x170 fs/open.c:1460 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f11e02a7407 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:00007ffdf3b69e50 EFLAGS: 00000202 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007f11e0a8d880 RCX: 00007f11e02a7407 RDX: 0000000000000000 RSI: 00007ffdf3b6bf1c RDI: ffffffffffffff9c RBP: 0000000000000002 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000000 R13: 00007ffdf3b6a0a0 R14: 00007f11e0bf4000 R15: 0000563a6655c4d8 Allocated by task 56: kasan_save_stack mm/kasan/common.c:56 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:77 poison_kmalloc_redzone mm/kasan/common.c:397 [inline] __kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:414 kasan_kmalloc include/linux/kasan.h:262 [inline] __kmalloc_cache_noprof+0x3e2/0x700 mm/slub.c:5775 kmalloc_noprof include/linux/slab.h:957 [inline] kzalloc_noprof include/linux/slab.h:1094 [inline] em28xx_v4l2_init+0x10b/0x2e70 drivers/media/usb/em28xx/em28xx-video.c:2532 em28xx_init_extension+0x120/0x1c0 drivers/media/usb/em28xx/em28xx-core.c:1117 process_one_work+0x94a/0x15d0 kernel/workqueue.c:3267 process_scheduled_works kernel/workqueue.c:3350 [inline] worker_thread+0x9b0/0xee0 kernel/workqueue.c:3431 kthread+0x711/0x8a0 kernel/kthread.c:463 ret_from_fork+0x599/0xb30 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Freed by task 56: kasan_save_stack mm/kasan/common.c:56 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:77 kasan_save_free_info+0x46/0x50 mm/kasan/generic.c:584 poison_slab_object mm/kasan/common.c:252 [inline] __kasan_slab_free+0x5c/0x80 mm/kasan/common.c:284 kasan_slab_free include/linux/kasan.h:234 [inline] slab_free_hook mm/slub.c:2547 [inline] slab_free mm/slub.c:6642 [inline] kfree+0x19a/0x6d0 mm/slub.c:6849 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+0x120/0x1c0 drivers/media/usb/em28xx/em28xx-core.c:1117 process_one_work+0x94a/0x15d0 kernel/workqueue.c:3267 process_scheduled_works kernel/workqueue.c:3350 [inline] worker_thread+0x9b0/0xee0 kernel/workqueue.c:3431 kthread+0x711/0x8a0 kernel/kthread.c:463 ret_from_fork+0x599/0xb30 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 The buggy address belongs to the object at ffff888077e2c000 which belongs to the cache kmalloc-8k of size 8192 The buggy address is located 1856 bytes inside of freed 8192-byte region [ffff888077e2c000, ffff888077e2e000) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x77e28 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 ffff88813fe27280 ffffea00007dda00 0000000000000004 raw: 0000000000000000 0000000080020002 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff88813fe27280 ffffea00007dda00 0000000000000004 head: 0000000000000000 0000000080020002 00000000f5000000 0000000000000000 head: 00fff00000000003 ffffea0001df8a01 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5903, tgid 5903 (syz-executor), ts 80406330821, free_ts 80330960082 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1851 prep_new_page mm/page_alloc.c:1859 [inline] get_page_from_freelist+0x2365/0x2440 mm/page_alloc.c:3920 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5214 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2479 alloc_slab_page mm/slub.c:3063 [inline] allocate_slab+0x96/0x350 mm/slub.c:3236 new_slab mm/slub.c:3290 [inline] ___slab_alloc+0xf56/0x1990 mm/slub.c:4659 __slab_alloc+0x65/0x100 mm/slub.c:4782 __slab_alloc_node mm/slub.c:4858 [inline] slab_alloc_node mm/slub.c:5280 [inline] __do_kmalloc_node mm/slub.c:5653 [inline] __kmalloc_noprof+0x47d/0x800 mm/slub.c:5666 kmalloc_noprof include/linux/slab.h:961 [inline] kmalloc_array_noprof include/linux/slab.h:1003 [inline] cache_create_net+0x92/0x260 net/sunrpc/cache.c:1747 rsc_cache_create_net net/sunrpc/auth_gss/svcauth_gss.c:2053 [inline] gss_svc_init_net+0x58/0x570 net/sunrpc/auth_gss/svcauth_gss.c:2081 ops_init+0x35c/0x5c0 net/core/net_namespace.c:137 setup_net+0x110/0x330 net/core/net_namespace.c:446 copy_net_ns+0x34e/0x560 net/core/net_namespace.c:581 create_new_namespaces+0x3d3/0x710 kernel/nsproxy.c:111 unshare_nsproxy_namespaces+0x11c/0x170 kernel/nsproxy.c:222 ksys_unshare+0x4c8/0x8c0 kernel/fork.c:3129 page last free pid 1157 tgid 1157 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1395 [inline] __free_frozen_pages+0xbc8/0xd30 mm/page_alloc.c:2948 discard_slab mm/slub.c:3334 [inline] __put_partials+0x146/0x170 mm/slub.c:3880 put_cpu_partial+0x1f2/0x2e0 mm/slub.c:3955 __slab_free+0x2b9/0x390 mm/slub.c:5933 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x97/0x140 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x148/0x160 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x22/0x80 mm/kasan/common.c:349 kasan_slab_alloc include/linux/kasan.h:252 [inline] slab_post_alloc_hook mm/slub.c:4982 [inline] slab_alloc_node mm/slub.c:5292 [inline] kmem_cache_alloc_node_noprof+0x43c/0x710 mm/slub.c:5344 __alloc_skb+0x112/0x2d0 net/core/skbuff.c:663 alloc_skb include/linux/skbuff.h:1383 [inline] nlmsg_new include/net/netlink.h:1055 [inline] inet_netconf_notify_devconf+0x173/0x240 net/ipv4/devinet.c:2209 __devinet_sysctl_unregister net/ipv4/devinet.c:2704 [inline] devinet_sysctl_unregister net/ipv4/devinet.c:2728 [inline] inetdev_destroy net/ipv4/devinet.c:334 [inline] inetdev_event+0x77f/0x15f0 net/ipv4/devinet.c:1655 notifier_call_chain+0x1b6/0x3e0 kernel/notifier.c:85 call_netdevice_notifiers_extack net/core/dev.c:2269 [inline] call_netdevice_notifiers net/core/dev.c:2283 [inline] unregister_netdevice_many_notify+0x1897/0x23d0 net/core/dev.c:12391 ops_exit_rtnl_list net/core/net_namespace.c:187 [inline] ops_undo_list+0x3dc/0x990 net/core/net_namespace.c:248 cleanup_net+0x4d8/0x880 net/core/net_namespace.c:696 process_one_work+0x94a/0x15d0 kernel/workqueue.c:3267 Memory state around the buggy address: ffff888077e2c600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888077e2c680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888077e2c700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888077e2c780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888077e2c800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================