syzbot


KASAN: use-after-free Read in ntfs_test_inode (2)

Status: upstream: reported on 2024/08/26 01:18
Reported-by: syzbot+fe74496e1de37a06ad70@syzkaller.appspotmail.com
First crash: 371d, last: 2d19h
Similar bugs (7)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.1 KASAN: use-after-free Read in ntfs_test_inode (2) 19 7 2d06h 234d 0/3 upstream: reported on 2025/01/09 09:49
linux-4.19 KASAN: use-after-free Read in ntfs_test_inode 19 1 1007d 1007d 0/1 auto-obsoleted due to no activity on 2023/03/28 18:25
upstream KASAN: use-after-free Read in ntfs_test_inode ntfs3 19 C done 402 633d 1567d 25/29 fixed on 2023/12/21 01:43
linux-6.1 KASAN: use-after-free Read in ntfs_test_inode 19 2 524d 526d 0/3 auto-obsoleted due to no activity on 2024/07/03 10:22
linux-5.15 KASAN: use-after-free Read in ntfs_test_inode 19 6 690d 890d 0/3 auto-obsoleted due to no activity on 2024/01/19 06:00
upstream KASAN: slab-use-after-free Read in ntfs_test_inode fs 19 5 600d 600d 0/29 auto-obsoleted due to no activity on 2024/04/18 20:01
linux-4.14 KASAN: slab-out-of-bounds Read in ntfs_test_inode 17 1 1292d 1292d 0/1 auto-closed as invalid on 2022/06/16 22:11

Sample crash report:
ntfs: volume version 3.1.
==================================================================
BUG: KASAN: use-after-free in instrument_atomic_read include/linux/instrumented.h:71 [inline]
BUG: KASAN: use-after-free in test_bit include/asm-generic/bitops/instrumented-non-atomic.h:134 [inline]
BUG: KASAN: use-after-free in NInoAttr fs/ntfs/inode.h:200 [inline]
BUG: KASAN: use-after-free in ntfs_test_inode+0x79/0x2d0 fs/ntfs/inode.c:55
Read of size 8 at addr ffff888073401940 by task syz.4.5871/17049

CPU: 1 PID: 17049 Comm: syz.4.5871 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
Call Trace:
 <TASK>
 dump_stack_lvl+0x168/0x230 lib/dump_stack.c:106
 print_address_description+0x60/0x2d0 mm/kasan/report.c:248
 __kasan_report mm/kasan/report.c:434 [inline]
 kasan_report+0xdf/0x130 mm/kasan/report.c:451
 check_region_inline mm/kasan/generic.c:-1 [inline]
 kasan_check_range+0x27b/0x290 mm/kasan/generic.c:189
 instrument_atomic_read include/linux/instrumented.h:71 [inline]
 test_bit include/asm-generic/bitops/instrumented-non-atomic.h:134 [inline]
 NInoAttr fs/ntfs/inode.h:200 [inline]
 ntfs_test_inode+0x79/0x2d0 fs/ntfs/inode.c:55
 find_inode+0x180/0x3c0 fs/inode.c:898
 ilookup5_nowait fs/inode.c:1450 [inline]
 ilookup5+0x9f/0x1f0 fs/inode.c:1479
 iget5_locked+0x30/0x250 fs/inode.c:1260
 ntfs_iget+0xab/0x180 fs/ntfs/inode.c:168
 load_and_check_logfile+0x3f/0xd0 fs/ntfs/super.c:1208
 load_system_files+0x3a29/0x5560 fs/ntfs/super.c:1941
 ntfs_fill_super+0x19e0/0x2c90 fs/ntfs/super.c:2894
 mount_bdev+0x287/0x3c0 fs/super.c:1400
 legacy_get_tree+0xe6/0x180 fs/fs_context.c:611
 vfs_get_tree+0x88/0x270 fs/super.c:1530
 do_new_mount+0x24a/0xa40 fs/namespace.c:3025
 do_mount fs/namespace.c:3368 [inline]
 __do_sys_mount fs/namespace.c:3576 [inline]
 __se_sys_mount+0x2d6/0x3c0 fs/namespace.c:3553
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f35be1a538a
Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 de 1a 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 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f35bc40ae68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007f35bc40aef0 RCX: 00007f35be1a538a
RDX: 0000200000000080 RSI: 00002000000001c0 RDI: 00007f35bc40aeb0
RBP: 0000200000000080 R08: 00007f35bc40aef0 R09: 0000000000800884
R10: 0000000000800884 R11: 0000000000000246 R12: 00002000000001c0
R13: 00007f35bc40aeb0 R14: 000000000001ee45 R15: 00002000000005c0
 </TASK>

