================================================================== BUG: KASAN: slab-use-after-free in __create_pipe include/linux/usb.h:2012 [inline] BUG: KASAN: slab-use-after-free in send_packet+0xa90/0xc30 drivers/media/rc/imon.c:627 Read of size 4 at addr ffff88813e3fe000 by task syz-executor.0/31734 CPU: 1 PID: 31734 Comm: syz-executor.0 Not tainted 6.4.0-rc5-syzkaller-gd37537a1f7cf #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/25/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106 print_address_description.constprop.0+0x2c/0x3c0 mm/kasan/report.c:351 print_report mm/kasan/report.c:462 [inline] kasan_report+0x11c/0x130 mm/kasan/report.c:572 __create_pipe include/linux/usb.h:2012 [inline] send_packet+0xa90/0xc30 drivers/media/rc/imon.c:627 vfd_write+0x2fc/0x5d0 drivers/media/rc/imon.c:989 vfs_write+0x2ae/0xd50 fs/read_write.c:582 ksys_write+0x12b/0x250 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fef303c5169 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fef2f6f6168 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007fef304e5120 RCX: 00007fef303c5169 RDX: 0000000000000001 RSI: 0000000020000040 RDI: 0000000000000004 RBP: 00007fef30420ca1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffcc5b18c5f R14: 00007fef2f6f6300 R15: 0000000000022000 Allocated by task 27907: kasan_save_stack+0x22/0x40 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+0x7b/0x90 mm/kasan/common.c:383 kmalloc include/linux/slab.h:559 [inline] kzalloc include/linux/slab.h:680 [inline] usb_alloc_dev+0x55/0xf00 drivers/usb/core/usb.c:658 hub_port_connect drivers/usb/core/hub.c:5309 [inline] hub_port_connect_change drivers/usb/core/hub.c:5551 [inline] port_event drivers/usb/core/hub.c:5711 [inline] hub_event+0x28a6/0x4ed0 drivers/usb/core/hub.c:5793 process_one_work+0x99a/0x15e0 kernel/workqueue.c:2405 worker_thread+0x67d/0x10c0 kernel/workqueue.c:2552 kthread+0x344/0x440 kernel/kthread.c:379 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Freed by task 5359: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2e/0x40 mm/kasan/generic.c:521 ____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:162 [inline] slab_free_hook mm/slub.c:1781 [inline] slab_free_freelist_hook mm/slub.c:1807 [inline] slab_free mm/slub.c:3786 [inline] __kmem_cache_free+0x99/0x320 mm/slub.c:3799 device_release+0xa3/0x240 drivers/base/core.c:2484 kobject_cleanup lib/kobject.c:683 [inline] kobject_release lib/kobject.c:714 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x1c2/0x4d0 lib/kobject.c:731 put_device+0x1f/0x30 drivers/base/core.c:3733 hub_port_connect drivers/usb/core/hub.c:5246 [inline] hub_port_connect_change drivers/usb/core/hub.c:5551 [inline] port_event drivers/usb/core/hub.c:5711 [inline] hub_event+0x2073/0x4ed0 drivers/usb/core/hub.c:5793 process_one_work+0x99a/0x15e0 kernel/workqueue.c:2405 worker_thread+0x67d/0x10c0 kernel/workqueue.c:2552 kthread+0x344/0x440 kernel/kthread.c:379 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 The buggy address belongs to the object at ffff88813e3fe000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 0 bytes inside of freed 2048-byte region [ffff88813e3fe000, ffff88813e3fe800) The buggy address belongs to the physical page: page:ffffea0004f8fe00 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88813e3f8000 pfn:0x13e3f8 head:ffffea0004f8fe00 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 ffffea0004d57410 ffffea000467da10 raw: ffff88813e3f8000 0000000000080006 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 2344, tgid 2344 (klogd), ts 2426034666784, free_ts 2425865003361 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2db/0x350 mm/page_alloc.c:1731 prep_new_page mm/page_alloc.c:1738 [inline] get_page_from_freelist+0x13a1/0x2aa0 mm/page_alloc.c:3502 __alloc_pages+0x1cb/0x4a0 mm/page_alloc.c:4768 alloc_pages+0x1aa/0x270 mm/mempolicy.c:2279 alloc_slab_page mm/slub.c:1851 [inline] allocate_slab+0x25f/0x390 mm/slub.c:1998 new_slab mm/slub.c:2051 [inline] ___slab_alloc+0xa91/0x1400 mm/slub.c:3192 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3291 __slab_alloc_node mm/slub.c:3344 [inline] slab_alloc_node mm/slub.c:3441 [inline] __kmem_cache_alloc_node+0x291/0x2d0 mm/slub.c:3490 kmalloc_trace+0x26/0xe0 mm/slab_common.c:1057 kmalloc include/linux/slab.h:559 [inline] syslog_print+0xc7/0x580 kernel/printk/printk.c:1553 do_syslog.part.0+0x1f2/0x570 kernel/printk/printk.c:1732 do_syslog kernel/printk/printk.c:1822 [inline] __do_sys_syslog kernel/printk/printk.c:1824 [inline] __se_sys_syslog kernel/printk/printk.c:1822 [inline] __x64_sys_syslog+0x9b/0xd0 kernel/printk/printk.c:1822 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1302 [inline] free_unref_page_prepare+0x613/0xc80 mm/page_alloc.c:2564 free_unref_page+0x33/0x2a0 mm/page_alloc.c:2659 __unfreeze_partials+0x17c/0x1a0 mm/slub.c:2636 qlink_free mm/kasan/quarantine.c:166 [inline] qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:185 kasan_quarantine_reduce+0x195/0x220 mm/kasan/quarantine.c:292 __kasan_slab_alloc+0x45/0x60 mm/kasan/common.c:305 kasan_slab_alloc include/linux/kasan.h:186 [inline] slab_post_alloc_hook mm/slab.h:711 [inline] slab_alloc_node mm/slub.c:3451 [inline] __kmem_cache_alloc_node+0x185/0x2d0 mm/slub.c:3490 kmalloc_trace+0x26/0xe0 mm/slab_common.c:1057 kmalloc include/linux/slab.h:559 [inline] usb_cache_string+0x62/0x160 drivers/usb/core/message.c:1027 usb_set_configuration+0x1668/0x1bc0 drivers/usb/core/message.c:2183 usb_generic_driver_probe+0xcf/0x130 drivers/usb/core/generic.c:238 usb_probe_device+0xd8/0x2c0 drivers/usb/core/driver.c:293 call_driver_probe drivers/base/dd.c:579 [inline] really_probe+0x240/0xca0 drivers/base/dd.c:658 __driver_probe_device+0x1df/0x4b0 drivers/base/dd.c:800 driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:830 __device_attach_driver+0x1d4/0x2e0 drivers/base/dd.c:958 Memory state around the buggy address: ffff88813e3fdf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88813e3fdf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88813e3fe000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88813e3fe080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88813e3fe100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================