================================================================== BUG: KASAN: slab-out-of-bounds in memcpy_from_iter lib/iov_iter.c:380 [inline] BUG: KASAN: slab-out-of-bounds in copy_page_from_iter_atomic+0x908/0x12f0 lib/iov_iter.c:590 Read of size 2048 at addr ffff888146610400 by task kworker/u4:9/2465 CPU: 1 PID: 2465 Comm: kworker/u4:9 Not tainted 6.6.0-rc5-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/06/2023 Workqueue: loop0 loop_workfn Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0x163/0x540 mm/kasan/report.c:475 kasan_report+0x175/0x1b0 mm/kasan/report.c:588 kasan_check_range+0x27e/0x290 mm/kasan/generic.c:187 __asan_memcpy+0x29/0x70 mm/kasan/shadow.c:105 memcpy_from_iter lib/iov_iter.c:380 [inline] copy_page_from_iter_atomic+0x908/0x12f0 lib/iov_iter.c:590 generic_perform_write+0x392/0x630 mm/filemap.c:3977 shmem_file_write_iter+0xfc/0x120 mm/shmem.c:2865 do_iter_write+0x84f/0xde0 fs/read_write.c:860 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:1915 [inline] loop_process_work+0x14c3/0x22a0 drivers/block/loop.c:1950 process_one_work kernel/workqueue.c:2630 [inline] process_scheduled_works+0x90f/0x1400 kernel/workqueue.c:2703 worker_thread+0xa5f/0xff0 kernel/workqueue.c:2784 kthread+0x2d3/0x370 kernel/kthread.c:388 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 Allocated by task 5431: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4f/0x70 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0x7d/0x90 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:198 [inline] __do_kmalloc_node mm/slab_common.c:1023 [inline] __kmalloc+0xb9/0x230 mm/slab_common.c:1036 kmalloc include/linux/slab.h:603 [inline] hfsplus_read_wrapper+0x545/0x1330 fs/hfsplus/wrapper.c:178 hfsplus_fill_super+0x38e/0x1c90 fs/hfsplus/super.c:413 mount_bdev+0x237/0x300 fs/super.c:1629 legacy_get_tree+0xef/0x190 fs/fs_context.c:638 vfs_get_tree+0x8c/0x280 fs/super.c:1750 do_new_mount+0x28f/0xae0 fs/namespace.c:3335 do_mount fs/namespace.c:3675 [inline] __do_sys_mount fs/namespace.c:3884 [inline] __se_sys_mount+0x2d9/0x3c0 fs/namespace.c:3861 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0x90 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff888146610400 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 0 bytes inside of allocated 512-byte region [ffff888146610400, ffff888146610600) The buggy address belongs to the physical page: page:ffffea0005198400 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888146610800 pfn:0x146610 head:ffffea0005198400 order:2 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x57ff00000000840(slab|head|node=1|zone=2|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 057ff00000000840 ffff888012841c80 ffffea00051d1910 ffffea00051c8410 raw: ffff888146610800 000000000010000f 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 1, tgid 1 (swapper/0), ts 6347801240, free_ts 0 prep_new_page mm/page_alloc.c:1543 [inline] get_page_from_freelist+0x31db/0x3360 mm/page_alloc.c:3170 __alloc_pages+0x255/0x670 mm/page_alloc.c:4426 alloc_page_interleave+0x22/0x1d0 mm/mempolicy.c:2130 alloc_slab_page+0x6a/0x160 mm/slub.c:1870 allocate_slab mm/slub.c:2017 [inline] new_slab+0x84/0x2f0 mm/slub.c:2070 ___slab_alloc+0xc85/0x1310 mm/slub.c:3223 __slab_alloc mm/slub.c:3322 [inline] __slab_alloc_node mm/slub.c:3375 [inline] slab_alloc_node mm/slub.c:3468 [inline] __kmem_cache_alloc_node+0x1aa/0x230 mm/slub.c:3517 kmalloc_trace+0x2a/0xe0 mm/slab_common.c:1114 kmalloc include/linux/slab.h:599 [inline] kzalloc include/linux/slab.h:720 [inline] device_private_init drivers/base/core.c:3469 [inline] device_add+0xc4/0xd30 drivers/base/core.c:3520 tty_register_device_attr+0x437/0x960 drivers/tty/tty_io.c:3248 tty_register_device drivers/tty/tty_io.c:3183 [inline] tty_register_driver+0x5f6/0xc30 drivers/tty/tty_io.c:3446 legacy_pty_init+0x3ac/0x610 drivers/tty/pty.c:579 pty_init+0xe/0x20 drivers/tty/pty.c:943 do_one_initcall+0x23d/0x7d0 init/main.c:1232 do_initcall_level+0x157/0x210 init/main.c:1294 do_initcalls+0x3f/0x80 init/main.c:1310 page_owner free stack trace missing Memory state around the buggy address: ffff888146610500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888146610580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888146610600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff888146610680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888146610700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================