em28xx 2-1:0.132: Closing input extension ================================================================== BUG: KASAN: slab-use-after-free in media_device_unregister drivers/media/mc/mc-device.c:833 [inline] BUG: KASAN: slab-use-after-free in media_device_unregister+0x59d/0x610 drivers/media/mc/mc-device.c:811 Read of size 8 at addr ffff8880382c0210 by task kworker/0:2/187 CPU: 0 UID: 0 PID: 187 Comm: kworker/0:2 Tainted: G L syzkaller #0 PREEMPT(full) Tainted: [L]=SOFTLOCKUP Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/10/2026 Workqueue: usb_hub_wq hub_event Call Trace: __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+0x13d/0x4b0 mm/kasan/report.c:482 kasan_report+0xdf/0x1c0 mm/kasan/report.c:595 media_device_unregister drivers/media/mc/mc-device.c:833 [inline] media_device_unregister+0x59d/0x610 drivers/media/mc/mc-device.c:811 em28xx_unregister_media_device+0x4e/0xe0 drivers/media/usb/em28xx/em28xx-cards.c:3714 em28xx_release_resources+0x79/0x1b0 drivers/media/usb/em28xx/em28xx-cards.c:3735 em28xx_usb_disconnect.cold+0x17d/0x253 drivers/media/usb/em28xx/em28xx-cards.c:4427 usb_unbind_interface+0x1dd/0x9e0 drivers/usb/core/driver.c:458 device_remove drivers/base/dd.c:618 [inline] device_remove+0x12a/0x180 drivers/base/dd.c:610 __device_release_driver drivers/base/dd.c:1349 [inline] device_release_driver_internal+0x44e/0x620 drivers/base/dd.c:1372 bus_remove_device+0x2bc/0x560 drivers/base/bus.c:664 device_del+0x376/0x9b0 drivers/base/core.c:3961 usb_disable_device+0x367/0x810 drivers/usb/core/message.c:1478 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+0xa23/0x1940 kernel/workqueue.c:3322 process_scheduled_works kernel/workqueue.c:3405 [inline] worker_thread+0x5ef/0xe50 kernel/workqueue.c:3486 kthread+0x370/0x450 kernel/kthread.c:436 ret_from_fork+0x72b/0xd50 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Allocated by task 5736: 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 kasan_kmalloc include/linux/kasan.h:263 [inline] __kmalloc_cache_noprof+0x2e5/0x6c0 mm/slub.c:5515 _kmalloc_noprof include/linux/slab.h:969 [inline] _kzalloc_noprof include/linux/slab.h:1290 [inline] em28xx_v4l2_init.cold+0x94/0x3a40 drivers/media/usb/em28xx/em28xx-video.c:2709 em28xx_init_extension+0x13a/0x200 drivers/media/usb/em28xx/em28xx-core.c:1248 request_module_async+0x61/0x80 drivers/media/usb/em28xx/em28xx-cards.c:3660 process_one_work+0xa23/0x1940 kernel/workqueue.c:3322 process_scheduled_works kernel/workqueue.c:3405 [inline] worker_thread+0x5ef/0xe50 kernel/workqueue.c:3486 kthread+0x370/0x450 kernel/kthread.c:436 ret_from_fork+0x72b/0xd50 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Freed by task 5736: 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:2705 [inline] slab_free mm/slub.c:6405 [inline] kfree+0x22b/0x6c0 mm/slub.c:6720 kref_put.isra.0+0x53/0x75 include/linux/kref.h:65 em28xx_v4l2_init.cold+0x280/0x3a40 drivers/media/usb/em28xx/em28xx-video.c:3080 em28xx_init_extension+0x13a/0x200 drivers/media/usb/em28xx/em28xx-core.c:1248 request_module_async+0x61/0x80 drivers/media/usb/em28xx/em28xx-cards.c:3660 process_one_work+0xa23/0x1940 kernel/workqueue.c:3322 process_scheduled_works kernel/workqueue.c:3405 [inline] worker_thread+0x5ef/0xe50 kernel/workqueue.c:3486 kthread+0x370/0x450 kernel/kthread.c:436 ret_from_fork+0x72b/0xd50 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 ffff8880382c0000 which belongs to the cache kmalloc-8k of size 8192 The buggy address is located 528 bytes inside of freed 8192-byte region [ffff8880382c0000, ffff8880382c2000) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x382c0 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 ffff88813fe25280 dead000000000100 dead000000000122 raw: 0000000000000000 0000000800020002 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff88813fe25280 dead000000000100 dead000000000122 head: 0000000000000000 0000000800020002 00000000f5000000 0000000000000000 head: 00fff00000000003 fffffffffffffe01 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 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 26708, tgid 26705 (syz.3.5315), ts 1633415529864, free_ts 1633388508894 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0xfd/0x120 mm/page_alloc.c:1859 prep_new_page mm/page_alloc.c:1867 [inline] get_page_from_freelist+0xf48/0x3530 mm/page_alloc.c:3946 __alloc_frozen_pages_noprof+0x299/0x2dc0 mm/page_alloc.c:5304 alloc_slab_page mm/slub.c:3294 [inline] allocate_slab mm/slub.c:3408 [inline] new_slab+0xa2/0x650 mm/slub.c:3454 refill_objects+0xe3/0x410 mm/slub.c:7338 refill_sheaf mm/slub.c:2832 [inline] __pcs_replace_empty_main+0x376/0x680 mm/slub.c:4703 alloc_from_pcs mm/slub.c:4801 [inline] slab_alloc_node mm/slub.c:4933 [inline] __do_kmalloc_node mm/slub.c:5361 [inline] __kmalloc_noprof+0x66d/0x820 mm/slub.c:5387 _kmalloc_noprof include/linux/slab.h:973 [inline] n_hdlc_alloc_buf+0x5b/0xf0 drivers/tty/n_hdlc.c:665 n_hdlc_alloc drivers/tty/n_hdlc.c:698 [inline] n_hdlc_tty_open+0x26b/0x520 drivers/tty/n_hdlc.c:229 tty_ldisc_open+0xa2/0x120 drivers/tty/tty_ldisc.c:432 tty_set_ldisc+0x325/0x740 drivers/tty/tty_ldisc.c:563 tiocsetd drivers/tty/tty_io.c:2429 [inline] tty_ioctl+0x5b2/0x1640 drivers/tty/tty_io.c:2728 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:597 [inline] __se_sys_ioctl fs/ioctl.c:583 [inline] __x64_sys_ioctl+0x18e/0x210 fs/ioctl.c:583 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x115/0x870 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 5593 tgid 5593 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] __free_pages_prepare mm/page_alloc.c:1406 [inline] __free_frozen_pages+0x79f/0x1090 mm/page_alloc.c:2950 __folio_put+0x3b4/0x5f0 mm/swap.c:112 folio_put include/linux/mm.h:2124 [inline] put_page include/linux/mm.h:2193 [inline] put_netmem include/net/netmem.h:394 [inline] skb_page_unref include/linux/skbuff_ref.h:43 [inline] __skb_frag_unref include/linux/skbuff_ref.h:56 [inline] skb_release_data+0x649/0x8e0 net/core/skbuff.c:1110 skb_release_all net/core/skbuff.c:1191 [inline] __kfree_skb+0x4f/0x70 net/core/skbuff.c:1205 tcp_wmem_free_skb include/net/tcp.h:334 [inline] tcp_rtx_queue_unlink_and_free include/net/tcp.h:2319 [inline] tcp_clean_rtx_queue net/ipv4/tcp_input.c:3698 [inline] tcp_ack+0x2079/0x7650 net/ipv4/tcp_input.c:4370 tcp_rcv_established+0x116d/0x3990 net/ipv4/tcp_input.c:6559 tcp_v4_do_rcv+0xbb6/0x1260 net/ipv4/tcp_ipv4.c:1851 sk_backlog_rcv include/net/sock.h:1190 [inline] __release_sock+0x35a/0x440 net/core/sock.c:3258 release_sock+0x1e5/0x280 net/core/sock.c:3857 tcp_sendmsg+0x38/0x50 net/ipv4/tcp.c:1452 inet_sendmsg+0xb9/0x140 net/ipv4/af_inet.c:865 sock_sendmsg_nosec net/socket.c:775 [inline] __sock_sendmsg net/socket.c:790 [inline] sock_write_iter+0x4ea/0x5b0 net/socket.c:1241 new_sync_write fs/read_write.c:595 [inline] vfs_write+0x6ac/0x1050 fs/read_write.c:687 ksys_write+0x1f8/0x250 fs/read_write.c:739 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x115/0x870 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff8880382c0100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880382c0180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880382c0200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880382c0280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880382c0300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================