syzbot


KASAN: slab-out-of-bounds Read in ntfs_iget5

Status: upstream: reported on 2024/12/03 01:28
Reported-by: syzbot+7f9842213310bb64a581@syzkaller.appspotmail.com
First crash: 236d, last: 11h11m
Similar bugs (6)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.1 KASAN: use-after-free Read in ntfs_iget5 19 7 618d 865d 0/3 auto-obsoleted due to no activity on 2024/02/25 08:58
linux-5.15 KASAN: use-after-free Read in ntfs_iget5 19 5 685d 826d 0/3 auto-obsoleted due to no activity on 2023/12/20 11:31
linux-5.15 KASAN: use-after-free Read in ntfs_iget5 (2) 19 5 382d 481d 0/3 auto-obsoleted due to no activity on 2024/10/18 06:28
upstream KASAN: slab-out-of-bounds Read in ntfs_iget5 ntfs3 19 C done done 3633 557d 1192d 25/29 fixed on 2024/03/20 11:33
linux-6.1 KASAN: use-after-free Read in ntfs_iget5 (2) origin:upstream 19 C error 37 11d 485d 0/3 upstream: reported C repro on 2024/03/29 09:18
upstream BUG: unable to handle kernel paging request in ntfs_iget5 ntfs3 8 1 441d 437d 0/29 auto-obsoleted due to no activity on 2024/08/10 16:42

Sample crash report:
loop7: detected capacity change from 0 to 4096
ntfs3: loop7: Different NTFS' sector size (2048) and media sector size (512)
==================================================================
BUG: KASAN: slab-out-of-bounds in ntfs_iget5+0x14a/0x3670 fs/ntfs3/inode.c:526
Read of size 8 at addr ffff888060547f60 by task syz.7.591/7548

CPU: 1 PID: 7548 Comm: syz.7.591 Not tainted 5.15.189-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/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
 ntfs_iget5+0x14a/0x3670 fs/ntfs3/inode.c:526
 ntfs_fill_super+0x2068/0x3c10 fs/ntfs3/super.c:1004
 get_tree_bdev+0x3f1/0x610 fs/super.c:1325
 vfs_get_tree+0x88/0x270 fs/super.c:1530
 do_new_mount+0x24a/0xa40 fs/namespace.c:3014
 do_mount fs/namespace.c:3357 [inline]
 __do_sys_mount fs/namespace.c:3565 [inline]
 __se_sys_mount+0x2d6/0x3c0 fs/namespace.c:3542
 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:0x7fa3e984e14a
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:00007fa3e76b3e68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007fa3e76b3ef0 RCX: 00007fa3e984e14a
RDX: 0000200000000040 RSI: 0000200000000200 RDI: 00007fa3e76b3eb0
RBP: 0000200000000040 R08: 00007fa3e76b3ef0 R09: 0000000000810050
R10: 0000000000810050 R11: 0000000000000246 R12: 0000200000000200
R13: 00007fa3e76b3eb0 R14: 000000000001f423 R15: 0000200000000100
 </TASK>

Allocated by task 5160:
 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
 ntfs_alloc_big_inode+0x46/0xb0 fs/ntfs/inode.c:313
 alloc_inode fs/inode.c:261 [inline]
 iget5_locked+0x9e/0x250 fs/inode.c:1263
 ntfs_iget+0xab/0x180 fs/ntfs/inode.c:168
 load_system_files+0x28b2/0x5560 fs/ntfs/super.c:1825
 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:3014
 do_mount fs/namespace.c:3357 [inline]
 __do_sys_mount fs/namespace.c:3565 [inline]
 __se_sys_mount+0x2d6/0x3c0 fs/namespace.c:3542
 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
 ntfs_put_super+0x9f3/0x1070 fs/ntfs/super.c:2360
 generic_shutdown_super+0x130/0x300 fs/super.c:475
 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 ffff888060547380
 which belongs to the cache ntfs_big_inode_cache of size 1968
The buggy address is located 1072 bytes to the right of
 1968-byte region [ffff888060547380, ffff888060547b30)
