================================================================== BUG: KASAN: slab-use-after-free in __create_pipe include/linux/usb.h:2000 [inline] BUG: KASAN: slab-use-after-free in send_packet+0xa7f/0xc20 drivers/media/rc/imon.c:627 Read of size 4 at addr ffff88811ea40000 by task syz-executor.2/16899 CPU: 0 PID: 16899 Comm: syz-executor.2 Not tainted 6.5.0-rc6-syzkaller-00119-gbbb9e06d2c64 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0xc4/0x620 mm/kasan/report.c:475 kasan_report+0xda/0x110 mm/kasan/report.c:588 __create_pipe include/linux/usb.h:2000 [inline] send_packet+0xa7f/0xc20 drivers/media/rc/imon.c:627 vfd_write+0x2f6/0x610 drivers/media/rc/imon.c:989 vfs_write+0x2a4/0xe40 fs/read_write.c:582 ksys_write+0x12f/0x250 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f370a59cae9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f37098dd0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f370a6bc120 RCX: 00007f370a59cae9 RDX: 0000000000000001 RSI: 0000000020000040 RDI: 0000000000000004 RBP: 00007f370a5e847a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000006e R14: 00007f370a6bc120 R15: 00007ffe0ce5cb98 Allocated by task 7812: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0x87/0x90 mm/kasan/common.c:383 kmalloc include/linux/slab.h:582 [inline] kzalloc include/linux/slab.h:703 [inline] usb_alloc_dev+0x55/0xdb0 drivers/usb/core/usb.c:650 hub_port_connect drivers/usb/core/hub.c:5343 [inline] hub_port_connect_change drivers/usb/core/hub.c:5580 [inline] port_event drivers/usb/core/hub.c:5740 [inline] hub_event+0x2903/0x4f30 drivers/usb/core/hub.c:5822 process_one_work+0xaa2/0x16f0 kernel/workqueue.c:2600 worker_thread+0x687/0x1110 kernel/workqueue.c:2751 kthread+0x33a/0x430 kernel/kthread.c:389 ret_from_fork+0x2c/0x70 arch/x86/kernel/process.c:145 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 Freed by task 718: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:522 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x13f/0x190 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:162 [inline] slab_free_hook mm/slub.c:1792 [inline] slab_free_freelist_hook mm/slub.c:1818 [inline] slab_free mm/slub.c:3801 [inline] __kmem_cache_free+0xff/0x340 mm/slub.c:3814 device_release+0xa1/0x240 drivers/base/core.c:2484 kobject_cleanup lib/kobject.c:682 [inline] kobject_release lib/kobject.c:713 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x1f7/0x5b0 lib/kobject.c:730 put_device+0x1f/0x30 drivers/base/core.c:3733 hub_port_connect drivers/usb/core/hub.c:5280 [inline] hub_port_connect_change drivers/usb/core/hub.c:5580 [inline] port_event drivers/usb/core/hub.c:5740 [inline] hub_event+0x1be0/0x4f30 drivers/usb/core/hub.c:5822 process_one_work+0xaa2/0x16f0 kernel/workqueue.c:2600 worker_thread+0x687/0x1110 kernel/workqueue.c:2751 kthread+0x33a/0x430 kernel/kthread.c:389 ret_from_fork+0x2c/0x70 arch/x86/kernel/process.c:145 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 The buggy address belongs to the object at ffff88811ea40000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 0 bytes inside of freed 2048-byte region [ffff88811ea40000, ffff88811ea40800) The buggy address belongs to the physical page: page:ffffea00047a9000 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11ea40 head:ffffea00047a9000 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x200000000010200(slab|head|node=0|zone=2) page_type: 0xffffffff() raw: 0200000000010200 ffff888100042000 dead000000000100 dead000000000122 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 0x1d2000(__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 9999, tgid 9999 (kworker/1:9), ts 681464384161, free_ts 680815493277 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2d2/0x350 mm/page_alloc.c:1570 prep_new_page mm/page_alloc.c:1577 [inline] get_page_from_freelist+0x10e1/0x2fd0 mm/page_alloc.c:3221 __alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4477 alloc_pages+0x1a9/0x270 mm/mempolicy.c:2292 alloc_slab_page mm/slub.c:1862 [inline] allocate_slab+0x24e/0x380 mm/slub.c:2009 new_slab mm/slub.c:2062 [inline] ___slab_alloc+0x8bc/0x1570 mm/slub.c:3215 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3314 __slab_alloc_node mm/slub.c:3367 [inline] slab_alloc_node mm/slub.c:3460 [inline] __kmem_cache_alloc_node+0x132/0x310 mm/slub.c:3509 kmalloc_trace+0x25/0xe0 mm/slab_common.c:1076 kmalloc include/linux/slab.h:582 [inline] kzalloc include/linux/slab.h:703 [inline] usb_set_configuration+0x2a8/0x1c40 drivers/usb/core/message.c:2034 usb_generic_driver_probe+0xca/0x130 drivers/usb/core/generic.c:238 usb_probe_device+0xda/0x2c0 drivers/usb/core/driver.c:293 call_driver_probe drivers/base/dd.c:579 [inline] really_probe+0x234/0xc90 drivers/base/dd.c:658 __driver_probe_device+0x1de/0x4b0 drivers/base/dd.c:798 driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:828 __device_attach_driver+0x1d4/0x300 drivers/base/dd.c:956 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1161 [inline] free_unref_page_prepare+0x4ec/0xb60 mm/page_alloc.c:2348 free_unref_page+0x33/0x2c0 mm/page_alloc.c:2443 __unfreeze_partials+0x21d/0x240 mm/slub.c:2647 qlink_free mm/kasan/quarantine.c:166 [inline] qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:185 kasan_quarantine_reduce+0x18b/0x1d0 mm/kasan/quarantine.c:292 __kasan_slab_alloc+0x4a/0x70 mm/kasan/common.c:305 kasan_slab_alloc include/linux/kasan.h:186 [inline] slab_post_alloc_hook mm/slab.h:762 [inline] slab_alloc_node mm/slub.c:3470 [inline] slab_alloc mm/slub.c:3478 [inline] __kmem_cache_alloc_lru mm/slub.c:3485 [inline] kmem_cache_alloc_lru+0x231/0x600 mm/slub.c:3501 __d_alloc+0x32/0xac0 fs/dcache.c:1769 d_alloc+0x4e/0x220 fs/dcache.c:1849 d_alloc_parallel+0xe9/0x15f0 fs/dcache.c:2638 __lookup_slow+0x194/0x450 fs/namei.c:1675 lookup_slow fs/namei.c:1707 [inline] walk_component+0x349/0x5a0 fs/namei.c:1998 link_path_walk.part.0.constprop.0+0x71f/0xce0 fs/namei.c:2325 link_path_walk fs/namei.c:2250 [inline] path_openat+0x231/0x29c0 fs/namei.c:3789 do_filp_open+0x1de/0x430 fs/namei.c:3820 do_sys_openat2+0x176/0x1e0 fs/open.c:1407 Memory state around the buggy address: ffff88811ea3ff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88811ea3ff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88811ea40000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88811ea40080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88811ea40100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================