syzbot


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

Status: auto-obsoleted due to no activity on 2023/08/11 10:25
Reported-by: syzbot+87ee9e67149f35589425@syzkaller.appspotmail.com
First crash: 384d, last: 384d
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream BUG: unable to handle kernel NULL pointer dereference in ni_find_attr ntfs3 C done done 81 481d 616d 22/26 fixed on 2023/02/24 13:51

Sample crash report:
loop0: detected capacity change from 0 to 4096
ntfs3: loop0: Different NTFS' sector size (2048) and media sector size (512)
==================================================================
BUG: KASAN: slab-out-of-bounds in ni_find_attr+0xa7/0x8b0 fs/ntfs3/frecord.c:193
Read of size 8 at addr ffff88803684ffe8 by task syz-executor.0/26633

CPU: 0 PID: 26633 Comm: syz-executor.0 Not tainted 5.15.106-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/30/2023
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
 print_address_description+0x63/0x3b0 mm/kasan/report.c:248
 __kasan_report mm/kasan/report.c:434 [inline]
 kasan_report+0x16b/0x1c0 mm/kasan/report.c:451
 ni_find_attr+0xa7/0x8b0 fs/ntfs3/frecord.c:193
 ntfs_fill_super+0x1d0a/0x4450 fs/ntfs3/super.c:951
 get_tree_bdev+0x3fe/0x620 fs/super.c:1303
 vfs_get_tree+0x88/0x270 fs/super.c:1508
 do_new_mount+0x28b/0xad0 fs/namespace.c:2994
 do_mount fs/namespace.c:3337 [inline]
 __do_sys_mount fs/namespace.c:3545 [inline]
 __se_sys_mount+0x2d5/0x3c0 fs/namespace.c:3522
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7fa8262f569a
Code: 48 c7 c2 b8 ff ff ff f7 d8 64 89 02 b8 ff ff ff ff eb d2 e8 b8 04 00 00 0f 1f 84 00 00 00 00 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fa824865f88 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 000000000001f3c8 RCX: 00007fa8262f569a
RDX: 0000000020000000 RSI: 0000000020000040 RDI: 00007fa824865fe0
RBP: 00007fa824866020 R08: 00007fa824866020 R09: 0000000001004018
R10: 0000000001004018 R11: 0000000000000202 R12: 0000000020000000
R13: 0000000020000040 R14: 00007fa824865fe0 R15: 0000000020000240
 </TASK>

Allocated by task 7159:
 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+0x8e/0xc0 mm/kasan/common.c:467
 kasan_slab_alloc include/linux/kasan.h:254 [inline]
 slab_post_alloc_hook+0x53/0x380 mm/slab.h:519
 slab_alloc_node mm/slub.c:3220 [inline]
 slab_alloc mm/slub.c:3228 [inline]
 kmem_cache_alloc+0xf3/0x280 mm/slub.c:3233
 kmem_cache_zalloc include/linux/slab.h:711 [inline]
 alloc_buffer_head+0x20/0xf0 fs/buffer.c:3311
 alloc_page_buffers+0x3a3/0x660 fs/buffer.c:832
 grow_dev_page fs/buffer.c:968 [inline]
 grow_buffers fs/buffer.c:1014 [inline]
 __getblk_slow fs/buffer.c:1041 [inline]
 __getblk_gfp+0x4b4/0xaf0 fs/buffer.c:1336
 __bread_gfp+0x2a/0x390 fs/buffer.c:1381
 sb_bread include/linux/buffer_head.h:337 [inline]
 ntfs_bread fs/ntfs3/ntfs_fs.h:1014 [inline]
 ntfs_init_from_boot fs/ntfs3/super.c:696 [inline]
 ntfs_fill_super+0x808/0x4450 fs/ntfs3/super.c:930
 get_tree_bdev+0x3fe/0x620 fs/super.c:1303
 vfs_get_tree+0x88/0x270 fs/super.c:1508
 do_new_mount+0x28b/0xad0 fs/namespace.c:2994
 do_mount fs/namespace.c:3337 [inline]
 __do_sys_mount fs/namespace.c:3545 [inline]
 __se_sys_mount+0x2d5/0x3c0 fs/namespace.c:3522
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x61/0xcb

The buggy address belongs to the object at ffff88803684fe80
 which belongs to the cache buffer_head of size 168