Allocated by task 15181:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track mm/kasan/common.c:46 [inline]
 set_alloc_info mm/kasan/common.c:434 [inline]
 __kasan_slab_alloc+0x9c/0xd0 mm/kasan/common.c:467
 kasan_slab_alloc include/linux/kasan.h:254 [inline]
 slab_post_alloc_hook+0x4c/0x380 mm/slab.h:519
 slab_alloc_node mm/slub.c:3220 [inline]
 slab_alloc mm/slub.c:3228 [inline]
 kmem_cache_alloc+0x100/0x290 mm/slub.c:3233
 reiserfs_alloc_inode+0x19/0xb0 fs/reiserfs/super.c:642
 alloc_inode fs/inode.c:261 [inline]
 new_inode_pseudo+0x5f/0x210 fs/inode.c:1001
 new_inode+0x25/0x1c0 fs/inode.c:1030
 reiserfs_mkdir+0x185/0x970 fs/reiserfs/namei.c:815
 xattr_mkdir fs/reiserfs/xattr.c:76 [inline]
 create_privroot fs/reiserfs/xattr.c:889 [inline]
 reiserfs_xattr_init+0x331/0x720 fs/reiserfs/xattr.c:1012
 reiserfs_fill_super+0x1fa6/0x23e0 fs/reiserfs/super.c:2179
 mount_bdev+0x287/0x3c0 fs/super.c:1400
 legacy_get_tree+0xe6/0x180 fs/fs_context.c:611
 vfs_get_tree+0x88/0x270 fs/super.c:1530
 do_new_mount+0x24a/0xa40 fs/namespace.c:3025
 do_mount fs/namespace.c:3368 [inline]
 __do_sys_mount fs/namespace.c:3576 [inline]
 __se_sys_mount+0x2d6/0x3c0 fs/namespace.c:3553
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0

Last potentially related work creation:
 kasan_save_stack+0x35/0x60 mm/kasan/common.c:38
 kasan_record_aux_stack+0xb8/0x100 mm/kasan/generic.c:348
 __call_rcu kernel/rcu/tree.c:3011 [inline]
 call_rcu+0x182/0x930 kernel/rcu/tree.c:3091
 destroy_inode fs/inode.c:316 [inline]
 evict+0x7da/0x870 fs/inode.c:662
 reiserfs_new_inode+0x5c8/0x1860 fs/reiserfs/inode.c:2164
 reiserfs_mkdir+0x557/0x970 fs/reiserfs/namei.c:845
 xattr_mkdir fs/reiserfs/xattr.c:76 [inline]
 create_privroot fs/reiserfs/xattr.c:889 [inline]
 reiserfs_xattr_init+0x331/0x720 fs/reiserfs/xattr.c:1012
 reiserfs_fill_super+0x1fa6/0x23e0 fs/reiserfs/super.c:2179
 mount_bdev+0x287/0x3c0 fs/super.c:1400
 legacy_get_tree+0xe6/0x180 fs/fs_context.c:611
 vfs_get_tree+0x88/0x270 fs/super.c:1530
 do_new_mount+0x24a/0xa40 fs/namespace.c:3025
 do_mount fs/namespace.c:3368 [inline]
 __do_sys_mount fs/namespace.c:3576 [inline]
 __se_sys_mount+0x2d6/0x3c0 fs/namespace.c:3553
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0

Second to last potentially related work creation:
 kasan_save_stack+0x35/0x60 mm/kasan/common.c:38
 kasan_record_aux_stack+0xb8/0x100 mm/kasan/generic.c:348
 __call_rcu kernel/rcu/tree.c:3011 [inline]
 call_rcu+0x182/0x930 kernel/rcu/tree.c:3091
 destroy_inode fs/inode.c:316 [inline]
 evict+0x7da/0x870 fs/inode.c:662
 dispose_list fs/inode.c:680 [inline]
 evict_inodes+0x604/0x690 fs/inode.c:734
 generic_shutdown_super+0x93/0x300 fs/super.c:454
 kill_block_super+0x7c/0xe0 fs/super.c:1427
 deactivate_locked_super+0x93/0xf0 fs/super.c:335
 cleanup_mnt+0x418/0x4d0 fs/namespace.c:1139
 task_work_run+0x125/0x1a0 kernel/task_work.c:188
 tracehook_notify_resume include/linux/tracehook.h:189 [inline]
 exit_to_user_mode_loop+0x10f/0x130 kernel/entry/common.c:181
 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:214
 __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline]
 syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:307
 do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:86
 entry_SYSCALL_64_after_hwframe+0x66/0xd0

The buggy address belongs to the object at ffff8880734013e0
 which belongs to the cache reiser_inode_cache of size 1568
The buggy address is located 1376 bytes inside of
 1568-byte region [ffff8880734013e0, ffff888073401a00)
