usb 5-1: Falling back to sysfs fallback for: ueagle-atm/eagleII.fw ================================================================== BUG: KASAN: slab-use-after-free in kernfs_root fs/kernfs/kernfs-internal.h:68 [inline] BUG: KASAN: slab-use-after-free in kernfs_add_one+0x4da/0x530 fs/kernfs/dir.c:793 Read of size 8 at addr ffff8880193ca2e8 by task kworker/1:5/5125 CPU: 1 PID: 5125 Comm: kworker/1:5 Not tainted 6.4.0-next-20230707-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/03/2023 Workqueue: events request_firmware_work_func 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:364 print_report mm/kasan/report.c:475 [inline] kasan_report+0x11d/0x130 mm/kasan/report.c:588 kernfs_root fs/kernfs/kernfs-internal.h:68 [inline] kernfs_add_one+0x4da/0x530 fs/kernfs/dir.c:793 kernfs_create_dir_ns+0x18f/0x230 fs/kernfs/dir.c:1046 sysfs_create_dir_ns+0x12b/0x290 fs/sysfs/dir.c:59 create_dir lib/kobject.c:65 [inline] kobject_add_internal+0x2c9/0x9c0 lib/kobject.c:233 kobject_add_varg lib/kobject.c:367 [inline] kobject_add+0x158/0x230 lib/kobject.c:419 class_dir_create_and_add drivers/base/core.c:3169 [inline] get_device_parent+0x33d/0x4e0 drivers/base/core.c:3220 device_add+0x2b4/0x1a40 drivers/base/core.c:3549 fw_load_sysfs_fallback drivers/base/firmware_loader/fallback.c:82 [inline] fw_load_from_user_helper drivers/base/firmware_loader/fallback.c:158 [inline] firmware_fallback_sysfs+0x2d9/0xc10 drivers/base/firmware_loader/fallback.c:234 _request_firmware+0xc67/0x1290 drivers/base/firmware_loader/main.c:909 request_firmware_work_func+0xe1/0x240 drivers/base/firmware_loader/main.c:1160 process_one_work+0xa34/0x16f0 kernel/workqueue.c:2597 worker_thread+0x67d/0x10c0 kernel/workqueue.c:2748 kthread+0x344/0x440 kernel/kthread.c:389 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Allocated by task 5125: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 __kasan_slab_alloc+0x7f/0x90 mm/kasan/common.c:328 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+0x173/0x390 mm/slub.c:3494 kmem_cache_zalloc include/linux/slab.h:693 [inline] __kernfs_new_node+0xd4/0x8c0 fs/kernfs/dir.c:611 kernfs_new_node fs/kernfs/dir.c:675 [inline] kernfs_create_dir_ns+0xa0/0x230 fs/kernfs/dir.c:1036 sysfs_create_dir_ns+0x12b/0x290 fs/sysfs/dir.c:59 create_dir lib/kobject.c:65 [inline] kobject_add_internal+0x2c9/0x9c0 lib/kobject.c:233 kobject_add_varg lib/kobject.c:367 [inline] kobject_add+0x158/0x230 lib/kobject.c:419 class_dir_create_and_add drivers/base/core.c:3169 [inline] get_device_parent+0x33d/0x4e0 drivers/base/core.c:3220 device_add+0x2b4/0x1a40 drivers/base/core.c:3549 fw_load_sysfs_fallback drivers/base/firmware_loader/fallback.c:82 [inline] fw_load_from_user_helper drivers/base/firmware_loader/fallback.c:158 [inline] firmware_fallback_sysfs+0x2d9/0xc10 drivers/base/firmware_loader/fallback.c:234 _request_firmware+0xc67/0x1290 drivers/base/firmware_loader/main.c:909 request_firmware_work_func+0xe1/0x240 drivers/base/firmware_loader/main.c:1160 process_one_work+0xa34/0x16f0 kernel/workqueue.c:2597 worker_thread+0x67d/0x10c0 kernel/workqueue.c:2748 kthread+0x344/0x440 kernel/kthread.c:389 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Freed by task 5028: kasan_save_stack+0x22/0x40 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+0x160/0x1c0 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+0x8b/0x1c0 mm/slub.c:1818 slab_free mm/slub.c:3801 [inline] kmem_cache_free+0xf0/0x490 mm/slub.c:3823 kernfs_put.part.0+0x228/0x470 fs/kernfs/dir.c:565 kernfs_put+0x46/0x50 fs/kernfs/dir.c:539 __kernfs_remove+0x507/0x780 fs/kernfs/dir.c:1483 kernfs_remove+0x7b/0xa0 fs/kernfs/dir.c:1503 sysfs_remove_dir+0xc5/0x100 fs/sysfs/dir.c:101 __kobject_del+0xe2/0x1f0 lib/kobject.c:597 kobject_del lib/kobject.c:620 [inline] kobject_del+0x40/0x60 lib/kobject.c:612 device_del+0x664/0xa30 drivers/base/core.c:3823 usb_disconnect+0x51e/0x8a0 drivers/usb/core/hub.c:2279 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+0x1fbf/0x4e40 drivers/usb/core/hub.c:5808 process_one_work+0xa34/0x16f0 kernel/workqueue.c:2597 process_scheduled_works kernel/workqueue.c:2664 [inline] worker_thread+0x881/0x10c0 kernel/workqueue.c:2750 kthread+0x344/0x440 kernel/kthread.c:389 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 The buggy address belongs to the object at ffff8880193ca2b8 which belongs to the cache kernfs_node_cache of size 168 The buggy address is located 48 bytes inside of freed 168-byte region [ffff8880193ca2b8, ffff8880193ca360) The buggy address belongs to the physical page: page:ffffea000064f280 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x193ca anon flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000200 ffff888014675c80 ffffea00007c6580 0000000000000009 raw: 0000000000000000 0000000080110011 00000001ffffffff 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 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY), pid 5121, tgid 5121 (kworker/0:3), ts 284849235985, free_ts 284847738191 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2db/0x350 mm/page_alloc.c:1569 prep_new_page mm/page_alloc.c:1576 [inline] get_page_from_freelist+0xfd9/0x2c40 mm/page_alloc.c:3256 __alloc_pages+0x1cb/0x4a0 mm/page_alloc.c:4512 alloc_pages+0x1aa/0x270 mm/mempolicy.c:2279 alloc_slab_page mm/slub.c:1862 [inline] allocate_slab+0x25f/0x390 mm/slub.c:2009 new_slab mm/slub.c:2062 [inline] ___slab_alloc+0xbc3/0x15d0 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] slab_alloc mm/slub.c:3478 [inline] __kmem_cache_alloc_lru mm/slub.c:3485 [inline] kmem_cache_alloc+0x371/0x390 mm/slub.c:3494 kmem_cache_zalloc include/linux/slab.h:693 [inline] __kernfs_new_node+0xd4/0x8c0 fs/kernfs/dir.c:611 kernfs_new_node+0x97/0x120 fs/kernfs/dir.c:675 __kernfs_create_file+0x55/0x350 fs/kernfs/file.c:1047 sysfs_add_file_mode_ns+0x213/0x3f0 fs/sysfs/file.c:294 create_files fs/sysfs/group.c:64 [inline] internal_create_group+0x322/0xba0 fs/sysfs/group.c:152 internal_create_groups.part.0+0x90/0x140 fs/sysfs/group.c:192 internal_create_groups fs/sysfs/group.c:188 [inline] sysfs_create_groups+0x29/0x50 fs/sysfs/group.c:218 device_add_groups drivers/base/core.c:2726 [inline] device_add_attrs drivers/base/core.c:2846 [inline] device_add+0x6de/0x1a40 drivers/base/core.c:3579 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1160 [inline] free_unref_page_prepare+0x62e/0xcb0 mm/page_alloc.c:2383 free_unref_page+0x33/0x370 mm/page_alloc.c:2478 __unfreeze_partials+0x1fe/0x220 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+0x195/0x220 mm/kasan/quarantine.c:292 __kasan_slab_alloc+0x63/0x90 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+0x173/0x390 mm/slub.c:3494 getname_flags.part.0+0x50/0x4f0 fs/namei.c:140 getname_flags+0x9e/0xe0 include/linux/audit.h:319 user_path_at_empty+0x2f/0x60 fs/namei.c:2906 user_path_at include/linux/namei.h:57 [inline] inotify_find_inode+0x32/0x170 fs/notify/inotify/inotify_user.c:378 __do_sys_inotify_add_watch fs/notify/inotify/inotify_user.c:777 [inline] __se_sys_inotify_add_watch fs/notify/inotify/inotify_user.c:730 [inline] __x64_sys_inotify_add_watch+0x1fb/0x360 fs/notify/inotify/inotify_user.c:730 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 Memory state around the buggy address: ffff8880193ca180: fb fb fc fc fc fc fc fc fc fc fb fb fb fb fb fb ffff8880193ca200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc >ffff8880193ca280: fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb fb ^ ffff8880193ca300: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ffff8880193ca380: fc fc fc fc fa fb fb fb fb fb fb fb fb fb fb fb ==================================================================