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: 179d, last: 8d11h
Similar bugs (6)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.1 KASAN: use-after-free Read in ntfs_iget5 7 561d 807d 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 5 627d 769d 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) 5 325d 424d 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 C done done 3633 500d 1134d 25/28 fixed on 2024/03/20 11:33
linux-6.1 KASAN: use-after-free Read in ntfs_iget5 (2) origin:upstream C error 33 5d16h 428d 0/3 upstream: reported C repro on 2024/03/29 09:18
upstream BUG: unable to handle kernel paging request in ntfs_iget5 ntfs3 1 383d 379d 0/28 auto-obsoleted due to no activity on 2024/08/10 16:42

Sample crash report:
ntfs3: loop3: Different NTFS' sector size (4096) 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 ffff888071bf7f60 by task syz.3.321/4979

CPU: 0 PID: 4979 Comm: syz.3.321 Not tainted 5.15.182-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/19/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:3013
 do_mount fs/namespace.c:3356 [inline]
 __do_sys_mount fs/namespace.c:3564 [inline]
 __se_sys_mount+0x2d6/0x3c0 fs/namespace.c:3541
 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:0x7fc61feb110a
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:00007fc61dd16e68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007fc61dd16ef0 RCX: 00007fc61feb110a
RDX: 0000200000000000 RSI: 000020000001f1c0 RDI: 00007fc61dd16eb0
RBP: 0000200000000000 R08: 00007fc61dd16ef0 R09: 0000000002804882
R10: 0000000002804882 R11: 0000000000000246 R12: 000020000001f1c0
R13: 00007fc61dd16eb0 R14: 000000000001f1f2 R15: 00002000000002c0
 </TASK>

Allocated by task 4960:
 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
 proc_alloc_inode+0x19/0xa0 fs/proc/inode.c:69
 alloc_inode fs/inode.c:261 [inline]
 new_inode_pseudo+0x5f/0x210 fs/inode.c:1001
 new_inode+0x25/0x1c0 fs/inode.c:1030
 proc_pid_make_inode+0x20/0x1c0 fs/proc/base.c:1957
 proc_pid_make_base_inode fs/proc/base.c:2008 [inline]
 proc_pid_instantiate+0x4f/0x2b0 fs/proc/base.c:3439
 proc_pid_lookup+0x2c4/0x3d0 fs/proc/base.c:3483
 proc_root_lookup+0x1c/0x50 fs/proc/root.c:322
 __lookup_slow+0x27d/0x3d0 fs/namei.c:1663
 lookup_slow+0x53/0x70 fs/namei.c:1680
 walk_component+0x319/0x460 fs/namei.c:1976
 link_path_walk+0x662/0xd40 fs/namei.c:-1
 path_openat+0x27d/0x2f30 fs/namei.c:3738
 do_filp_open+0x1b3/0x3e0 fs/namei.c:3769
 do_sys_openat2+0x142/0x4a0 fs/open.c:1253
 do_sys_open fs/open.c:1269 [inline]
 __do_sys_openat fs/open.c:1285 [inline]
 __se_sys_openat fs/open.c:1280 [inline]
 __x64_sys_openat+0x135/0x160 fs/open.c:1280
 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:3007 [inline]
 call_rcu+0x179/0x920 kernel/rcu/tree.c:3087
 destroy_inode fs/inode.c:316 [inline]
 evict+0x7da/0x870 fs/inode.c:662
 __dentry_kill+0x431/0x650 fs/dcache.c:586
 shrink_dentry_list+0x388/0x680 fs/dcache.c:1181
 shrink_dcache_parent+0xa8/0x3a0 fs/dcache.c:-1
 d_invalidate+0x118/0x260 fs/dcache.c:1717
 proc_invalidate_siblings_dcache+0x396/0x650 fs/proc/inode.c:150
 release_task+0x13f6/0x15a0 kernel/exit.c:269
 wait_task_zombie kernel/exit.c:1181 [inline]
 wait_consider_task+0x18d2/0x2df0 kernel/exit.c:1408
 do_wait_thread kernel/exit.c:1471 [inline]
 do_wait+0x2f8/0xac0 kernel/exit.c:1588
 kernel_wait4+0x1ab/0x270 kernel/exit.c:1751
 __do_sys_wait4 kernel/exit.c:1779 [inline]
 __se_sys_wait4 kernel/exit.c:1775 [inline]
 __x64_sys_wait4+0x130/0x1e0 kernel/exit.c:1775
 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:3007 [inline]
 call_rcu+0x179/0x920 kernel/rcu/tree.c:3087
 destroy_inode fs/inode.c:316 [inline]
 evict+0x7da/0x870 fs/inode.c:662
 proc_invalidate_siblings_dcache+0x3ef/0x650 fs/proc/inode.c:160
 release_task+0x13f6/0x15a0 kernel/exit.c:269
 wait_task_zombie kernel/exit.c:1181 [inline]
 wait_consider_task+0x18d2/0x2df0 kernel/exit.c:1408
 do_wait_thread kernel/exit.c:1471 [inline]
 do_wait+0x2f8/0xac0 kernel/exit.c:1588
 kernel_wait4+0x1ab/0x270 kernel/exit.c:1751
 __do_sys_wait4 kernel/exit.c:1779 [inline]
 __se_sys_wait4 kernel/exit.c:1775 [inline]
 __x64_sys_wait4+0x130/0x1e0 kernel/exit.c:1775
 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

