================================================================== BUG: KASAN: slab-use-after-free in __create_pipe include/linux/usb.h:2012 [inline] BUG: KASAN: slab-use-after-free in send_packet+0xa7f/0xc20 drivers/media/rc/imon.c:627 Read of size 4 at addr ffff88803590a000 by task syz-executor.1/6049 CPU: 0 PID: 6049 Comm: syz-executor.1 Not tainted 6.5.0-rc7-syzkaller-g89bf6209cad6 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 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:2012 [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:0x7f54dd079a29 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f54de1c30c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f54dd18c050 RCX: 00007f54dd079a29 RDX: 0000000000000001 RSI: 0000000020001000 RDI: 0000000000000004 RBP: 00007f54dd0d5170 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000006e R14: 00007f54dd18c050 R15: 00007ffe623bd528 Allocated by task 5457: 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+0xa3/0xb0 mm/kasan/common.c:383 kmalloc include/linux/slab.h:582 [inline] kzalloc include/linux/slab.h:703 [inline] usb_alloc_dev+0x55/0xe50 drivers/usb/core/usb.c:658 hub_port_connect drivers/usb/core/hub.c:5324 [inline] hub_port_connect_change drivers/usb/core/hub.c:5566 [inline] port_event drivers/usb/core/hub.c:5726 [inline] hub_event+0x2aa9/0x5230 drivers/usb/core/hub.c:5808 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 49: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x28/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] __cache_free mm/slab.c:3370 [inline] __do_kmem_cache_free mm/slab.c:3557 [inline] __kmem_cache_free+0xcc/0x2d0 mm/slab.c:3564 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:5261 [inline] hub_port_connect_change drivers/usb/core/hub.c:5566 [inline] port_event drivers/usb/core/hub.c:5726 [inline] hub_event+0x21bd/0x5230 drivers/usb/core/hub.c:5808 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 ffff88803590a000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 0 bytes inside of freed 2048-byte region [ffff88803590a000, ffff88803590a800) The buggy address belongs to the physical page: page:ffffea0000d64280 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x3590a flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) page_type: 0x1() raw: 00fff00000000200 ffff888012840800 ffffea000082acd0 ffffea0000d9ef90 raw: 0000000000000000 ffff88803590a000 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x3c2020(__GFP_HIGH|__GFP_NOWARN|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL|__GFP_THISNODE), pid 5372, tgid 5372 (syz-executor.2), ts 78374232760, free_ts 54634945569 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+0x10a9/0x31e0 mm/page_alloc.c:3221 __alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4477 __alloc_pages_node include/linux/gfp.h:237 [inline] kmem_getpages mm/slab.c:1356 [inline] cache_grow_begin+0x99/0x3a0 mm/slab.c:2550 cache_alloc_refill+0x294/0x3a0 mm/slab.c:2923 ____cache_alloc mm/slab.c:2999 [inline] ____cache_alloc mm/slab.c:2982 [inline] __do_cache_alloc mm/slab.c:3182 [inline] slab_alloc_node mm/slab.c:3230 [inline] __kmem_cache_alloc_node+0x3c9/0x470 mm/slab.c:3521 __do_kmalloc_node mm/slab_common.c:984 [inline] __kmalloc_node_track_caller+0x4d/0x100 mm/slab_common.c:1005 kmalloc_reserve+0xef/0x270 net/core/skbuff.c:575 __alloc_skb+0x12b/0x330 net/core/skbuff.c:644 alloc_skb include/linux/skbuff.h:1289 [inline] nlmsg_new include/net/netlink.h:1003 [inline] inet6_ifinfo_notify+0x72/0x140 net/ipv6/addrconf.c:6058 addrconf_notify+0x859/0x1940 net/ipv6/addrconf.c:3667 notifier_call_chain+0xb6/0x3b0 kernel/notifier.c:93 call_netdevice_notifiers_info+0xb9/0x130 net/core/dev.c:1962 call_netdevice_notifiers_extack net/core/dev.c:2000 [inline] call_netdevice_notifiers net/core/dev.c:2014 [inline] __dev_notify_flags+0x12d/0x2e0 net/core/dev.c:8569 dev_change_flags+0x122/0x170 net/core/dev.c:8607 do_setlink+0x1a2a/0x3fa0 net/core/rtnetlink.c:2867 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+0x508/0xb90 mm/page_alloc.c:2348 free_unref_page+0x33/0x3b0 mm/page_alloc.c:2443 vfree+0x181/0x7a0 mm/vmalloc.c:2842 kcov_put kernel/kcov.c:429 [inline] kcov_put+0x26/0x40 kernel/kcov.c:425 kcov_close+0x10/0x20 kernel/kcov.c:525 __fput+0x3f7/0xac0 fs/file_table.c:384 task_work_run+0x14d/0x240 kernel/task_work.c:179 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0xa99/0x2a20 kernel/exit.c:874 do_group_exit+0xd4/0x2a0 kernel/exit.c:1024 get_signal+0x23ea/0x2770 kernel/signal.c:2881 arch_do_signal_or_restart+0x89/0x5f0 arch/x86/kernel/signal.c:308 exit_to_user_mode_loop kernel/entry/common.c:168 [inline] exit_to_user_mode_prepare+0x11f/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline] syscall_exit_to_user_mode+0x1d/0x60 kernel/entry/common.c:297 do_syscall_64+0x44/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff888035909f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888035909f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88803590a000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88803590a080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88803590a100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================