syzbot


KASAN: slab-use-after-free Read in em28xx_unregister_media_device

Status: upstream: reported on 2026/01/22 08:53
Subsystems: media
[Documentation on labels]
Reported-by: syzbot+07b93bb3189febcab189@syzkaller.appspotmail.com
First crash: 30d, last: 7d10h
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [media?] KASAN: slab-use-after-free Read in em28xx_unregister_media_device 0 (1) 2026/01/22 08:53

Sample crash report:
em28xx 1-1:0.161: Closing input extension
==================================================================
BUG: KASAN: slab-use-after-free in media_device_unregister drivers/media/mc/mc-device.c:804 [inline]
BUG: KASAN: slab-use-after-free in media_device_unregister+0x565/0x5e0 drivers/media/mc/mc-device.c:782
Read of size 8 at addr ffff88804f874210 by task kworker/0:0/9

CPU: 0 UID: 0 PID: 9 Comm: kworker/0:0 Tainted: G             L      syzkaller #0 PREEMPT(full) 
Tainted: [L]=SOFTLOCKUP
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/24/2026
Workqueue: usb_hub_wq hub_event
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:94 [inline]
 dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120
 print_address_description mm/kasan/report.c:378 [inline]
 print_report+0x156/0x4c9 mm/kasan/report.c:482
 kasan_report+0xdf/0x1a0 mm/kasan/report.c:595
 media_device_unregister drivers/media/mc/mc-device.c:804 [inline]
 media_device_unregister+0x565/0x5e0 drivers/media/mc/mc-device.c:782
 em28xx_unregister_media_device+0x4e/0xe0 drivers/media/usb/em28xx/em28xx-cards.c:3511
 em28xx_release_resources+0x79/0x1b0 drivers/media/usb/em28xx/em28xx-cards.c:3532
 em28xx_usb_disconnect.cold+0x17d/0x253 drivers/media/usb/em28xx/em28xx-cards.c:4201
 usb_unbind_interface+0x1dd/0x9e0 drivers/usb/core/driver.c:458
 device_remove drivers/base/dd.c:573 [inline]
 device_remove+0x12a/0x180 drivers/base/dd.c:565
 __device_release_driver drivers/base/dd.c:1284 [inline]
 device_release_driver_internal+0x42e/0x600 drivers/base/dd.c:1307
 bus_remove_device+0x22f/0x440 drivers/base/bus.c:616
 device_del+0x376/0x9b0 drivers/base/core.c:3878
 usb_disable_device+0x367/0x810 drivers/usb/core/message.c:1418
 usb_disconnect+0x2e2/0x9a0 drivers/usb/core/hub.c:2345
 hub_port_connect drivers/usb/core/hub.c:5407 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5707 [inline]
 port_event drivers/usb/core/hub.c:5871 [inline]
 hub_event+0x1d0c/0x4af0 drivers/usb/core/hub.c:5953
 process_one_work+0x9c2/0x1840 kernel/workqueue.c:3257
 process_scheduled_works kernel/workqueue.c:3340 [inline]
 worker_thread+0x5da/0xe40 kernel/workqueue.c:3421
 kthread+0x3b3/0x730 kernel/kthread.c:463
 ret_from_fork+0x754/0xaf0 arch/x86/kernel/process.c:158
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:246
 </TASK>

Allocated by task 5934:
 kasan_save_stack+0x30/0x50 mm/kasan/common.c:57
 kasan_save_track+0x14/0x30 mm/kasan/common.c:78
 poison_kmalloc_redzone mm/kasan/common.c:398 [inline]
 __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:415
 kmalloc_noprof include/linux/slab.h:957 [inline]
 kzalloc_noprof include/linux/slab.h:1094 [inline]
 em28xx_v4l2_init.cold+0x94/0x3503 drivers/media/usb/em28xx/em28xx-video.c:2532
 em28xx_init_extension+0x13a/0x200 drivers/media/usb/em28xx/em28xx-core.c:1117
 request_module_async+0x61/0x80 drivers/media/usb/em28xx/em28xx-cards.c:3457
 process_one_work+0x9c2/0x1840 kernel/workqueue.c:3257
 process_scheduled_works kernel/workqueue.c:3340 [inline]
 worker_thread+0x5da/0xe40 kernel/workqueue.c:3421
 kthread+0x3b3/0x730 kernel/kthread.c:463
 ret_from_fork+0x754/0xaf0 arch/x86/kernel/process.c:158
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:246

Freed by task 5934:
 kasan_save_stack+0x30/0x50 mm/kasan/common.c:57
 kasan_save_track+0x14/0x30 mm/kasan/common.c:78
 kasan_save_free_info+0x3b/0x70 mm/kasan/generic.c:584
 poison_slab_object mm/kasan/common.c:253 [inline]
 __kasan_slab_free+0x5f/0x80 mm/kasan/common.c:285
 kasan_slab_free include/linux/kasan.h:235 [inline]
 slab_free_hook mm/slub.c:2540 [inline]
 slab_free mm/slub.c:6674 [inline]
 kfree+0x1c7/0x690 mm/slub.c:6886
 kref_put.isra.0+0x56/0x90 include/linux/kref.h:65
 em28xx_v4l2_init.cold+0x280/0x3503 drivers/media/usb/em28xx/em28xx-video.c:2901
 em28xx_init_extension+0x13a/0x200 drivers/media/usb/em28xx/em28xx-core.c:1117
 request_module_async+0x61/0x80 drivers/media/usb/em28xx/em28xx-cards.c:3457
 process_one_work+0x9c2/0x1840 kernel/workqueue.c:3257
 process_scheduled_works kernel/workqueue.c:3340 [inline]
 worker_thread+0x5da/0xe40 kernel/workqueue.c:3421
 kthread+0x3b3/0x730 kernel/kthread.c:463
 ret_from_fork+0x754/0xaf0 arch/x86/kernel/process.c:158
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:246

