================================================================== BUG: KASAN: slab-use-after-free in __create_pipe include/linux/usb.h:1979 [inline] BUG: KASAN: slab-use-after-free in send_packet+0xa7d/0xc20 drivers/media/rc/imon.c:627 Read of size 4 at addr ffff88811588c000 by task syz-executor.1/22633 CPU: 0 PID: 22633 Comm: syz-executor.1 Not tainted 6.8.0-rc6-syzkaller-00190-ga788e53c05ae #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 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:377 [inline] print_report+0xc4/0x620 mm/kasan/report.c:488 kasan_report+0xda/0x110 mm/kasan/report.c:601 __create_pipe include/linux/usb.h:1979 [inline] send_packet+0xa7d/0xc20 drivers/media/rc/imon.c:627 vfd_write+0x2f6/0x610 drivers/media/rc/imon.c:989 vfs_write+0x294/0x1100 fs/read_write.c:588 ksys_write+0x12f/0x250 fs/read_write.c:643 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xd3/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x63/0x6b RIP: 0033:0x7fa667d89da9 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:00007fa6670ea0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007fa667eb8050 RCX: 00007fa667d89da9 RDX: 0000000000000001 RSI: 0000000020000000 RDI: 0000000000000006 RBP: 00007fa667dd647a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000006e R14: 00007fa667eb8050 R15: 00007ffe187756f8 Allocated by task 4822: kasan_save_stack+0x33/0x50 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:372 [inline] __kasan_kmalloc+0x87/0x90 mm/kasan/common.c:389 kmalloc include/linux/slab.h:590 [inline] kzalloc include/linux/slab.h:711 [inline] usb_alloc_dev+0x55/0xdb0 drivers/usb/core/usb.c:650 hub_port_connect drivers/usb/core/hub.c:5415 [inline] hub_port_connect_change drivers/usb/core/hub.c:5652 [inline] port_event drivers/usb/core/hub.c:5812 [inline] hub_event+0x2903/0x4f40 drivers/usb/core/hub.c:5894 process_one_work+0x886/0x15d0 kernel/workqueue.c:2633 process_scheduled_works kernel/workqueue.c:2706 [inline] worker_thread+0x8b9/0x1290 kernel/workqueue.c:2787 kthread+0x2c6/0x3a0 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:243 Freed by task 4804: kasan_save_stack+0x33/0x50 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3f/0x60 mm/kasan/generic.c:643 poison_slab_object mm/kasan/common.c:241 [inline] __kasan_slab_free+0x106/0x1b0 mm/kasan/common.c:257 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2121 [inline] slab_free mm/slub.c:4299 [inline] kfree+0x105/0x340 mm/slub.c:4409 device_release+0xa1/0x240 drivers/base/core.c:2499 kobject_cleanup lib/kobject.c:689 [inline] kobject_release lib/kobject.c:720 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x1f7/0x5b0 lib/kobject.c:737 put_device+0x1f/0x30 drivers/base/core.c:3747 hub_port_connect drivers/usb/core/hub.c:5352 [inline] hub_port_connect_change drivers/usb/core/hub.c:5652 [inline] port_event drivers/usb/core/hub.c:5812 [inline] hub_event+0x1be0/0x4f40 drivers/usb/core/hub.c:5894 process_one_work+0x886/0x15d0 kernel/workqueue.c:2633 process_scheduled_works kernel/workqueue.c:2706 [inline] worker_thread+0x8b9/0x1290 kernel/workqueue.c:2787 kthread+0x2c6/0x3a0 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:243 The buggy address belongs to the object at ffff88811588c000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 0 bytes inside of freed 2048-byte region [ffff88811588c000, ffff88811588c800) The buggy address belongs to the physical page: page:ffffea0004562200 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x115888 head:ffffea0004562200 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x200000000000840(slab|head|node=0|zone=2) page_type: 0xffffffff() raw: 0200000000000840 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 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 2382, tgid 2382 (klogd), ts 1736425129792, free_ts 1736393390742 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2d0/0x350 mm/page_alloc.c:1533 prep_new_page mm/page_alloc.c:1540 [inline] get_page_from_freelist+0x139c/0x3470 mm/page_alloc.c:3311 __alloc_pages+0x228/0x2250 mm/page_alloc.c:4567 __alloc_pages_node include/linux/gfp.h:238 [inline] alloc_pages_node include/linux/gfp.h:261 [inline] alloc_slab_page mm/slub.c:2190 [inline] allocate_slab mm/slub.c:2354 [inline] new_slab+0xcc/0x3a0 mm/slub.c:2407 ___slab_alloc+0x4b0/0x1860 mm/slub.c:3540 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3625 __slab_alloc_node mm/slub.c:3678 [inline] slab_alloc_node mm/slub.c:3850 [inline] kmalloc_trace+0x2ce/0x300 mm/slub.c:4007 kmalloc include/linux/slab.h:590 [inline] syslog_print+0xf9/0x5d0 kernel/printk/printk.c:1550 do_syslog+0x2d4/0x580 kernel/printk/printk.c:1728 __do_sys_syslog kernel/printk/printk.c:1820 [inline] __se_sys_syslog kernel/printk/printk.c:1818 [inline] __x64_sys_syslog+0x74/0xb0 kernel/printk/printk.c:1818 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xd3/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x63/0x6b page last free pid 4795 tgid 4795 stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1140 [inline] free_unref_page_prepare+0x504/0xae0 mm/page_alloc.c:2346 free_unref_page+0x33/0x2d0 mm/page_alloc.c:2486 qlink_free mm/kasan/quarantine.c:160 [inline] qlist_free_all+0x58/0x150 mm/kasan/quarantine.c:176 kasan_quarantine_reduce+0x18e/0x1d0 mm/kasan/quarantine.c:283 __kasan_slab_alloc+0x4a/0x70 mm/kasan/common.c:324 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3813 [inline] slab_alloc_node mm/slub.c:3860 [inline] kmem_cache_alloc+0x131/0x2e0 mm/slub.c:3867 getname_flags.part.0+0x50/0x4e0 fs/namei.c:140 getname_flags+0x9c/0xf0 include/linux/audit.h:322 vfs_fstatat+0x9a/0x140 fs/stat.c:303 __do_sys_newfstatat+0x98/0x110 fs/stat.c:468 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xd3/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x63/0x6b Memory state around the buggy address: ffff88811588bf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88811588bf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88811588c000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88811588c080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88811588c100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================