================================================================== BUG: KASAN: slab-out-of-bounds in __lock_acquire+0xbc/0x1fd0 kernel/locking/lockdep.c:5009 Read of size 8 at addr ffff888022927fb0 by task kworker/u8:0/10 CPU: 0 PID: 10 Comm: kworker/u8:0 Not tainted 6.9.0-rc1-next-20240328-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/29/2024 Workqueue: writeback wb_workfn (flush-8:0) Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114 print_address_description mm/kasan/report.c:377 [inline] print_report+0x169/0x550 mm/kasan/report.c:488 kasan_report+0x143/0x180 mm/kasan/report.c:601 __lock_acquire+0xbc/0x1fd0 kernel/locking/lockdep.c:5009 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:351 [inline] wb_writeback+0x66f/0xd30 fs/fs-writeback.c:2160 wb_check_old_data_flush fs/fs-writeback.c:2233 [inline] wb_do_writeback fs/fs-writeback.c:2286 [inline] wb_workfn+0xba1/0x1090 fs/fs-writeback.c:2314 process_one_work kernel/workqueue.c:3218 [inline] process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3299 worker_thread+0x86d/0xd70 kernel/workqueue.c:3380 kthread+0x2f0/0x390 kernel/kthread.c:388 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:243 Allocated by task 6531: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:312 [inline] __kasan_slab_alloc+0x66/0x80 mm/kasan/common.c:338 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3867 [inline] slab_alloc_node mm/slub.c:3927 [inline] kmem_cache_alloc_noprof+0x135/0x2a0 mm/slub.c:3934 __kernfs_new_node+0xd8/0x870 fs/kernfs/dir.c:624 kernfs_new_node+0x137/0x240 fs/kernfs/dir.c:700 kernfs_create_dir_ns+0x43/0x120 fs/kernfs/dir.c:1061 sysfs_create_dir_ns+0x189/0x3a0 fs/sysfs/dir.c:59 create_dir lib/kobject.c:73 [inline] kobject_add_internal+0x435/0x8d0 lib/kobject.c:240 kobject_add_varg lib/kobject.c:374 [inline] kobject_init_and_add+0x124/0x190 lib/kobject.c:457 netdev_queue_add_kobject net/core/net-sysfs.c:1786 [inline] netdev_queue_update_kobjects+0x1ee/0x5f0 net/core/net-sysfs.c:1838 register_queue_kobjects net/core/net-sysfs.c:1900 [inline] netdev_register_kobject+0x265/0x320 net/core/net-sysfs.c:2140 register_netdevice+0x11ff/0x1a10 net/core/dev.c:10325 rtnl_newlink_create net/core/rtnetlink.c:3496 [inline] __rtnl_newlink net/core/rtnetlink.c:3714 [inline] rtnl_newlink+0x1726/0x20a0 net/core/rtnetlink.c:3727 rtnetlink_rcv_msg+0x89b/0x10d0 net/core/rtnetlink.c:6595 netlink_rcv_skb+0x1e3/0x430 net/netlink/af_netlink.c:2559 netlink_unicast_kernel net/netlink/af_netlink.c:1335 [inline] netlink_unicast+0x7ea/0x980 net/netlink/af_netlink.c:1361 netlink_sendmsg+0x8e1/0xcb0 net/netlink/af_netlink.c:1905 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg+0x221/0x270 net/socket.c:745 __sys_sendto+0x3a4/0x4f0 net/socket.c:2191 __do_sys_sendto net/socket.c:2203 [inline] __se_sys_sendto net/socket.c:2199 [inline] __x64_sys_sendto+0xde/0x100 net/socket.c:2199 do_syscall_64+0xfb/0x240 entry_SYSCALL_64_after_hwframe+0x6d/0x75 The buggy address belongs to the object at ffff888022927f00 which belongs to the cache kernfs_node_cache of size 176 The buggy address is located 0 bytes to the right of allocated 176-byte region [ffff888022927f00, ffff888022927fb0) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x22927 flags: 0xfff80000000000(node=0|zone=1|lastcpupid=0xfff) page_type: 0xffffefff(slab) raw: 00fff80000000000 ffff8880162abdc0 ffffea000171f9c0 dead000000000006 raw: 0000000000000000 0000000000110011 00000001ffffefff 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 6107, tgid -557101228 (syz-executor.3), ts 6114, free_ts 126035260654 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1487 prep_new_page mm/page_alloc.c:1495 [inline] get_page_from_freelist+0x2e8a/0x2f40 mm/page_alloc.c:3454 __alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4712 __alloc_pages_node_noprof include/linux/gfp.h:244 [inline] alloc_pages_node_noprof include/linux/gfp.h:271 [inline] alloc_slab_page+0x5f/0x120 mm/slub.c:2249 allocate_slab+0x5a/0x2e0 mm/slub.c:2412 new_slab mm/slub.c:2465 [inline] ___slab_alloc+0xea8/0x1430 mm/slub.c:3599 __slab_alloc+0x58/0xa0 mm/slub.c:3684 __slab_alloc_node mm/slub.c:3737 [inline] slab_alloc_node mm/slub.c:3915 [inline] kmem_cache_alloc_noprof+0x1c1/0x2a0 mm/slub.c:3934 __kernfs_new_node+0xd8/0x870 fs/kernfs/dir.c:624 kernfs_new_node+0x137/0x240 fs/kernfs/dir.c:700 __kernfs_create_file+0x49/0x2e0 fs/kernfs/file.c:1027 sysfs_add_file_mode_ns+0x24a/0x310 fs/sysfs/file.c:307 create_files fs/sysfs/group.c:76 [inline] internal_create_group+0x7a7/0x11d0 fs/sysfs/group.c:180 internal_create_groups fs/sysfs/group.c:220 [inline] sysfs_create_groups+0x56/0x120 fs/sysfs/group.c:246 device_add_groups drivers/base/core.c:2814 [inline] device_add_attrs+0x199/0x600 drivers/base/core.c:2934 device_add+0x576/0xbf0 drivers/base/core.c:3666 page last free pid 6040 tgid 6039 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1110 [inline] free_unref_folios+0xf23/0x19e0 mm/page_alloc.c:2666 folios_put_refs+0x93a/0xa60 mm/swap.c:1034 free_pages_and_swap_cache+0x2ea/0x690 mm/swap_state.c:329 __tlb_batch_free_encoded_pages mm/mmu_gather.c:136 [inline] tlb_batch_pages_flush mm/mmu_gather.c:149 [inline] tlb_flush_mmu_free mm/mmu_gather.c:366 [inline] tlb_flush_mmu+0x3a3/0x680 mm/mmu_gather.c:373 zap_pte_range mm/memory.c:1683 [inline] zap_pmd_range mm/memory.c:1722 [inline] zap_pud_range mm/memory.c:1751 [inline] zap_p4d_range mm/memory.c:1772 [inline] unmap_page_range+0x3e79/0x4870 mm/memory.c:1793 unmap_vmas+0x3cc/0x5f0 mm/memory.c:1883 exit_mmap+0x268/0xcf0 mm/mmap.c:3266 __mmput+0x115/0x3c0 kernel/fork.c:1345 exit_mm+0x220/0x310 kernel/exit.c:569 do_exit+0x99e/0x27e0 kernel/exit.c:865 do_group_exit+0x207/0x2c0 kernel/exit.c:1027 get_signal+0x16a1/0x1740 kernel/signal.c:2911 arch_do_signal_or_restart+0x96/0x860 arch/x86/kernel/signal.c:310 exit_to_user_mode_loop kernel/entry/common.c:111 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0xc9/0x360 kernel/entry/common.c:218 do_syscall_64+0x10a/0x240 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x6d/0x75 Memory state around the buggy address: ffff888022927e80: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ffff888022927f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888022927f80: 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc ^ ffff888022928000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888022928080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================