The buggy address belongs to the object at ffff888071bf7590
 which belongs to the cache proc_inode_cache of size 1240
The buggy address is located 1272 bytes to the right of
 1240-byte region [ffff888071bf7590, ffff888071bf7a68)
The buggy address belongs to the page:
page:ffffea0001c6fc00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x71bf0
head:ffffea0001c6fc00 order:3 compound_mapcount:0 compound_pincount:0
memcg:ffff88801ee17f01
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 ffffea0001c61e00 0000000200000002 ffff88801754a3c0
raw: 0000000000000000 0000000000170017 00000001ffffffff ffff88801ee17f01
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 4333, ts 83977808816, free_ts 64063123030
 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:5466
 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
 proc_alloc_inode+0x19/0xa0 fs/proc/inode.c:69
 alloc_inode fs/inode.c:261 [inline]
 new_inode_pseudo+0x5f/0x210 fs/inode.c:1001
 new_inode+0x25/0x1c0 fs/inode.c:1030
 proc_pid_make_inode+0x20/0x1c0 fs/proc/base.c:1957
 proc_pident_instantiate+0x69/0x2b0 fs/proc/base.c:2698
 proc_pident_lookup+0x1c6/0x260 fs/proc/base.c:2734
 lookup_open fs/namei.c:3440 [inline]
 open_last_lookups fs/namei.c:3532 [inline]
 path_openat+0x1003/0x2f30 fs/namei.c:3739
 do_filp_open+0x1b3/0x3e0 fs/namei.c:3769
 do_sys_openat2+0x142/0x4a0 fs/open.c:1253
 do_sys_open fs/open.c:1269 [inline]
 __do_sys_openat fs/open.c:1285 [inline]
 __se_sys_openat fs/open.c:1280 [inline]
 __x64_sys_openat+0x135/0x160 fs/open.c:1280
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
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_list+0x122/0x7e0 mm/page_alloc.c:3433
 release_pages+0x184b/0x1bb0 mm/swap.c:963
 tlb_batch_pages_flush mm/mmu_gather.c:49 [inline]
 tlb_flush_mmu_free mm/mmu_gather.c:240 [inline]
 tlb_flush_mmu mm/mmu_gather.c:247 [inline]
 tlb_finish_mmu+0x164/0x2e0 mm/mmu_gather.c:338
 unmap_region+0x315/0x360 mm/mmap.c:2657
 __do_munmap+0x9d3/0xdc0 mm/mmap.c:2887
 __vm_munmap+0x137/0x230 mm/mmap.c:2940
 __do_sys_munmap mm/mmap.c:2966 [inline]
 __se_sys_munmap mm/mmap.c:2962 [inline]
 __x64_sys_munmap+0x67/0x70 mm/mmap.c:2962
 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:
 ffff888071bf7e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888071bf7e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888071bf7f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
                                                       ^
 ffff888071bf7f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888071bf8000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================

Crashes (19):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
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/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/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/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.