================================================================== BUG: KASAN: slab-out-of-bounds in _copy_to_iter+0xd18/0x1140 lib/iov_iter.c:527 Write of size 73 at addr ffff88807346da47 by task kworker/0:5/3734 CPU: 0 PID: 3734 Comm: kworker/0:5 Not tainted 6.1.0-rc6-syzkaller #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/0x461 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 6703: 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+0xa3/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_walk+0x1a0/0x540 net/9p/client.c:1152 clone_fid fs/9p/fid.h:21 [inline] v9fs_fid_xattr_set+0xe4/0x2b0 fs/9p/xattr.c:118 v9fs_xattr_set fs/9p/xattr.c:100 [inline] v9fs_xattr_handler_set+0x6f/0x120 fs/9p/xattr.c:159 __vfs_removexattr+0x102/0x170 fs/xattr.c:479 __vfs_removexattr_locked+0x1b0/0x440 fs/xattr.c:514 vfs_removexattr+0xcf/0x260 fs/xattr.c:536 removexattr+0xd0/0x130 fs/xattr.c:878 path_removexattr+0x174/0x1a0 fs/xattr.c:892 __do_sys_lremovexattr fs/xattr.c:912 [inline] __se_sys_lremovexattr fs/xattr.c:909 [inline] __x64_sys_lremovexattr+0x56/0x80 fs/xattr.c:909 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 ffff88807346da40 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 7 bytes inside of 32-byte region [ffff88807346da40, ffff88807346da60) The buggy address belongs to the physical page: page:ffffea0001cd1b40 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88807346dfc1 pfn:0x7346d flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea0000604548 ffffea0001f9e308 ffff888012040100 raw: ffff88807346dfc1 ffff88807346d000 000000010000003f 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 0x242040(__GFP_IO|__GFP_NOWARN|__GFP_COMP|__GFP_THISNODE), pid 3692, tgid 3692 (syz-executor.2), ts 417512213658, free_ts 417398009553 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_node include/linux/gfp.h:223 [inline] kmem_getpages mm/slab.c:1363 [inline] cache_grow_begin+0x75/0x360 mm/slab.c:2570 cache_alloc_refill+0x27f/0x380 mm/slab.c:2943 ____cache_alloc mm/slab.c:3019 [inline] ____cache_alloc mm/slab.c:3002 [inline] __do_cache_alloc mm/slab.c:3202 [inline] slab_alloc_node mm/slab.c:3250 [inline] __kmem_cache_alloc_node+0x44a/0x510 mm/slab.c:3549 __do_kmalloc_node mm/slab_common.c:954 [inline] __kmalloc+0x4a/0xd0 mm/slab_common.c:968 kmalloc include/linux/slab.h:558 [inline] kzalloc include/linux/slab.h:689 [inline] tomoyo_encode2.part.0+0xe9/0x3a0 security/tomoyo/realpath.c:45 tomoyo_encode2 security/tomoyo/realpath.c:31 [inline] tomoyo_encode+0x2c/0x50 security/tomoyo/realpath.c:80 tomoyo_realpath_from_path+0x185/0x600 security/tomoyo/realpath.c:283 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_number_perm+0x209/0x550 security/tomoyo/file.c:723 security_file_ioctl+0x54/0xb0 security/security.c:1554 __do_sys_ioctl fs/ioctl.c:864 [inline] __se_sys_ioctl fs/ioctl.c:856 [inline] __x64_sys_ioctl+0xb7/0x210 fs/ioctl.c:856 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 slab_destroy mm/slab.c:1615 [inline] slabs_destroy+0x85/0xc0 mm/slab.c:1635 cache_flusharray mm/slab.c:3360 [inline] ___cache_free+0x2ac/0x3d0 mm/slab.c:3423 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0x4f/0x1a0 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x184/0x210 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x63/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/slab.c:3257 [inline] kmem_cache_alloc_node+0x28f/0x580 mm/slab.c:3537 __alloc_skb+0x214/0x300 net/core/skbuff.c:497 alloc_skb include/linux/skbuff.h:1267 [inline] alloc_skb_with_frags+0x97/0x6c0 net/core/skbuff.c:6126 sock_alloc_send_pskb+0x7a7/0x930 net/core/sock.c:2719 unix_dgram_sendmsg+0x419/0x1b50 net/unix/af_unix.c:1943 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xd3/0x120 net/socket.c:734 __sys_sendto+0x23a/0x340 net/socket.c:2117 __do_sys_sendto net/socket.c:2129 [inline] __se_sys_sendto net/socket.c:2125 [inline] __x64_sys_sendto+0xe1/0x1b0 net/socket.c:2125 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: ffff88807346d900: 00 00 00 00 fc fc fc fc 00 00 00 00 fc fc fc fc ffff88807346d980: 00 00 00 00 fc fc fc fc 00 00 00 00 fc fc fc fc >ffff88807346da00: fb fb fb fb fc fc fc fc 00 03 fc fc fc fc fc fc ^ ffff88807346da80: 00 00 00 00 fc fc fc fc 00 00 00 00 fc fc fc fc ffff88807346db00: 00 00 00 00 fc fc fc fc 00 fc fc fc fc fc fc fc ==================================================================