================================================================== BUG: KASAN: slab-out-of-bounds in memcpy_to_iter lib/iov_iter.c:65 [inline] BUG: KASAN: slab-out-of-bounds in iterate_bvec include/linux/iov_iter.h:122 [inline] BUG: KASAN: slab-out-of-bounds in iterate_and_advance2 include/linux/iov_iter.h:249 [inline] BUG: KASAN: slab-out-of-bounds in iterate_and_advance include/linux/iov_iter.h:271 [inline] BUG: KASAN: slab-out-of-bounds in _copy_to_iter+0x7d4/0x1cf0 lib/iov_iter.c:185 Write of size 2048 at addr ffff888060207800 by task kworker/u8:1/11 CPU: 0 PID: 11 Comm: kworker/u8:1 Not tainted 6.8.0-syzkaller-08951-gfe46a7dd189e #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/29/2024 Workqueue: loop0 loop_rootcg_workfn 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 kasan_check_range+0x282/0x290 mm/kasan/generic.c:189 __asan_memcpy+0x40/0x70 mm/kasan/shadow.c:106 memcpy_to_iter lib/iov_iter.c:65 [inline] iterate_bvec include/linux/iov_iter.h:122 [inline] iterate_and_advance2 include/linux/iov_iter.h:249 [inline] iterate_and_advance include/linux/iov_iter.h:271 [inline] _copy_to_iter+0x7d4/0x1cf0 lib/iov_iter.c:185 copy_page_to_iter+0xb1/0x160 lib/iov_iter.c:362 shmem_file_read_iter+0x4cb/0xa50 mm/shmem.c:2872 do_iter_readv_writev+0x5a6/0x800 vfs_iter_read+0x152/0x420 fs/read_write.c:830 lo_read_simple drivers/block/loop.c:286 [inline] do_req_filebacked drivers/block/loop.c:496 [inline] loop_handle_cmd drivers/block/loop.c:1907 [inline] loop_process_work+0xcfb/0x1e60 drivers/block/loop.c:1942 process_one_work kernel/workqueue.c:3254 [inline] process_scheduled_works+0xa02/0x1770 kernel/workqueue.c:3335 worker_thread+0x86d/0xd70 kernel/workqueue.c:3416 kthread+0x2f2/0x390 kernel/kthread.c:388 ret_from_fork+0x4d/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:243 Allocated by task 5067: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:370 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:387 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slub.c:3966 [inline] __kmalloc+0x233/0x4a0 mm/slub.c:3979 kmalloc include/linux/slab.h:632 [inline] hfsplus_read_wrapper+0x613/0x1340 fs/hfsplus/wrapper.c:182 hfsplus_fill_super+0x38e/0x1ca0 fs/hfsplus/super.c:419 mount_bdev+0x20c/0x2d0 fs/super.c:1658 legacy_get_tree+0xf0/0x190 fs/fs_context.c:662 vfs_get_tree+0x92/0x2a0 fs/super.c:1779 do_new_mount+0x2be/0xb40 fs/namespace.c:3352 do_mount fs/namespace.c:3692 [inline] __do_sys_mount fs/namespace.c:3898 [inline] __se_sys_mount+0x2d9/0x3c0 fs/namespace.c:3875 do_syscall_64+0xfd/0x240 entry_SYSCALL_64_after_hwframe+0x6d/0x75 The buggy address belongs to the object at ffff888060207800 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 0 bytes inside of allocated 512-byte region [ffff888060207800, ffff888060207a00) The buggy address belongs to the physical page: page:ffffea0001808100 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x60204 head:ffffea0001808100 order:2 entire_mapcount:0 nr_pages_mapped:0 pincount:0 ksm flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000840 ffff888014c41c80 ffffea0000bb4000 0000000000000003 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0xd2040(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 4727, tgid 4727 (sh), ts 41876666087, free_ts 38937231432 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x1ea/0x210 mm/page_alloc.c:1533 prep_new_page mm/page_alloc.c:1540 [inline] get_page_from_freelist+0x33ea/0x3580 mm/page_alloc.c:3311 __alloc_pages+0x256/0x680 mm/page_alloc.c:4569 __alloc_pages_node include/linux/gfp.h:238 [inline] alloc_pages_node include/linux/gfp.h:261 [inline] alloc_slab_page+0x5f/0x160 mm/slub.c:2175 allocate_slab mm/slub.c:2338 [inline] new_slab+0x84/0x2f0 mm/slub.c:2391 ___slab_alloc+0xc73/0x1260 mm/slub.c:3525 __slab_alloc mm/slub.c:3610 [inline] __slab_alloc_node mm/slub.c:3663 [inline] slab_alloc_node mm/slub.c:3835 [inline] kmalloc_trace+0x269/0x360 mm/slub.c:3992 kmalloc include/linux/slab.h:628 [inline] kzalloc include/linux/slab.h:749 [inline] tomoyo_find_next_domain+0x11c/0x1cf0 security/tomoyo/domain.c:710 tomoyo_bprm_check_security+0x115/0x180 security/tomoyo/tomoyo.c:102 security_bprm_check+0x67/0x90 security/security.c:1185 search_binary_handler fs/exec.c:1765 [inline] exec_binprm fs/exec.c:1819 [inline] bprm_execve+0xa56/0x1790 fs/exec.c:1871 do_execveat_common+0x553/0x700 fs/exec.c:1978 do_execve fs/exec.c:2052 [inline] __do_sys_execve fs/exec.c:2128 [inline] __se_sys_execve fs/exec.c:2123 [inline] __x64_sys_execve+0x92/0xb0 fs/exec.c:2123 do_syscall_64+0xfd/0x240 entry_SYSCALL_64_after_hwframe+0x6d/0x75 page last free pid 4527 tgid 4527 stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1140 [inline] free_unref_page_prepare+0x968/0xa90 mm/page_alloc.c:2346 free_unref_page+0x37/0x3f0 mm/page_alloc.c:2486 discard_slab mm/slub.c:2437 [inline] __put_partials+0xeb/0x130 mm/slub.c:2906 put_cpu_partial+0x17c/0x250 mm/slub.c:2981 __slab_free+0x2ea/0x3d0 mm/slub.c:4151 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x5e/0xc0 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x14f/0x170 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x23/0x80 mm/kasan/common.c:322 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3798 [inline] slab_alloc_node mm/slub.c:3845 [inline] kmem_cache_alloc+0x174/0x340 mm/slub.c:3852 getname_flags+0xbd/0x4f0 fs/namei.c:139 do_sys_openat2+0xd2/0x1d0 fs/open.c:1400 do_sys_open fs/open.c:1421 [inline] __do_sys_openat fs/open.c:1437 [inline] __se_sys_openat fs/open.c:1432 [inline] __x64_sys_openat+0x247/0x2a0 fs/open.c:1432 do_syscall_64+0xfd/0x240 entry_SYSCALL_64_after_hwframe+0x6d/0x75 Memory state around the buggy address: ffff888060207900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888060207980: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888060207a00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff888060207a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888060207b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================