The buggy address belongs to the object at ffff88804f874000
 which belongs to the cache kmalloc-8k of size 8192
The buggy address is located 528 bytes inside of
 freed 8192-byte region [ffff88804f874000, ffff88804f876000)

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x4f870
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 ffffea000114f800 0000000000000004
raw: 0000000000000000 0000000000020002 00000000f5000000 0000000000000000
head: 00fff00000000040 ffff88813fe27280 ffffea000114f800 0000000000000004
head: 0000000000000000 0000000000020002 00000000f5000000 0000000000000000
head: 00fff00000000003 ffffea00013e1c01 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 14219, tgid 14218 (syz.4.2007), ts 788575103644, free_ts 788259310305
 set_page_owner include/linux/page_owner.h:32 [inline]
 post_alloc_hook+0x1e1/0x250 mm/page_alloc.c:1884
 prep_new_page mm/page_alloc.c:1892 [inline]
 get_page_from_freelist+0xe3d/0x2e10 mm/page_alloc.c:3945
 __alloc_frozen_pages_noprof+0x26c/0x2410 mm/page_alloc.c:5240
 alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2486
 alloc_slab_page mm/slub.c:3075 [inline]
 allocate_slab mm/slub.c:3248 [inline]
 new_slab+0x2c4/0x440 mm/slub.c:3302
 ___slab_alloc+0xda3/0x1ca0 mm/slub.c:4656
 __slab_alloc.isra.0+0x63/0x110 mm/slub.c:4779
 __slab_alloc_node mm/slub.c:4855 [inline]
 slab_alloc_node mm/slub.c:5251 [inline]
 __kmalloc_cache_noprof+0x531/0x810 mm/slub.c:5775
 kmalloc_noprof include/linux/slab.h:957 [inline]
 audit_log_d_path+0xed/0x210 kernel/audit.c:2196
 audit_log_d_path_exe+0x46/0x80 kernel/audit.c:2412
 audit_log_task+0x2fe/0x3a0 kernel/auditsc.c:2927
 audit_seccomp+0x7a/0x1f0 kernel/auditsc.c:2974
 seccomp_log kernel/seccomp.c:1048 [inline]
 __seccomp_filter+0x896/0x1140 kernel/seccomp.c:1344
 __secure_computing+0x221/0x2e0 kernel/seccomp.c:1404
 syscall_trace_enter+0x90/0x230 kernel/entry/syscall-common.c:44
 syscall_enter_from_user_mode_work include/linux/entry-common.h:78 [inline]
 syscall_enter_from_user_mode include/linux/entry-common.h:109 [inline]
 do_syscall_64+0x460/0xf80 arch/x86/entry/syscall_64.c:90
page last free pid 14234 tgid 14233 stack trace:
 reset_page_owner include/linux/page_owner.h:25 [inline]
 free_pages_prepare mm/page_alloc.c:1433 [inline]
 __free_frozen_pages+0x822/0x1130 mm/page_alloc.c:2973
 __pagetable_free include/linux/mm.h:3204 [inline]
 pagetable_free include/linux/mm.h:3228 [inline]
 pagetable_dtor_free include/linux/mm.h:3332 [inline]
 __tlb_remove_table include/asm-generic/tlb.h:221 [inline]
 __tlb_remove_table_free mm/mmu_gather.c:228 [inline]
 tlb_remove_table_rcu+0x2b2/0x390 mm/mmu_gather.c:291
 rcu_do_batch kernel/rcu/tree.c:2617 [inline]
 rcu_core+0x5a2/0x10d0 kernel/rcu/tree.c:2869
 handle_softirqs+0x1ea/0x910 kernel/softirq.c:622
 __do_softirq kernel/softirq.c:656 [inline]
 invoke_softirq kernel/softirq.c:496 [inline]
 __irq_exit_rcu+0xef/0x150 kernel/softirq.c:723
 irq_exit_rcu+0x9/0x30 kernel/softirq.c:739
 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1056 [inline]
 sysvec_apic_timer_interrupt+0xa3/0xc0 arch/x86/kernel/apic/apic.c:1056
 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:697

Memory state around the buggy address:
 ffff88804f874100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88804f874180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88804f874200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                         ^
 ffff88804f874280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88804f874300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/02/10 11:03 upstream 8a5203c630c6 4ab09a02 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root KASAN: slab-use-after-free Read in em28xx_unregister_media_device
2026/01/30 17:01 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 0a06917432a7 ae7dc18c .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: slab-use-after-free Read in em28xx_unregister_media_device
2026/01/21 07:33 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 5ac87cd859ec 6f1aa2f9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: slab-use-after-free Read in em28xx_unregister_media_device
2026/01/18 05:05 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing fa3bb5011f33 20d37d28 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: slab-use-after-free Read in em28xx_unregister_media_device
* Struck through repros no longer work on HEAD.