The buggy address belongs to the page:
page:ffffea0001cd0000 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888073402120 pfn:0x73400
head:ffffea0001cd0000 order:3 compound_mapcount:0 compound_pincount:0
memcg:ffff88805db5ae01
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 0000000000000000 dead000000000122 ffff88801dc27b40
raw: ffff888073402120 000000008013000f 00000001ffffffff ffff88805db5ae01
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 5539, ts 78078609598, free_ts 69420441290
 prep_new_page mm/page_alloc.c:2426 [inline]
 get_page_from_freelist+0x1b77/0x1c60 mm/page_alloc.c:4192
 __alloc_pages+0x1e1/0x470 mm/page_alloc.c:5487
 alloc_slab_page mm/slub.c:1775 [inline]
 allocate_slab mm/slub.c:1912 [inline]
 new_slab+0xc0/0x4b0 mm/slub.c:1975
 ___slab_alloc+0x81e/0xdf0 mm/slub.c:3008
 __slab_alloc mm/slub.c:3095 [inline]
 slab_alloc_node mm/slub.c:3186 [inline]
 slab_alloc mm/slub.c:3228 [inline]
 kmem_cache_alloc+0x195/0x290 mm/slub.c:3233
 reiserfs_alloc_inode+0x19/0xb0 fs/reiserfs/super.c:642
 alloc_inode fs/inode.c:261 [inline]
 iget5_locked+0x9e/0x250 fs/inode.c:1263
 reiserfs_fill_super+0x11c5/0x23e0 fs/reiserfs/super.c:2057
 mount_bdev+0x287/0x3c0 fs/super.c:1400
 legacy_get_tree+0xe6/0x180 fs/fs_context.c:611
 vfs_get_tree+0x88/0x270 fs/super.c:1530
 do_new_mount+0x24a/0xa40 fs/namespace.c:3025
 do_mount fs/namespace.c:3368 [inline]
 __do_sys_mount fs/namespace.c:3576 [inline]
 __se_sys_mount+0x2d6/0x3c0 fs/namespace.c:3553
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1340 [inline]
 free_pcp_prepare mm/page_alloc.c:1391 [inline]
 free_unref_page_prepare+0x637/0x6c0 mm/page_alloc.c:3317
 free_unref_page+0x94/0x280 mm/page_alloc.c:3396
 qlist_free_all+0x35/0x90 mm/kasan/quarantine.c:176
 kasan_quarantine_reduce+0x150/0x160 mm/kasan/quarantine.c:283
 __kasan_slab_alloc+0x2f/0xd0 mm/kasan/common.c:444
 kasan_slab_alloc include/linux/kasan.h:254 [inline]
 slab_post_alloc_hook+0x4c/0x380 mm/slab.h:519
 slab_alloc_node mm/slub.c:3220 [inline]
 slab_alloc mm/slub.c:3228 [inline]
 __kmalloc+0x127/0x330 mm/slub.c:4403
 kmalloc include/linux/slab.h:609 [inline]
 tomoyo_realpath_from_path+0x118/0x610 security/tomoyo/realpath.c:254
 tomoyo_get_realpath security/tomoyo/file.c:151 [inline]
 tomoyo_path_perm+0x1cd/0x510 security/tomoyo/file.c:822
 security_inode_getattr+0xcf/0x120 security/security.c:1348
 vfs_getattr+0x26/0x3a0 fs/stat.c:157
 vfs_fstat fs/stat.c:182 [inline]
 __do_sys_newfstat fs/stat.c:421 [inline]
 __se_sys_newfstat fs/stat.c:418 [inline]
 __x64_sys_newfstat+0x104/0x1d0 fs/stat.c:418
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0

Memory state around the buggy address:
 ffff888073401800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888073401880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888073401900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                           ^
 ffff888073401980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888073401a00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================

Crashes (17):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/08/29 09:29 linux-5.15.y 01879f56bdde 3e1beec6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in ntfs_test_inode
2025/08/26 15:41 linux-5.15.y c79648372d02 e12e5ba4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in ntfs_test_inode
2025/07/14 10:44 linux-5.15.y 2f693b607545 d8fc7335 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in ntfs_test_inode
2025/06/30 17:22 linux-5.15.y 3dea0e7f549e 6e83b42d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in ntfs_test_inode
2025/05/01 12:52 linux-5.15.y f7347f400572 51b137cd .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in ntfs_test_inode
2025/04/24 06:45 linux-5.15.y f7347f400572 9882047a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in ntfs_test_inode
2025/04/17 02:16 linux-5.15.y f7347f400572 a95239b1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in ntfs_test_inode
2025/04/09 10:04 linux-5.15.y 0c935c049b5c 47d015b1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in ntfs_test_inode
2025/02/26 20:38 linux-5.15.y c16c81c81336 6a8fcbc4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in ntfs_test_inode
2024/08/26 01:18 linux-5.15.y fa93fa65db6e d7d32352 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in ntfs_test_inode
2025/04/29 18:19 linux-5.15.y f7347f400572 85a5a23f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in ntfs_test_inode
2025/01/10 02:14 linux-5.15.y 4735586da88e 67d7ec0a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in ntfs_test_inode
2024/09/27 17:39 linux-5.15.y 3a5928702e71 440b26ec .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in ntfs_test_inode
2025/05/15 15:46 linux-5.15.y 3b8db0e4f263 cfde8269 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Read in ntfs_test_inode
2025/01/14 00:54 linux-5.15.y 4735586da88e b1f1cd88 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: slab-out-of-bounds Read in ntfs_test_inode
2025/01/10 02:11 linux-5.15.y 4735586da88e 67d7ec0a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: slab-out-of-bounds Read in ntfs_test_inode
2024/12/09 18:34 linux-5.15.y 0a51d2d4527b 9ac0fdc6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: slab-out-of-bounds Read in ntfs_test_inode
* Struck through repros no longer work on HEAD.