loop5: detected capacity change from 0 to 4096 ntfs3: loop5: Mark volume as dirty due to NTFS errors ================================================================== BUG: KASAN: slab-use-after-free in ntfs_write_bh+0x54/0x660 fs/ntfs3/fsntfs.c:1401 Read of size 8 at addr ffff000122c28000 by task syz-executor.5/11921 CPU: 1 PID: 11921 Comm: syz-executor.5 Not tainted 6.6.0-rc3-syzkaller-g2e530aeb342b #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/04/2023 Call trace: dump_backtrace+0x1b8/0x1e4 arch/arm64/kernel/stacktrace.c:233 show_stack+0x2c/0x44 arch/arm64/kernel/stacktrace.c:240 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd0/0x124 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0x174/0x514 mm/kasan/report.c:475 kasan_report+0xd8/0x138 mm/kasan/report.c:588 __asan_report_load8_noabort+0x20/0x2c mm/kasan/report_generic.c:381 ntfs_write_bh+0x54/0x660 fs/ntfs3/fsntfs.c:1401 mi_write+0x9c/0x1cc fs/ntfs3/record.c:346 ni_write_inode+0xb30/0xd88 fs/ntfs3/frecord.c:3360 ntfs3_write_inode+0x70/0x98 fs/ntfs3/inode.c:1026 write_inode fs/fs-writeback.c:1456 [inline] __writeback_single_inode+0x5a8/0x146c fs/fs-writeback.c:1668 writeback_single_inode+0x1c0/0x64c fs/fs-writeback.c:1724 sync_inode_metadata+0xd4/0x144 fs/fs-writeback.c:2786 ntfs_set_state+0x458/0x608 fs/ntfs3/fsntfs.c:995 ntfs_iget5+0x718/0x2b1c fs/ntfs3/inode.c:539 ntfs_fill_super+0x2360/0x3ed4 fs/ntfs3/super.c:1213 get_tree_bdev+0x33c/0x4a8 fs/super.c:1577 ntfs_fs_get_tree+0x28/0x38 fs/ntfs3/super.c:1637 vfs_get_tree+0x90/0x288 fs/super.c:1750 do_new_mount+0x25c/0x8c8 fs/namespace.c:3335 path_mount+0x590/0xe04 fs/namespace.c:3662 do_mount fs/namespace.c:3675 [inline] __do_sys_mount fs/namespace.c:3884 [inline] __se_sys_mount fs/namespace.c:3861 [inline] __arm64_sys_mount+0x45c/0x594 fs/namespace.c:3861 __invoke_syscall arch/arm64/kernel/syscall.c:37 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155 el0_svc+0x58/0x16c arch/arm64/kernel/entry-common.c:678 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:595 Allocated by task 5628: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4c/0x7c mm/kasan/common.c:52 kasan_save_alloc_info+0x24/0x30 mm/kasan/generic.c:511 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0xac/0xc4 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:198 [inline] __do_kmalloc_node mm/slab_common.c:1023 [inline] __kmalloc+0xcc/0x1b8 mm/slab_common.c:1036 kmalloc include/linux/slab.h:603 [inline] tomoyo_realpath_from_path+0xc8/0x4cc security/tomoyo/realpath.c:251 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x218/0x588 security/tomoyo/file.c:822 tomoyo_inode_getattr+0x28/0x38 security/tomoyo/tomoyo.c:122 security_inode_getattr+0xd8/0x124 security/security.c:2153 vfs_getattr fs/stat.c:169 [inline] vfs_statx+0x184/0x420 fs/stat.c:244 vfs_fstatat+0x118/0x25c fs/stat.c:295 __do_sys_newfstatat fs/stat.c:459 [inline] __se_sys_newfstatat fs/stat.c:453 [inline] __arm64_sys_newfstatat+0x104/0x184 fs/stat.c:453 __invoke_syscall arch/arm64/kernel/syscall.c:37 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155 el0_svc+0x58/0x16c arch/arm64/kernel/entry-common.c:678 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:595 Freed by task 5628: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4c/0x7c mm/kasan/common.c:52 kasan_save_free_info+0x38/0x5c mm/kasan/generic.c:522 ____kasan_slab_free+0x144/0x1c0 mm/kasan/common.c:236 __kasan_slab_free+0x18/0x28 mm/kasan/common.c:244 kasan_slab_free include/linux/kasan.h:164 [inline] slab_free_hook mm/slub.c:1800 [inline] slab_free_freelist_hook mm/slub.c:1826 [inline] slab_free mm/slub.c:3809 [inline] __kmem_cache_free+0x2ac/0x480 mm/slub.c:3822 kfree+0xb8/0x19c mm/slab_common.c:1072 tomoyo_realpath_from_path+0x484/0x4cc security/tomoyo/realpath.c:286 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x218/0x588 security/tomoyo/file.c:822 tomoyo_inode_getattr+0x28/0x38 security/tomoyo/tomoyo.c:122 security_inode_getattr+0xd8/0x124 security/security.c:2153 vfs_getattr fs/stat.c:169 [inline] vfs_statx+0x184/0x420 fs/stat.c:244 vfs_fstatat+0x118/0x25c fs/stat.c:295 __do_sys_newfstatat fs/stat.c:459 [inline] __se_sys_newfstatat fs/stat.c:453 [inline] __arm64_sys_newfstatat+0x104/0x184 fs/stat.c:453 __invoke_syscall arch/arm64/kernel/syscall.c:37 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155 el0_svc+0x58/0x16c arch/arm64/kernel/entry-common.c:678 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:595 The buggy address belongs to the object at ffff000122c28000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 0 bytes inside of freed 4096-byte region [ffff000122c28000, ffff000122c29000) The buggy address belongs to the physical page: page:0000000084c8262f refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x162c28 head:0000000084c8262f order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x5ffc00000000840(slab|head|node=0|zone=2|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 05ffc00000000840 ffff0000c0002140 dead000000000100 dead000000000122 raw: 0000000000000000 0000000000040004 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff000122c27f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff000122c27f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff000122c28000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff000122c28080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff000122c28100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ntfs3: loop5: Failed to load $LogFile (-22).