ntfs: volume version 3.1. ntfs: (device loop0): ntfs_lookup_inode_by_name(): Corrupt directory. Aborting lookup. ================================================================== BUG: KASAN: slab-out-of-bounds in ntfs_filldir fs/ntfs/dir.c:1021 [inline] BUG: KASAN: slab-out-of-bounds in ntfs_readdir+0x15a0/0x2e40 fs/ntfs/dir.c:1200 Read of size 1 at addr ffff88801c2b2bf1 by task syz-executor323/5064 CPU: 0 PID: 5064 Comm: syz-executor323 Not tainted 6.7.0-rc8-syzkaller-00174-g95c8a35f1c01 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0xc4/0x620 mm/kasan/report.c:475 kasan_report+0xda/0x110 mm/kasan/report.c:588 ntfs_filldir fs/ntfs/dir.c:1021 [inline] ntfs_readdir+0x15a0/0x2e40 fs/ntfs/dir.c:1200 wrap_directory_iterator+0xa5/0xe0 fs/readdir.c:67 iterate_dir+0x1e5/0x5b0 fs/readdir.c:106 __do_sys_getdents64 fs/readdir.c:405 [inline] __se_sys_getdents64 fs/readdir.c:390 [inline] __x64_sys_getdents64+0x14f/0x2e0 fs/readdir.c:390 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x40/0x110 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x63/0x6b RIP: 0033:0x7fb1d77a1a59 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 17 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffd20c87708 EFLAGS: 00000246 ORIG_RAX: 00000000000000d9 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fb1d77a1a59 RDX: 00000000000000ab RSI: 0000000020000080 RDI: 0000000000000004 RBP: 00007fb1d78335f0 R08: 00005555574b24c0 R09: 00005555574b24c0 R10: 000000000001f1b8 R11: 0000000000000246 R12: 00007ffd20c87730 R13: 00007ffd20c87958 R14: 431bde82d7b634db R15: 00007fb1d77ea03b Allocated by task 5064: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0xa3/0xb0 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:198 [inline] __do_kmalloc_node mm/slab_common.c:1007 [inline] __kmalloc+0x59/0x90 mm/slab_common.c:1020 kmalloc include/linux/slab.h:604 [inline] ntfs_readdir+0x12ef/0x2e40 fs/ntfs/dir.c:1162 wrap_directory_iterator+0xa5/0xe0 fs/readdir.c:67 iterate_dir+0x1e5/0x5b0 fs/readdir.c:106 __do_sys_getdents64 fs/readdir.c:405 [inline] __se_sys_getdents64 fs/readdir.c:390 [inline] __x64_sys_getdents64+0x14f/0x2e0 fs/readdir.c:390 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x40/0x110 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x63/0x6b The buggy address belongs to the object at ffff88801c2b2b80 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 57 bytes to the right of allocated 56-byte region [ffff88801c2b2b80, ffff88801c2b2bb8) The buggy address belongs to the physical page: page:ffffea000070ac80 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1c2b2 flags: 0xfff00000000800(slab|node=0|zone=1|lastcpupid=0x7ff) page_type: 0x20() raw: 00fff00000000800 ffff888013040200 ffffea00007b68d0 ffffea000080a510 raw: 0000000000000000 ffff88801c2b2000 0000000100000020 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 4513, tgid 4513 (udevadm), ts 27200744791, free_ts 27200621730 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2d0/0x350 mm/page_alloc.c:1537 prep_new_page mm/page_alloc.c:1544 [inline] get_page_from_freelist+0xa25/0x36d0 mm/page_alloc.c:3312 __alloc_pages+0x22e/0x2420 mm/page_alloc.c:4568 __alloc_pages_node include/linux/gfp.h:238 [inline] kmem_getpages mm/slab.c:1356 [inline] cache_grow_begin+0x99/0x3a0 mm/slab.c:2550 cache_alloc_refill+0x295/0x3b0 mm/slab.c:2923 ____cache_alloc mm/slab.c:2999 [inline] ____cache_alloc mm/slab.c:2982 [inline] __do_cache_alloc mm/slab.c:3182 [inline] slab_alloc_node mm/slab.c:3230 [inline] __kmem_cache_alloc_node+0x3ba/0x460 mm/slab.c:3521 __do_kmalloc_node mm/slab_common.c:1006 [inline] __kmalloc+0x49/0x90 mm/slab_common.c:1020 kmalloc include/linux/slab.h:604 [inline] kzalloc include/linux/slab.h:721 [inline] tomoyo_encode2+0x100/0x3d0 security/tomoyo/realpath.c:45 tomoyo_encode+0x29/0x50 security/tomoyo/realpath.c:80 tomoyo_realpath_from_path+0x196/0x710 security/tomoyo/realpath.c:283 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_check_open_permission+0x2a3/0x3b0 security/tomoyo/file.c:771 tomoyo_file_open security/tomoyo/tomoyo.c:332 [inline] tomoyo_file_open+0xa8/0xd0 security/tomoyo/tomoyo.c:327 security_file_open+0x6a/0xe0 security/security.c:2836 do_dentry_open+0x583/0x18c0 fs/open.c:935 do_open fs/namei.c:3622 [inline] path_openat+0x1e5a/0x2c50 fs/namei.c:3779 do_filp_open+0x1de/0x430 fs/namei.c:3809 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1137 [inline] free_unref_page_prepare+0x4fa/0xaa0 mm/page_alloc.c:2347 free_unref_page+0x33/0x3b0 mm/page_alloc.c:2487 selinux_genfs_get_sid security/selinux/hooks.c:1341 [inline] inode_doinit_with_dentry+0xac0/0x12c0 security/selinux/hooks.c:1539 selinux_d_instantiate+0x26/0x30 security/selinux/hooks.c:6278 security_d_instantiate+0x54/0xe0 security/security.c:3799 d_splice_alias+0x94/0xdf0 fs/dcache.c:3145 kernfs_iop_lookup+0x283/0x330 fs/kernfs/dir.c:1208 lookup_open.isra.0+0x926/0x13b0 fs/namei.c:3455 open_last_lookups fs/namei.c:3546 [inline] path_openat+0x922/0x2c50 fs/namei.c:3776 do_filp_open+0x1de/0x430 fs/namei.c:3809 do_sys_openat2+0x176/0x1e0 fs/open.c:1437 do_sys_open fs/open.c:1452 [inline] __do_sys_openat fs/open.c:1468 [inline] __se_sys_openat fs/open.c:1463 [inline] __x64_sys_openat+0x175/0x210 fs/open.c:1463 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x40/0x110 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x63/0x6b Memory state around the buggy address: ffff88801c2b2a80: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc ffff88801c2b2b00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff88801c2b2b80: 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc ^ ffff88801c2b2c00: 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc ffff88801c2b2c80: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc ==================================================================