usb 4-1: USB disconnect, device number 2 em28xx 4-1:0.0: Disconnecting em28xx ================================================================== BUG: KASAN: use-after-free in __list_del_entry_valid_or_report+0x1a6/0x1c0 lib/list_debug.c:62 Read of size 8 at addr ffff88810732c250 by task kworker/1:2/2346 CPU: 1 UID: 0 PID: 2346 Comm: kworker/1:2 Not tainted 6.11.0-rc7-syzkaller-00152-g68d4209158f4 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 Workqueue: usb_hub_wq hub_event Call Trace: __dump_stack lib/dump_stack.c:93 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:119 print_address_description mm/kasan/report.c:377 [inline] print_report+0xc3/0x620 mm/kasan/report.c:488 kasan_report+0xd9/0x110 mm/kasan/report.c:601 __list_del_entry_valid_or_report+0x1a6/0x1c0 lib/list_debug.c:62 __list_del_entry_valid include/linux/list.h:124 [inline] __list_del_entry include/linux/list.h:215 [inline] list_del include/linux/list.h:229 [inline] em28xx_close_extension+0x10e/0x2b0 drivers/media/usb/em28xx/em28xx-core.c:1137 em28xx_usb_disconnect+0x19d/0x610 drivers/media/usb/em28xx/em28xx-cards.c:4197 usb_unbind_interface+0x1e8/0x970 drivers/usb/core/driver.c:461 device_remove drivers/base/dd.c:568 [inline] device_remove+0x122/0x170 drivers/base/dd.c:560 __device_release_driver drivers/base/dd.c:1272 [inline] device_release_driver_internal+0x44a/0x610 drivers/base/dd.c:1295 bus_remove_device+0x22f/0x420 drivers/base/bus.c:574 device_del+0x396/0x9f0 drivers/base/core.c:3871 usb_disable_device+0x36c/0x7f0 drivers/usb/core/message.c:1418 usb_disconnect+0x2e1/0x920 drivers/usb/core/hub.c:2304 hub_port_connect drivers/usb/core/hub.c:5361 [inline] hub_port_connect_change drivers/usb/core/hub.c:5661 [inline] port_event drivers/usb/core/hub.c:5821 [inline] hub_event+0x1bed/0x4f40 drivers/usb/core/hub.c:5903 process_one_work+0x9c5/0x1b40 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x6c8/0xed0 kernel/workqueue.c:3389 kthread+0x2c1/0x3a0 kernel/kthread.c:389 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10732c head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff88810577ea01 flags: 0x200000000000040(head|node=0|zone=2) page_type: 0xfdffffff(slab) raw: 0200000000000040 ffff88810004f140 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000100010 00000001fdffffff ffff88810577ea01 head: 0200000000000040 ffff88810004f140 dead000000000122 0000000000000000 head: 0000000000000000 0000000000100010 00000001fdffffff ffff88810577ea01 head: 0200000000000002 ffffea00041ccb01 ffffffffffffffff 0000000000000000 head: 0000000000000004 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 2534, tgid 2534 (klogd), ts 77818434036, free_ts 77714984747 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1500 prep_new_page mm/page_alloc.c:1508 [inline] get_page_from_freelist+0x1311/0x25f0 mm/page_alloc.c:3446 __alloc_pages_noprof+0x21e/0x2290 mm/page_alloc.c:4702 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline] alloc_pages_node_noprof include/linux/gfp.h:296 [inline] alloc_slab_page+0x4e/0xf0 mm/slub.c:2325 allocate_slab mm/slub.c:2488 [inline] new_slab+0x84/0x260 mm/slub.c:2541 ___slab_alloc+0xdac/0x1870 mm/slub.c:3727 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3817 __slab_alloc_node mm/slub.c:3870 [inline] slab_alloc_node mm/slub.c:4029 [inline] __do_kmalloc_node mm/slub.c:4161 [inline] __kmalloc_node_track_caller_noprof+0x14e/0x3e0 mm/slub.c:4181 kmalloc_reserve+0xef/0x2c0 net/core/skbuff.c:605 __alloc_skb+0x164/0x380 net/core/skbuff.c:674 alloc_skb include/linux/skbuff.h:1320 [inline] alloc_skb_with_frags+0xe4/0x710 net/core/skbuff.c:6526 sock_alloc_send_pskb+0x7f1/0x980 net/core/sock.c:2815 unix_dgram_sendmsg+0x467/0x1920 net/unix/af_unix.c:2030 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg net/socket.c:745 [inline] __sys_sendto+0x47f/0x4e0 net/socket.c:2204 __do_sys_sendto net/socket.c:2216 [inline] __se_sys_sendto net/socket.c:2212 [inline] __x64_sys_sendto+0xe0/0x1c0 net/socket.c:2212 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 page last free pid 9 tgid 9 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1101 [inline] free_unref_page+0x698/0xce0 mm/page_alloc.c:2619 __folio_put+0x1dc/0x260 mm/swap.c:128 em28xx_free_device drivers/media/usb/em28xx/em28xx-cards.c:3566 [inline] kref_put include/linux/kref.h:65 [inline] em28xx_usb_disconnect+0x4e0/0x610 drivers/media/usb/em28xx/em28xx-cards.c:4204 usb_unbind_interface+0x1e8/0x970 drivers/usb/core/driver.c:461 device_remove drivers/base/dd.c:568 [inline] device_remove+0x122/0x170 drivers/base/dd.c:560 __device_release_driver drivers/base/dd.c:1272 [inline] device_release_driver_internal+0x44a/0x610 drivers/base/dd.c:1295 bus_remove_device+0x22f/0x420 drivers/base/bus.c:574 device_del+0x396/0x9f0 drivers/base/core.c:3871 usb_disable_device+0x36c/0x7f0 drivers/usb/core/message.c:1418 usb_disconnect+0x2e1/0x920 drivers/usb/core/hub.c:2304 hub_port_connect drivers/usb/core/hub.c:5361 [inline] hub_port_connect_change drivers/usb/core/hub.c:5661 [inline] port_event drivers/usb/core/hub.c:5821 [inline] hub_event+0x1bed/0x4f40 drivers/usb/core/hub.c:5903 process_one_work+0x9c5/0x1b40 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x6c8/0xed0 kernel/workqueue.c:3389 kthread+0x2c1/0x3a0 kernel/kthread.c:389 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Memory state around the buggy address: ffff88810732c100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88810732c180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88810732c200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88810732c280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88810732c300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================