The buggy address belongs to the page:
page:ffffea0001815000 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888060544a40 pfn:0x60540
head:ffffea0001815000 order:3 compound_mapcount:0 compound_pincount:0
memcg:ffff888056600401
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 0000000000000000 0000000100000001 ffff8881466bda00
raw: ffff888060544a40 00000000800f0000 00000001ffffffff ffff888056600401
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 4659, ts 88280205156, free_ts 65591901577
 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:5474
 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
 ntfs_alloc_big_inode+0x46/0xb0 fs/ntfs/inode.c:313
 alloc_inode fs/inode.c:261 [inline]
 new_inode_pseudo+0x5f/0x210 fs/inode.c:1001
 new_inode+0x25/0x1c0 fs/inode.c:1030
 ntfs_fill_super+0x1862/0x2c90 fs/ntfs/super.c:2849
 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:3014
 do_mount fs/namespace.c:3357 [inline]
 __do_sys_mount fs/namespace.c:3565 [inline]
 __se_sys_mount+0x2d6/0x3c0 fs/namespace.c:3542
 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
 free_slab mm/slub.c:2015 [inline]
 discard_slab mm/slub.c:2021 [inline]
 __unfreeze_partials+0x1a5/0x200 mm/slub.c:2507
 put_cpu_partial+0x12d/0x190 mm/slub.c:2587
 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]
 kmem_cache_alloc+0x100/0x290 mm/slub.c:3233
 kmem_cache_zalloc include/linux/slab.h:725 [inline]
 jbd2_alloc_handle include/linux/jbd2.h:1597 [inline]
 new_handle fs/jbd2/transaction.c:477 [inline]
 jbd2__journal_start+0x13c/0x5a0 fs/jbd2/transaction.c:504
 __ext4_journal_start_sb+0x167/0x360 fs/ext4/ext4_jbd2.c:105
 __ext4_journal_start fs/ext4/ext4_jbd2.h:326 [inline]
 ext4_dirty_inode+0x8b/0x100 fs/ext4/inode.c:6037
 __mark_inode_dirty+0x2b0/0xc60 fs/fs-writeback.c:2464
 generic_update_time+0x1cd/0x1f0 fs/inode.c:1881
 inode_update_time fs/inode.c:1894 [inline]
 file_update_time+0x38b/0x400 fs/inode.c:2083
 ext4_page_mkwrite+0x1b4/0x1240 fs/ext4/inode.c:6158

Memory state around the buggy address:
 ffff888060547e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888060547e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888060547f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
                                                       ^
 ffff888060547f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888060548000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================

Crashes (30):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/07/27 08:45 linux-5.15.y c79648372d02 fb8f743d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Read in ntfs_iget5
2025/07/16 07:10 linux-5.15.y 89950c454265 124ec9cc .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Read in ntfs_iget5
2025/06/23 21:47 linux-5.15.y 1c700860e8bc e2f27c35 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Read in ntfs_iget5
2025/05/14 12:43 linux-5.15.y 3b8db0e4f263 a4fa04ef .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Read in ntfs_iget5
2024/12/03 01:28 linux-5.15.y 0a51d2d4527b 578925bc .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Read in ntfs_iget5
2025/07/08 14:37 linux-5.15.y 3dea0e7f549e 4d9fdfa4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: slab-out-of-bounds Read in ntfs_iget5
2025/03/07 13:56 linux-5.15.y c16c81c81336 7e3bd60d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: slab-out-of-bounds Read in ntfs_iget5
2025/01/20 15:26 linux-5.15.y 4735586da88e 6e87cfa2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: slab-out-of-bounds Read in ntfs_iget5
2025/07/18 02:10 linux-5.15.y c79648372d02 88248e14 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan general protection fault in ntfs_iget5
2025/07/14 10:47 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_iget5
2025/06/27 22:16 linux-5.15.y 3dea0e7f549e fc9d8ee5 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan general protection fault in ntfs_iget5
2025/06/17 01:44 linux-5.15.y 1c700860e8bc cfebc887 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in ntfs_iget5
2025/06/09 08:16 linux-5.15.y 1c700860e8bc 4826c28e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in ntfs_iget5
2025/06/04 14:11 linux-5.15.y 1c700860e8bc e565f08d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in ntfs_iget5
2025/05/23 00:14 linux-5.15.y 98f47d0e9b8c fa44301a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in ntfs_iget5
2025/05/21 11:48 linux-5.15.y a68c15152131 dc5d3808 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in ntfs_iget5
2025/05/09 08:56 linux-5.15.y 3b8db0e4f263 bb813bcc .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in ntfs_iget5
2025/05/09 00:34 linux-5.15.y 16fdf2c7111b bb813bcc .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in ntfs_iget5
2025/05/06 18:12 linux-5.15.y 16fdf2c7111b 350f4ffc .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in ntfs_iget5
2025/04/03 18:12 linux-5.15.y 0c935c049b5c d7ae3a11 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan general protection fault in ntfs_iget5
2024/12/22 10:36 linux-5.15.y 91786f140358 b4fbdbd4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in ntfs_iget5
2024/12/14 19:51 linux-5.15.y 963e654022cc 7cbfbb3a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in ntfs_iget5
2025/06/04 10:06 linux-5.15.y 98f47d0e9b8c e565f08d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in ntfs_iget5
2025/05/15 00:58 linux-5.15.y 3b8db0e4f263 d6b2ee52 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in ntfs_iget5
2025/05/01 12:46 linux-5.15.y f7347f400572 51b137cd .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in ntfs_iget5
2025/04/25 17:59 linux-5.15.y f7347f400572 c6b4fb39 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in ntfs_iget5
2025/03/21 20:20 linux-5.15.y 0c935c049b5c c6512ef7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in ntfs_iget5
2025/02/24 03:12 linux-5.15.y c16c81c81336 d34966d1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in ntfs_iget5
2025/02/18 22:44 linux-5.15.y c16c81c81336 9a14138f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in ntfs_iget5
2025/01/15 03:59 linux-5.15.y 4735586da88e 7315a7cf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in ntfs_iget5
* Struck through repros no longer work on HEAD.