================================================================== BUG: KASAN: use-after-free in __create_pipe include/linux/usb.h:1947 [inline] BUG: KASAN: use-after-free in send_packet+0xa2d/0xbc0 drivers/media/rc/imon.c:627 Read of size 4 at addr ffff88810e1ba000 by task syz-executor.4/8164 CPU: 0 PID: 8164 Comm: syz-executor.4 Not tainted 6.1.0-rc3-syzkaller-00026-ga8bc8cc193c6 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:284 [inline] print_report+0x15e/0x45d mm/kasan/report.c:395 kasan_report+0xbb/0x1f0 mm/kasan/report.c:495 __create_pipe include/linux/usb.h:1947 [inline] send_packet+0xa2d/0xbc0 drivers/media/rc/imon.c:627 vfd_write+0x2d9/0x550 drivers/media/rc/imon.c:989 vfs_write+0x2d7/0xdd0 fs/read_write.c:582 ksys_write+0x127/0x250 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f92b85275a9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f92b787a168 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f92b8648050 RCX: 00007f92b85275a9 RDX: 0000000000000001 RSI: 0000000020000000 RDI: 0000000000000006 RBP: 00007f92b85827b0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffdb7d956ff R14: 00007f92b787a300 R15: 0000000000022000 Allocated by task 4120: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:45 kasan_set_track+0x21/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:371 [inline] __kasan_kmalloc+0x7a/0x90 mm/kasan/common.c:380 kmalloc include/linux/slab.h:576 [inline] kzalloc include/linux/slab.h:712 [inline] usb_alloc_dev+0x51/0xf00 drivers/usb/core/usb.c:582 hub_port_connect drivers/usb/core/hub.c:5255 [inline] hub_port_connect_change drivers/usb/core/hub.c:5497 [inline] port_event drivers/usb/core/hub.c:5653 [inline] hub_event+0x214a/0x45c0 drivers/usb/core/hub.c:5735 process_one_work+0x9bf/0x1710 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2ea/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Freed by task 6045: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:45 kasan_set_track+0x21/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2a/0x40 mm/kasan/generic.c:511 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x144/0x1b0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:177 [inline] slab_free_hook mm/slub.c:1724 [inline] slab_free_freelist_hook mm/slub.c:1750 [inline] slab_free mm/slub.c:3661 [inline] __kmem_cache_free+0x95/0x400 mm/slub.c:3674 device_release+0x9f/0x240 drivers/base/core.c:2330 kobject_cleanup lib/kobject.c:673 [inline] kobject_release lib/kobject.c:704 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x1be/0x4c0 lib/kobject.c:721 put_device+0x1b/0x30 drivers/base/core.c:3624 hub_port_connect drivers/usb/core/hub.c:5197 [inline] hub_port_connect_change drivers/usb/core/hub.c:5497 [inline] port_event drivers/usb/core/hub.c:5653 [inline] hub_event+0x1f86/0x45c0 drivers/usb/core/hub.c:5735 process_one_work+0x9bf/0x1710 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2ea/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 The buggy address belongs to the object at ffff88810e1ba000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 0 bytes inside of 2048-byte region [ffff88810e1ba000, ffff88810e1ba800) The buggy address belongs to the physical page: page:ffffea0004386e00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10e1b8 head:ffffea0004386e00 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x200000000010200(slab|head|node=0|zone=2) raw: 0200000000010200 dead000000000100 dead000000000122 ffff888100042000 raw: 0000000000000000 0000000000080008 00000001ffffffff 0000000000000000 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 4194, tgid 4194 (kworker/0:5), ts 168870283032, free_ts 168851653815 prep_new_page mm/page_alloc.c:2539 [inline] get_page_from_freelist+0x128b/0x2c70 mm/page_alloc.c:4288 __alloc_pages+0x1c7/0x5a0 mm/page_alloc.c:5555 alloc_pages+0x1a6/0x270 mm/mempolicy.c:2285 alloc_slab_page mm/slub.c:1794 [inline] allocate_slab+0x213/0x300 mm/slub.c:1939 new_slab mm/slub.c:1992 [inline] ___slab_alloc+0xa91/0x1400 mm/slub.c:3180 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3279 slab_alloc_node mm/slub.c:3364 [inline] __kmem_cache_alloc_node+0x2e7/0x3b0 mm/slub.c:3437 kmalloc_trace+0x22/0x60 mm/slab_common.c:1046 kmalloc include/linux/slab.h:576 [inline] kzalloc include/linux/slab.h:712 [inline] usb_create_ep_devs+0x49/0x2a0 drivers/usb/core/endpoint.c:156 usb_new_device.cold+0xc9b/0x10ad drivers/usb/core/hub.c:2601 hub_port_connect drivers/usb/core/hub.c:5353 [inline] hub_port_connect_change drivers/usb/core/hub.c:5497 [inline] port_event drivers/usb/core/hub.c:5653 [inline] hub_event+0x26c7/0x45c0 drivers/usb/core/hub.c:5735 process_one_work+0x9bf/0x1710 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2ea/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1459 [inline] free_pcp_prepare+0x64a/0xbf0 mm/page_alloc.c:1509 free_unref_page_prepare mm/page_alloc.c:3387 [inline] free_unref_page+0x19/0x420 mm/page_alloc.c:3483 __unfreeze_partials+0x17c/0x1a0 mm/slub.c:2586 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x44/0x60 mm/kasan/common.c:302 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slab.h:737 [inline] slab_alloc_node mm/slub.c:3398 [inline] slab_alloc mm/slub.c:3406 [inline] __kmem_cache_alloc_lru mm/slub.c:3413 [inline] kmem_cache_alloc+0x2a1/0x3a0 mm/slub.c:3422 getname_flags.part.0+0x50/0x4f0 fs/namei.c:139 getname_flags+0x9a/0xe0 include/linux/audit.h:320 user_path_at_empty+0x2b/0x60 fs/namei.c:2875 do_readlinkat+0xcd/0x2f0 fs/stat.c:468 __do_sys_readlink fs/stat.c:501 [inline] __se_sys_readlink fs/stat.c:498 [inline] __x64_sys_readlink+0x74/0xb0 fs/stat.c:498 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff88810e1b9f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88810e1b9f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88810e1ba000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88810e1ba080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88810e1ba100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================