loop3: detected capacity change from 0 to 4096 ================================================================== BUG: KASAN: slab-use-after-free in ntfs_iget5+0x3233/0x3960 fs/ntfs3/inode.c:533 Read of size 8 at addr ffff888086d04840 by task syz-executor.3/27544 CPU: 1 PID: 27544 Comm: syz-executor.3 Not tainted 6.6.0-rc1-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/04/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_iget5+0x3233/0x3960 fs/ntfs3/inode.c:533 ntfs_fill_super+0x261d/0x4330 fs/ntfs3/super.c:1213 get_tree_bdev+0x3b5/0x650 fs/super.c:1577 vfs_get_tree+0x8c/0x370 fs/super.c:1750 do_new_mount fs/namespace.c:3335 [inline] path_mount+0x1492/0x1ed0 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] __x64_sys_mount+0x293/0x310 fs/namespace.c:3861 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f812ae7e1ea Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 de 09 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f812baefee8 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f812baeff80 RCX: 00007f812ae7e1ea RDX: 0000000020000040 RSI: 0000000020000200 RDI: 00007f812baeff40 RBP: 0000000020000040 R08: 00007f812baeff80 R09: 000000000000c040 R10: 000000000000c040 R11: 0000000000000202 R12: 0000000020000200 R13: 00007f812baeff40 R14: 000000000001f75c R15: 0000000020000080 Allocated by task 27377: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 __kasan_slab_alloc+0x81/0x90 mm/kasan/common.c:328 kasan_slab_alloc include/linux/kasan.h:188 [inline] slab_post_alloc_hook mm/slab.h:762 [inline] slab_alloc_node mm/slub.c:3478 [inline] slab_alloc mm/slub.c:3486 [inline] __kmem_cache_alloc_lru mm/slub.c:3493 [inline] kmem_cache_alloc_lru+0x21a/0x630 mm/slub.c:3509 alloc_inode_sb include/linux/fs.h:2909 [inline] reiserfs_alloc_inode+0x26/0xb0 fs/reiserfs/super.c:642 alloc_inode+0x5d/0x220 fs/inode.c:259 iget5_locked fs/inode.c:1269 [inline] iget5_locked+0x63/0xe0 fs/inode.c:1262 reiserfs_fill_super+0x10e7/0x3150 fs/reiserfs/super.c:2053 mount_bdev+0x1f3/0x2e0 fs/super.c:1629 legacy_get_tree+0x109/0x220 fs/fs_context.c:638 vfs_get_tree+0x8c/0x370 fs/super.c:1750 do_new_mount fs/namespace.c:3335 [inline] path_mount+0x1492/0x1ed0 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] __x64_sys_mount+0x293/0x310 fs/namespace.c:3861 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 27506: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:522 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x15b/0x1b0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:164 [inline] slab_free_hook mm/slub.c:1800 [inline] slab_free_freelist_hook+0x114/0x1e0 mm/slub.c:1826 slab_free mm/slub.c:3809 [inline] kmem_cache_free+0xf0/0x480 mm/slub.c:3831 i_callback+0x43/0x70 fs/inode.c:248 rcu_do_batch kernel/rcu/tree.c:2139 [inline] rcu_core+0x7fb/0x1bb0 kernel/rcu/tree.c:2403 __do_softirq+0x218/0x965 kernel/softirq.c:553 Last potentially related work creation: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:492 __call_rcu_common.constprop.0+0x9a/0x790 kernel/rcu/tree.c:2653 destroy_inode+0x129/0x1b0 fs/inode.c:314 dispose_list+0x117/0x1e0 fs/inode.c:697 evict_inodes+0x34f/0x450 fs/inode.c:747 generic_shutdown_super+0xb5/0x3c0 fs/super.c:672 kill_block_super+0x3b/0x70 fs/super.c:1646 deactivate_locked_super+0x9a/0x170 fs/super.c:481 deactivate_super+0xde/0x100 fs/super.c:514 cleanup_mnt+0x222/0x3d0 fs/namespace.c:1254 task_work_run+0x14d/0x240 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:171 [inline] exit_to_user_mode_prepare+0x210/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x1d/0x60 kernel/entry/common.c:296 do_syscall_64+0x44/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd Second to last potentially related work creation: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:492 __call_rcu_common.constprop.0+0x9a/0x790 kernel/rcu/tree.c:2653 destroy_inode+0x129/0x1b0 fs/inode.c:314 dispose_list+0x117/0x1e0 fs/inode.c:697 evict_inodes+0x34f/0x450 fs/inode.c:747 generic_shutdown_super+0xb5/0x3c0 fs/super.c:672 kill_block_super+0x3b/0x70 fs/super.c:1646 deactivate_locked_super+0x9a/0x170 fs/super.c:481 deactivate_super+0xde/0x100 fs/super.c:514 cleanup_mnt+0x222/0x3d0 fs/namespace.c:1254 task_work_run+0x14d/0x240 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:171 [inline] exit_to_user_mode_prepare+0x210/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x1d/0x60 kernel/entry/common.c:296 do_syscall_64+0x44/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff888086d04240 which belongs to the cache reiser_inode_cache of size 1568 The buggy address is located 1536 bytes inside of freed 1568-byte region [ffff888086d04240, ffff888086d04860) The buggy address belongs to the physical page: page:ffffea00021b4000 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888086d05cc0 pfn:0x86d00 head:ffffea00021b4000 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff88801da87701 flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000840 ffff888142ea53c0 ffffea000229fc00 0000000000000002 raw: ffff888086d05cc0 000000008013000b 00000001ffffffff ffff88801da87701 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Reclaimable, gfp_mask 0x1d20d0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL|__GFP_RECLAIMABLE), pid 9223, tgid 9218 (syz-executor.0), ts 367541575165, free_ts 365666888303 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2cf/0x340 mm/page_alloc.c:1536 prep_new_page mm/page_alloc.c:1543 [inline] get_page_from_freelist+0xee0/0x2f20 mm/page_alloc.c:3170 __alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4426 alloc_pages+0x1a9/0x270 mm/mempolicy.c:2298 alloc_slab_page mm/slub.c:1870 [inline] allocate_slab+0x251/0x380 mm/slub.c:2017 new_slab mm/slub.c:2070 [inline] ___slab_alloc+0x8be/0x1570 mm/slub.c:3223 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3322 __slab_alloc_node mm/slub.c:3375 [inline] slab_alloc_node mm/slub.c:3468 [inline] slab_alloc mm/slub.c:3486 [inline] __kmem_cache_alloc_lru mm/slub.c:3493 [inline] kmem_cache_alloc_lru+0x4e4/0x630 mm/slub.c:3509 alloc_inode_sb include/linux/fs.h:2909 [inline] reiserfs_alloc_inode+0x26/0xb0 fs/reiserfs/super.c:642 alloc_inode+0x5d/0x220 fs/inode.c:259 new_inode_pseudo fs/inode.c:1004 [inline] new_inode+0x22/0x260 fs/inode.c:1030 reiserfs_mkdir+0x214/0x9a0 fs/reiserfs/namei.c:813 xattr_mkdir fs/reiserfs/xattr.c:77 [inline] create_privroot fs/reiserfs/xattr.c:891 [inline] reiserfs_xattr_init+0x57f/0xbb0 fs/reiserfs/xattr.c:1007 reiserfs_remount+0xb6e/0x1640 fs/reiserfs/super.c:1586 legacy_reconfigure+0x119/0x180 fs/fs_context.c:661 reconfigure_super+0x44f/0xb10 fs/super.c:1140 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1136 [inline] free_unref_page_prepare+0x476/0xa40 mm/page_alloc.c:2312 free_unref_page+0x33/0x3b0 mm/page_alloc.c:2405 qlink_free mm/kasan/quarantine.c:166 [inline] qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:185 kasan_quarantine_reduce+0x18b/0x1d0 mm/kasan/quarantine.c:292 __kasan_slab_alloc+0x65/0x90 mm/kasan/common.c:305 kasan_slab_alloc include/linux/kasan.h:188 [inline] slab_post_alloc_hook mm/slab.h:762 [inline] slab_alloc_node mm/slub.c:3478 [inline] __kmem_cache_alloc_node+0x19b/0x350 mm/slub.c:3517 __do_kmalloc_node mm/slab_common.c:1022 [inline] __kmalloc+0x4f/0x100 mm/slab_common.c:1036 kmalloc include/linux/slab.h:603 [inline] tomoyo_realpath_from_path+0xb9/0x710 security/tomoyo/realpath.c:251 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_number_perm+0x243/0x590 security/tomoyo/file.c:723 security_file_ioctl+0x72/0xb0 security/security.c:2647 __do_sys_ioctl fs/ioctl.c:865 [inline] __se_sys_ioctl fs/ioctl.c:857 [inline] __x64_sys_ioctl+0xbb/0x210 fs/ioctl.c:857 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff888086d04700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888086d04780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888086d04800: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ^ ffff888086d04880: fc fc fc fc fc fc fc fc fc fc fc fc 00 00 00 00 ffff888086d04900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== general protection fault, probably for non-canonical address 0xdffffc0000000002: 0000 [#1] PREEMPT SMP KASAN KASAN: null-ptr-deref in range [0x0000000000000010-0x0000000000000017] CPU: 0 PID: 27544 Comm: syz-executor.3 Tainted: G B 6.6.0-rc1-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/04/2023 RIP: 0010:ntfs_iget5+0x19d/0x3960 fs/ntfs3/inode.c:533 Code: 48 c1 ea 03 80 3c 02 00 0f 85 ad 30 00 00 49 8b 9f d0 fd ff ff 48 b8 00 00 00 00 00 fc ff df 48 8d 7b 10 48 89 fa 48 c1 ea 03 <0f> b6 04 02 84 c0 74 08 3c 01 0f 8e ff 07 00 00 0f b7 5b 10 44 89 RSP: 0018:ffffc9000ac3f930 EFLAGS: 00010212 RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffffc9000a891000 RDX: 0000000000000002 RSI: ffffffff81dd7197 RDI: 0000000000000010 RBP: ffffc9000ac3fac0 R08: 0000000000000007 R09: 0000000000000000 R10: 0000000000000000 R11: 000000000019ca60 R12: 1ffff92001587f3e R13: 0000000000000002 R14: ffff8880835a8039 R15: ffff888086d04a70 FS: 00007f812baf06c0(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000020002380 CR3: 000000007d556000 CR4: 0000000000350ef0 Call Trace: ntfs_fill_super+0x261d/0x4330 fs/ntfs3/super.c:1213 get_tree_bdev+0x3b5/0x650 fs/super.c:1577 vfs_get_tree+0x8c/0x370 fs/super.c:1750 do_new_mount fs/namespace.c:3335 [inline] path_mount+0x1492/0x1ed0 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] __x64_sys_mount+0x293/0x310 fs/namespace.c:3861 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f812ae7e1ea Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 de 09 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f812baefee8 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f812baeff80 RCX: 00007f812ae7e1ea RDX: 0000000020000040 RSI: 0000000020000200 RDI: 00007f812baeff40 RBP: 0000000020000040 R08: 00007f812baeff80 R09: 000000000000c040 R10: 000000000000c040 R11: 0000000000000202 R12: 0000000020000200 R13: 00007f812baeff40 R14: 000000000001f75c R15: 0000000020000080 Modules linked in: ---[ end trace 0000000000000000 ]--- RIP: 0010:ntfs_iget5+0x19d/0x3960 fs/ntfs3/inode.c:533 Code: 48 c1 ea 03 80 3c 02 00 0f 85 ad 30 00 00 49 8b 9f d0 fd ff ff 48 b8 00 00 00 00 00 fc ff df 48 8d 7b 10 48 89 fa 48 c1 ea 03 <0f> b6 04 02 84 c0 74 08 3c 01 0f 8e ff 07 00 00 0f b7 5b 10 44 89 RSP: 0018:ffffc9000ac3f930 EFLAGS: 00010212 RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffffc9000a891000 RDX: 0000000000000002 RSI: ffffffff81dd7197 RDI: 0000000000000010 RBP: ffffc9000ac3fac0 R08: 0000000000000007 R09: 0000000000000000 R10: 0000000000000000 R11: 000000000019ca60 R12: 1ffff92001587f3e R13: 0000000000000002 R14: ffff8880835a8039 R15: ffff888086d04a70 FS: 00007f812baf06c0(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007eff81604000 CR3: 000000007d556000 CR4: 0000000000350ef0 ---------------- Code disassembly (best guess): 0: 48 c1 ea 03 shr $0x3,%rdx 4: 80 3c 02 00 cmpb $0x0,(%rdx,%rax,1) 8: 0f 85 ad 30 00 00 jne 0x30bb e: 49 8b 9f d0 fd ff ff mov -0x230(%r15),%rbx 15: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax 1c: fc ff df 1f: 48 8d 7b 10 lea 0x10(%rbx),%rdi 23: 48 89 fa mov %rdi,%rdx 26: 48 c1 ea 03 shr $0x3,%rdx * 2a: 0f b6 04 02 movzbl (%rdx,%rax,1),%eax <-- trapping instruction 2e: 84 c0 test %al,%al 30: 74 08 je 0x3a 32: 3c 01 cmp $0x1,%al 34: 0f 8e ff 07 00 00 jle 0x839 3a: 0f b7 5b 10 movzwl 0x10(%rbx),%ebx 3e: 44 rex.R 3f: 89 .byte 0x89