The buggy address is located 192 bytes to the right of
 168-byte region [ffff88803684fe80, ffff88803684ff28)
The buggy address belongs to the page:
page:ffffea0000da13c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x3684f
memcg:ffff88807a905801
flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000200 ffffea0000da4dc0 0000000600000006 ffff888140767a00
raw: 0000000000000000 0000000000110011 00000001ffffffff ffff88807a905801
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Reclaimable, gfp_mask 0x112c50(GFP_NOFS|__GFP_NOWARN|__GFP_NORETRY|__GFP_HARDWALL|__GFP_RECLAIMABLE), pid 6223, ts 306355272237, free_ts 305020451801
 prep_new_page mm/page_alloc.c:2426 [inline]
 get_page_from_freelist+0x322a/0x33c0 mm/page_alloc.c:4159
 __alloc_pages+0x272/0x700 mm/page_alloc.c:5421
 alloc_slab_page mm/slub.c:1775 [inline]
 allocate_slab mm/slub.c:1912 [inline]
 new_slab+0xbb/0x4b0 mm/slub.c:1975
 ___slab_alloc+0x6f6/0xe10 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+0x18e/0x280 mm/slub.c:3233
 kmem_cache_zalloc include/linux/slab.h:711 [inline]
 alloc_buffer_head+0x20/0xf0 fs/buffer.c:3311
 alloc_page_buffers+0x3a3/0x660 fs/buffer.c:832
 grow_dev_page fs/buffer.c:968 [inline]
 grow_buffers fs/buffer.c:1014 [inline]
 __getblk_slow fs/buffer.c:1041 [inline]
 __getblk_gfp+0x4b4/0xaf0 fs/buffer.c:1336
 __bread_gfp+0x2a/0x390 fs/buffer.c:1381
 sb_bread include/linux/buffer_head.h:337 [inline]
 ntfs_bread fs/ntfs3/ntfs_fs.h:1014 [inline]
 ntfs_read_run_nb+0x51c/0xe60 fs/ntfs3/fsntfs.c:1202
 read_log_page+0x274/0x580 fs/ntfs3/fslog.c:1143
 log_read_rst+0x16a/0x1480 fs/ntfs3/fslog.c:1201
 log_replay+0x549/0xbed0 fs/ntfs3/fslog.c:3788
 ntfs_loadlog_and_replay+0x2c8/0x530 fs/ntfs3/fsntfs.c:299
 ntfs_fill_super+0x24d2/0x4450 fs/ntfs3/super.c:1013
 get_tree_bdev+0x3fe/0x620 fs/super.c:1303
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+0xc34/0xcf0 mm/page_alloc.c:3317
 free_unref_page+0x95/0x2d0 mm/page_alloc.c:3396
 free_slab mm/slub.c:2015 [inline]
 discard_slab mm/slub.c:2021 [inline]
 __unfreeze_partials+0x1b7/0x210 mm/slub.c:2507
 put_cpu_partial+0x132/0x1a0 mm/slub.c:2587
 do_slab_free mm/slub.c:3487 [inline]
 ___cache_free+0xe3/0x100 mm/slub.c:3506
 qlist_free_all+0x36/0x90 mm/kasan/quarantine.c:176
 kasan_quarantine_reduce+0x162/0x180 mm/kasan/quarantine.c:283
 __kasan_slab_alloc+0x2f/0xc0 mm/kasan/common.c:444
 kasan_slab_alloc include/linux/kasan.h:254 [inline]
 slab_post_alloc_hook+0x53/0x380 mm/slab.h:519
 slab_alloc_node mm/slub.c:3220 [inline]
 slab_alloc mm/slub.c:3228 [inline]
 kmem_cache_alloc+0xf3/0x280 mm/slub.c:3233
 getname_flags+0xb8/0x4e0 fs/namei.c:138
 user_path_at_empty+0x2a/0x180 fs/namei.c:2852
 user_path_at include/linux/namei.h:57 [inline]
 vfs_statx+0x106/0x3b0 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+0x3d/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x61/0xcb

Memory state around the buggy address:
 ffff88803684fe80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff88803684ff00: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc
>ffff88803684ff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
                                                          ^
 ffff888036850000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff888036850080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/04/13 10:24 linux-5.15.y d86dfc4d95cd 82d5e53e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Read in ni_find_attr
* Struck through repros no longer work on HEAD.