================================================================== BUG: KASAN: slab-out-of-bounds in _copy_to_iter+0xd14/0x1140 lib/iov_iter.c:527 Write of size 22 at addr ffff88807fe97147 by task kworker/1:1/26 CPU: 1 PID: 26 Comm: kworker/1:1 Not tainted 6.1.0-rc3-syzkaller-00158-gee6050c8af96 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Workqueue: events p9_read_work Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:284 [inline] print_report+0x15e/0x45d mm/kasan/report.c:395 kasan_report+0xbb/0x1f0 mm/kasan/report.c:495 check_region_inline mm/kasan/generic.c:183 [inline] kasan_check_range+0x13d/0x180 mm/kasan/generic.c:189 memcpy+0x39/0x60 mm/kasan/shadow.c:66 _copy_to_iter+0xd14/0x1140 lib/iov_iter.c:527 copy_page_to_iter+0xdc/0xa20 lib/iov_iter.c:725 pipe_read+0x50a/0x1100 fs/pipe.c:307 __kernel_read+0x2c6/0x7c0 fs/read_write.c:428 kernel_read+0xbf/0x1c0 fs/read_write.c:446 p9_fd_read net/9p/trans_fd.c:266 [inline] p9_read_work+0x2ac/0x1040 net/9p/trans_fd.c:301 process_one_work+0x9bf/0x1710 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e4/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Allocated by task 3605: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:45 kasan_set_track+0x21/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:371 [inline] ____kasan_kmalloc mm/kasan/common.c:330 [inline] __kasan_kmalloc+0xa1/0xb0 mm/kasan/common.c:380 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slab_common.c:955 [inline] __kmalloc+0x54/0xc0 mm/slab_common.c:968 kmalloc include/linux/slab.h:581 [inline] p9_fcall_init+0x97/0x210 net/9p/client.c:228 p9_tag_alloc+0x208/0x840 net/9p/client.c:293 p9_client_prepare_req+0x177/0x590 net/9p/client.c:631 p9_client_rpc+0x1a1/0xd70 net/9p/client.c:678 p9_client_walk+0x19c/0x540 net/9p/client.c:1152 v9fs_vfs_lookup.part.0+0x143/0x5d0 fs/9p/vfs_inode.c:777 v9fs_vfs_lookup+0x69/0x90 fs/9p/vfs_inode.c:762 __lookup_hash+0x117/0x180 fs/namei.c:1601 filename_create+0x1d6/0x4a0 fs/namei.c:3807 do_mkdirat+0x99/0x310 fs/namei.c:4050 __do_sys_mkdir fs/namei.c:4080 [inline] __se_sys_mkdir fs/namei.c:4078 [inline] __x64_sys_mkdir+0xf2/0x140 fs/namei.c:4078 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+0x63/0xcd The buggy address belongs to the object at ffff88807fe97140 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 7 bytes inside of 32-byte region [ffff88807fe97140, ffff88807fe97160) The buggy address belongs to the physical page: page:ffffea0001ffa5c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7fe97 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 dead000000000100 dead000000000122 ffff888011841500 raw: 0000000000000000 0000000080400040 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 0x12c40(GFP_NOFS|__GFP_NOWARN|__GFP_NORETRY), pid 2942, tgid 2942 (mount), ts 11035136514, free_ts 10617668505 prep_new_page mm/page_alloc.c:2539 [inline] get_page_from_freelist+0x10b5/0x2d50 mm/page_alloc.c:4288 __alloc_pages+0x1c7/0x5a0 mm/page_alloc.c:5555 alloc_pages+0x1a6/0x270 mm/mempolicy.c:2285 alloc_slab_page mm/slub.c:1794 [inline] allocate_slab+0x213/0x300 mm/slub.c:1939 new_slab mm/slub.c:1992 [inline] ___slab_alloc+0xa91/0x1400 mm/slub.c:3180 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3279 slab_alloc_node mm/slub.c:3364 [inline] __kmem_cache_alloc_node+0x191/0x3e0 mm/slub.c:3437 __do_kmalloc_node mm/slab_common.c:954 [inline] __kmalloc+0x44/0xc0 mm/slab_common.c:968 kmalloc include/linux/slab.h:581 [inline] tomoyo_add_entry security/tomoyo/common.c:2022 [inline] tomoyo_supervisor+0xcf8/0xf10 security/tomoyo/common.c:2094 tomoyo_audit_path_log security/tomoyo/file.c:168 [inline] tomoyo_path_permission security/tomoyo/file.c:587 [inline] tomoyo_path_permission+0x270/0x3a0 security/tomoyo/file.c:573 tomoyo_check_open_permission+0x33e/0x380 security/tomoyo/file.c:777 tomoyo_file_open security/tomoyo/tomoyo.c:320 [inline] tomoyo_file_open+0x9d/0xc0 security/tomoyo/tomoyo.c:315 security_file_open+0x45/0xb0 security/security.c:1648 do_dentry_open+0x575/0x13f0 fs/open.c:869 do_open fs/namei.c:3557 [inline] path_openat+0x1bf6/0x2860 fs/namei.c:3713 do_filp_open+0x1b6/0x400 fs/namei.c:3740 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1459 [inline] free_pcp_prepare+0x65c/0xd90 mm/page_alloc.c:1509 free_unref_page_prepare mm/page_alloc.c:3387 [inline] free_unref_page+0x19/0x4d0 mm/page_alloc.c:3483 kasan_depopulate_vmalloc_pte+0x5c/0x70 mm/kasan/shadow.c:372 apply_to_pte_range mm/memory.c:2640 [inline] apply_to_pmd_range mm/memory.c:2684 [inline] apply_to_pud_range mm/memory.c:2720 [inline] apply_to_p4d_range mm/memory.c:2756 [inline] __apply_to_page_range+0x68c/0x1030 mm/memory.c:2790 kasan_release_vmalloc+0xa7/0xc0 mm/kasan/shadow.c:486 __purge_vmap_area_lazy+0x885/0x1c50 mm/vmalloc.c:1770 _vm_unmap_aliases.part.0+0x420/0x550 mm/vmalloc.c:2173 _vm_unmap_aliases mm/vmalloc.c:2147 [inline] vm_unmap_aliases+0x45/0x50 mm/vmalloc.c:2196 change_page_attr_set_clr+0x241/0x500 arch/x86/mm/pat/set_memory.c:1781 change_page_attr_set arch/x86/mm/pat/set_memory.c:1831 [inline] set_memory_nx+0xb2/0x110 arch/x86/mm/pat/set_memory.c:2024 free_init_pages+0x73/0xc0 arch/x86/mm/init.c:908 kernel_init+0x2e/0x1d0 init/main.c:1528 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Memory state around the buggy address: ffff88807fe97000: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc ffff88807fe97080: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc >ffff88807fe97100: fa fb fb fb fc fc fc fc 00 00 06 fc fc fc fc fc ^ ffff88807fe97180: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc ffff88807fe97200: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc ==================================================================