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: 448d, last: 12d
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 79d 312d 0/3 upstream: reported on 2025/01/09 09:49
linux-4.19 KASAN: use-after-free Read in ntfs_test_inode 19 1 1084d 1084d 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 710d 1645d 25/29 fixed on 2023/12/21 01:43
linux-6.1 KASAN: use-after-free Read in ntfs_test_inode 19 2 602d 604d 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 768d 968d 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 677d 677d 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 1369d 1369d 0/1 auto-closed as invalid on 2022/06/16 22:11

Sample crash report:
ntfs: (device loop3): check_mft_mirror(): Incomplete multi sector transfer detected in mft mirror record 2.
==================================================================
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 ffff888075ab3630 by task syz.3.5256/16377

CPU: 0 PID: 16377 Comm: syz.3.5256 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/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_system_files+0x2ce3/0x5560 fs/ntfs/super.c:1847
 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:3034
 do_mount fs/namespace.c:3377 [inline]
 __do_sys_mount fs/namespace.c:3585 [inline]
 __se_sys_mount+0x2d6/0x3c0 fs/namespace.c:3562
 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:0x7f1e052ede6a
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:00007f1e03552e68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007f1e03552ef0 RCX: 00007f1e052ede6a
RDX: 000020000001f1c0 RSI: 000020000001f200 RDI: 00007f1e03552eb0
RBP: 000020000001f1c0 R08: 00007f1e03552ef0 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000020000001f200
R13: 00007f1e03552eb0 R14: 000000000001f1ee R15: 0000200000000000
 </TASK>

Allocated by task 14358:
 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:3225 [inline]
 slab_alloc mm/slub.c:3233 [inline]
 kmem_cache_alloc+0x100/0x290 mm/slub.c:3238
 f2fs_kmem_cache_alloc fs/f2fs/f2fs.h:2648 [inline]
 f2fs_alloc_inode+0x16c/0x5d0 fs/f2fs/super.c:1396
 alloc_inode fs/inode.c:261 [inline]
 iget_locked+0x191/0x820 fs/inode.c:1308
 f2fs_iget+0x52/0x4a50 fs/f2fs/inode.c:505
 f2fs_fill_super+0x4925/0x6f00 fs/f2fs/super.c:4294
 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:3034
 do_mount fs/namespace.c:3377 [inline]
 __do_sys_mount fs/namespace.c:3585 [inline]
 __se_sys_mount+0x2d6/0x3c0 fs/namespace.c:3562
 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
 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
 kill_f2fs_super+0x2ed/0x3a0 fs/f2fs/super.c:4565
 deactivate_locked_super+0x93/0xf0 fs/super.c:335
 cleanup_mnt+0x418/0x4d0 fs/namespace.c:1148
 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+0xee/0x180 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

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
 f2fs_put_super+0x735/0xc90 fs/f2fs/super.c:1634
 generic_shutdown_super+0x130/0x300 fs/super.c:475
 kill_block_super+0x7c/0xe0 fs/super.c:1427
 kill_f2fs_super+0x2ed/0x3a0 fs/f2fs/super.c:4565
 deactivate_locked_super+0x93/0xf0 fs/super.c:335
 cleanup_mnt+0x418/0x4d0 fs/namespace.c:1148
 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+0xee/0x180 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 ffff888075ab2f80
 which belongs to the cache f2fs_inode_cache of size 2304
The buggy address is located 1712 bytes inside of
 2304-byte region [ffff888075ab2f80, ffff888075ab3880)
The buggy address belongs to the page:
page:ffffea0001d6ac00 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888075ab1c80 pfn:0x75ab0
head:ffffea0001d6ac00 order:3 compound_mapcount:0 compound_pincount:0
memcg:ffff888063256501
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 0000000000000000 dead000000000122 ffff88801e119c80
raw: ffff888075ab1c80 00000000800d0006 00000001ffffffff ffff888063256501
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Reclaimable, gfp_mask 0x1d2050(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL|__GFP_RECLAIMABLE), pid 4648, ts 85654712699, free_ts 77253575495
 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:1780 [inline]
 allocate_slab mm/slub.c:1917 [inline]
 new_slab+0xc0/0x4b0 mm/slub.c:1980
 ___slab_alloc+0x81e/0xdf0 mm/slub.c:3013
 __slab_alloc mm/slub.c:3100 [inline]
 slab_alloc_node mm/slub.c:3191 [inline]
 slab_alloc mm/slub.c:3233 [inline]
 kmem_cache_alloc+0x195/0x290 mm/slub.c:3238
 f2fs_kmem_cache_alloc fs/f2fs/f2fs.h:2648 [inline]
 f2fs_alloc_inode+0x16c/0x5d0 fs/f2fs/super.c:1396
 alloc_inode fs/inode.c:261 [inline]
 iget_locked+0x191/0x820 fs/inode.c:1308
 f2fs_iget+0x52/0x4a50 fs/f2fs/inode.c:505
 f2fs_fill_super+0x3c76/0x6f00 fs/f2fs/super.c:4178
 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:3034
 do_mount fs/namespace.c:3377 [inline]
 __do_sys_mount fs/namespace.c:3585 [inline]
 __se_sys_mount+0x2d6/0x3c0 fs/namespace.c:3562
 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:3225 [inline]
 slab_alloc mm/slub.c:3233 [inline]
 kmem_cache_alloc+0x100/0x290 mm/slub.c:3238
 getname_flags+0xb5/0x500 fs/namei.c:138
 user_path_at_empty+0x2a/0x190 fs/namei.c:2890
 user_path_at include/linux/namei.h:57 [inline]
 vfs_statx+0x102/0x4d0 fs/stat.c:221
 vfs_fstatat fs/stat.c:243 [inline]
 __do_sys_newfstatat fs/stat.c:411 [inline]
 __se_sys_newfstatat fs/stat.c:405 [inline]
 __x64_sys_newfstatat+0x12c/0x1b0 fs/stat.c:405
 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:
 ffff888075ab3500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888075ab3580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888075ab3600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                     ^
 ffff888075ab3680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888075ab3700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (20):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/11/05 06:38 linux-5.15.y cc5ec8769306 a6c9c731 .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/10/15 16:38 linux-5.15.y 29e53a5b1c4f 19568248 .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/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/10/29 14:09 linux-5.15.y cc5ec8769306 fd2207e7 .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/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.