================================================================== BUG: KASAN: slab-out-of-bounds in _copy_to_iter+0xd18/0x1140 lib/iov_iter.c:527 Write of size 4043 at addr ffff8880221c40e2 by task kworker/1:3/2961 CPU: 1 PID: 2961 Comm: kworker/1:3 Not tainted 6.1.0-rc5-syzkaller-00307-gfe24a97cf254 #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+0xd1/0x138 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+0xbf/0x1f0 mm/kasan/report.c:495 check_region_inline mm/kasan/generic.c:183 [inline] kasan_check_range+0x141/0x190 mm/kasan/generic.c:189 memcpy+0x3d/0x60 mm/kasan/shadow.c:66 _copy_to_iter+0xd18/0x1140 lib/iov_iter.c:527 copy_page_to_iter+0xe0/0xa20 lib/iov_iter.c:725 pipe_read+0x50e/0x1110 fs/pipe.c:307 __kernel_read+0x2ca/0x7c0 fs/read_write.c:428 kernel_read+0xc3/0x1c0 fs/read_write.c:446 p9_fd_read net/9p/trans_fd.c:266 [inline] p9_read_work+0x2b0/0x1040 net/9p/trans_fd.c:301 process_one_work+0x9bf/0x1710 kernel/workqueue.c:2289 worker_thread+0x669/0x1090 kernel/workqueue.c:2436 kthread+0x2e8/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Allocated by task 3635: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:371 [inline] ____kasan_kmalloc mm/kasan/common.c:330 [inline] __kasan_kmalloc+0xa5/0xb0 mm/kasan/common.c:380 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slab_common.c:955 [inline] __kmalloc+0x5a/0xd0 mm/slab_common.c:968 kmalloc include/linux/slab.h:558 [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_version net/9p/client.c:910 [inline] p9_client_create+0xaf0/0x1070 net/9p/client.c:1015 v9fs_session_init+0x1e6/0x18b0 fs/9p/v9fs.c:408 v9fs_mount+0xbe/0xca0 fs/9p/vfs_super.c:126 legacy_get_tree+0x109/0x220 fs/fs_context.c:610 vfs_get_tree+0x8d/0x2f0 fs/super.c:1531 do_new_mount fs/namespace.c:3040 [inline] path_mount+0x132a/0x1e20 fs/namespace.c:3370 do_mount fs/namespace.c:3383 [inline] __do_sys_mount fs/namespace.c:3591 [inline] __se_sys_mount fs/namespace.c:3568 [inline] __x64_sys_mount+0x283/0x300 fs/namespace.c:3568 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 The buggy address belongs to the object at ffff8880221c4000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 226 bytes inside of 4096-byte region [ffff8880221c4000, ffff8880221c5000) The buggy address belongs to the physical page: page:ffffea0000887000 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x221c0 head:ffffea0000887000 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 0000000000000000 dead000000000122 ffff888012042140 raw: 0000000000000000 0000000000040004 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd2040(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 3635, tgid 3633 (syz-executor212), ts 54068261588, free_ts 54063359485 prep_new_page mm/page_alloc.c:2539 [inline] get_page_from_freelist+0x10b5/0x2d50 mm/page_alloc.c:4288 __alloc_pages+0x1cb/0x5b0 mm/page_alloc.c:5555 alloc_pages+0x1aa/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+0x199/0x3e0 mm/slub.c:3437 __do_kmalloc_node mm/slab_common.c:954 [inline] __kmalloc+0x4a/0xd0 mm/slab_common.c:968 kmalloc include/linux/slab.h:558 [inline] tomoyo_realpath_from_path+0xc3/0x600 security/tomoyo/realpath.c:251 tomoyo_mount_acl+0x14e/0x840 security/tomoyo/mount.c:105 tomoyo_mount_permission+0x155/0x3f0 security/tomoyo/mount.c:237 security_sb_mount+0x6a/0xc0 security/security.c:979 path_mount+0x133/0x1e20 fs/namespace.c:3312 do_mount fs/namespace.c:3383 [inline] __do_sys_mount fs/namespace.c:3591 [inline] __se_sys_mount fs/namespace.c:3568 [inline] __x64_sys_mount+0x283/0x300 fs/namespace.c:3568 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 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+0x1d/0x4d0 mm/page_alloc.c:3483 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x184/0x210 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x66/0x90 mm/kasan/common.c:302 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slab.h:737 [inline] slab_alloc_node mm/slub.c:3398 [inline] __kmem_cache_alloc_node+0x2e2/0x3e0 mm/slub.c:3437 __do_kmalloc_node mm/slab_common.c:954 [inline] __kmalloc_node_track_caller+0x4b/0xc0 mm/slab_common.c:975 kmemdup_nul+0x36/0xb0 mm/util.c:152 parse_opts net/9p/client.c:174 [inline] p9_client_create+0x596/0x1070 net/9p/client.c:979 v9fs_session_init+0x1e6/0x18b0 fs/9p/v9fs.c:408 v9fs_mount+0xbe/0xca0 fs/9p/vfs_super.c:126 legacy_get_tree+0x109/0x220 fs/fs_context.c:610 vfs_get_tree+0x8d/0x2f0 fs/super.c:1531 do_new_mount fs/namespace.c:3040 [inline] path_mount+0x132a/0x1e20 fs/namespace.c:3370 do_mount fs/namespace.c:3383 [inline] __do_sys_mount fs/namespace.c:3591 [inline] __se_sys_mount fs/namespace.c:3568 [inline] __x64_sys_mount+0x283/0x300 fs/namespace.c:3568 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 Memory state around the buggy address: ffff8880221c4f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880221c4f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8880221c5000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff8880221c5080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880221c5100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================