================================================================== BUG: KASAN: slab-out-of-bounds in copy_page_from_iter_atomic+0xef6/0x1b30 lib/iov_iter.c:969 Read of size 4096 at addr ffff888140cbd000 by task kworker/u4:17/22764 CPU: 0 PID: 22764 Comm: kworker/u4:17 Not tainted 5.19.0-rc1-next-20220610-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: loop1 loop_workfn Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description.constprop.0.cold+0xeb/0x495 mm/kasan/report.c:313 print_report mm/kasan/report.c:429 [inline] kasan_report.cold+0xf4/0x1c6 mm/kasan/report.c:491 check_region_inline mm/kasan/generic.c:183 [inline] kasan_check_range+0x13d/0x180 mm/kasan/generic.c:189 memcpy+0x20/0x60 mm/kasan/shadow.c:65 copy_page_from_iter_atomic+0xef6/0x1b30 lib/iov_iter.c:969 generic_perform_write+0x2b8/0x560 mm/filemap.c:3735 __generic_file_write_iter+0x2aa/0x4d0 mm/filemap.c:3855 generic_file_write_iter+0xd7/0x220 mm/filemap.c:3887 call_write_iter include/linux/fs.h:2057 [inline] do_iter_readv_writev+0x3d1/0x640 fs/read_write.c:742 do_iter_write+0x182/0x700 fs/read_write.c:868 vfs_iter_write+0x70/0xa0 fs/read_write.c:909 lo_write_bvec drivers/block/loop.c:249 [inline] lo_write_simple drivers/block/loop.c:271 [inline] do_req_filebacked drivers/block/loop.c:495 [inline] loop_handle_cmd drivers/block/loop.c:1859 [inline] loop_process_work+0xd83/0x2050 drivers/block/loop.c:1894 process_one_work+0x996/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e9/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:302 Allocated by task 3640: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:436 [inline] __kasan_slab_alloc+0x90/0xc0 mm/kasan/common.c:469 kasan_slab_alloc include/linux/kasan.h:224 [inline] slab_post_alloc_hook mm/slab.h:750 [inline] slab_alloc_node mm/slub.c:3214 [inline] slab_alloc mm/slub.c:3222 [inline] __kmem_cache_alloc_lru mm/slub.c:3229 [inline] kmem_cache_alloc+0x142/0x3b0 mm/slub.c:3239 radix_tree_node_alloc.constprop.0+0x1e4/0x350 lib/radix-tree.c:251 idr_get_free+0x554/0xa60 lib/radix-tree.c:1505 idr_alloc_u32+0x170/0x2d0 lib/idr.c:46 idr_alloc_cyclic+0x102/0x230 lib/idr.c:125 __kernfs_new_node+0x117/0x8b0 fs/kernfs/dir.c:599 kernfs_new_node+0x93/0x120 fs/kernfs/dir.c:655 __kernfs_create_file+0x51/0x350 fs/kernfs/file.c:987 sysfs_add_file_mode_ns+0x20f/0x3f0 fs/sysfs/file.c:294 create_files fs/sysfs/group.c:64 [inline] internal_create_group+0x322/0xb10 fs/sysfs/group.c:148 netdev_queue_add_kobject net/core/net-sysfs.c:1671 [inline] netdev_queue_update_kobjects+0x3aa/0x4e0 net/core/net-sysfs.c:1717 register_queue_kobjects net/core/net-sysfs.c:1778 [inline] netdev_register_kobject+0x330/0x400 net/core/net-sysfs.c:2018 register_netdevice+0xd9d/0x15b0 net/core/dev.c:10045 veth_newlink+0x33f/0x9a0 drivers/net/veth.c:1764 rtnl_newlink_create net/core/rtnetlink.c:3363 [inline] __rtnl_newlink+0x1087/0x17e0 net/core/rtnetlink.c:3580 rtnl_newlink+0x64/0xa0 net/core/rtnetlink.c:3593 rtnetlink_rcv_msg+0x43a/0xc90 net/core/rtnetlink.c:6089 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2501 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline] netlink_unicast+0x543/0x7f0 net/netlink/af_netlink.c:1345 netlink_sendmsg+0x917/0xe10 net/netlink/af_netlink.c:1921 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:734 __sys_sendto+0x21a/0x320 net/socket.c:2119 __do_sys_sendto net/socket.c:2131 [inline] __se_sys_sendto net/socket.c:2127 [inline] __x64_sys_sendto+0xdd/0x1b0 net/socket.c:2127 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 Last potentially related work creation: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 __kasan_record_aux_stack+0xbe/0xd0 mm/kasan/generic.c:348 call_rcu+0x99/0x790 kernel/rcu/tree.c:3210 radix_tree_node_free lib/radix-tree.c:308 [inline] delete_node+0xef/0x8c0 lib/radix-tree.c:571 __radix_tree_delete+0x190/0x370 lib/radix-tree.c:1378 radix_tree_delete_item+0xe7/0x230 lib/radix-tree.c:1429 kernfs_put.part.0+0x294/0x540 fs/kernfs/dir.c:545 kernfs_put+0x42/0x50 fs/kernfs/dir.c:521 sysfs_remove_group+0xc2/0x170 fs/sysfs/group.c:292 kernel_add_sysfs_param kernel/params.c:809 [inline] param_sysfs_builtin kernel/params.c:851 [inline] param_sysfs_init+0x2d3/0x43b kernel/params.c:970 do_one_initcall+0x103/0x650 init/main.c:1300 do_initcall_level init/main.c:1375 [inline] do_initcalls init/main.c:1391 [inline] do_basic_setup init/main.c:1410 [inline] kernel_init_freeable+0x6b1/0x73a init/main.c:1617 kernel_init+0x1a/0x1d0 init/main.c:1506 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:302 The buggy address belongs to the object at ffff888140cbcdc0 which belongs to the cache radix_tree_node of size 576 The buggy address is located 0 bytes to the right of 576-byte region [ffff888140cbcdc0, ffff888140cbd000) The buggy address belongs to the physical page: page:ffffea0005032f00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x140cbc head:ffffea0005032f00 order:2 compound_mapcount:0 compound_pincount:0 flags: 0x57ff00000010200(slab|head|node=1|zone=2|lastcpupid=0x7ff) raw: 057ff00000010200 ffffea0005033100 dead000000000003 ffff88801184fc80 raw: 0000000000000000 0000000000170017 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Reclaimable, gfp_mask 0x52830(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_RECLAIMABLE), pid 1, tgid 1 (swapper/0), ts 1915384477, free_ts 0 prep_new_page mm/page_alloc.c:2460 [inline] get_page_from_freelist+0xa64/0x3d10 mm/page_alloc.c:4279 __alloc_pages+0x1c7/0x510 mm/page_alloc.c:5500 alloc_page_interleave+0x1e/0x200 mm/mempolicy.c:2112 alloc_pages+0x2b1/0x310 mm/mempolicy.c:2274 alloc_slab_page mm/slub.c:1797 [inline] allocate_slab+0x26c/0x3c0 mm/slub.c:1942 new_slab mm/slub.c:2002 [inline] ___slab_alloc+0x985/0xd90 mm/slub.c:3002 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3089 slab_alloc_node mm/slub.c:3180 [inline] slab_alloc mm/slub.c:3222 [inline] __kmem_cache_alloc_lru mm/slub.c:3229 [inline] kmem_cache_alloc+0x360/0x3b0 mm/slub.c:3239 radix_tree_node_alloc.constprop.0+0x1e4/0x350 lib/radix-tree.c:251 idr_get_free+0x554/0xa60 lib/radix-tree.c:1505 idr_alloc_u32+0x170/0x2d0 lib/idr.c:46 idr_alloc_cyclic+0x102/0x230 lib/idr.c:125 __kernfs_new_node+0x117/0x8b0 fs/kernfs/dir.c:599 kernfs_new_node+0x93/0x120 fs/kernfs/dir.c:655 __kernfs_create_file+0x51/0x350 fs/kernfs/file.c:987 sysfs_add_file_mode_ns+0x20f/0x3f0 fs/sysfs/file.c:294 page_owner free stack trace missing Memory state around the buggy address: ffff888140cbcf00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888140cbcf80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888140cbd000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff888140cbd080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888140cbd100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================