syzbot


KASAN: stack-out-of-bounds Write in gfs2_block_map

Status: upstream: reported C repro on 2022/12/26 03:09
Subsystems: gfs2
[Documentation on labels]
Reported-by: syzbot+8986c0959b371872ed17@syzkaller.appspotmail.com
First crash: 732d, last: 664d
Fix bisection attempts (2)
Created Duration User Patch Repo Result
2023/03/03 23:23 29m bisect fix linux-4.14.y OK (0) job log log
2023/02/01 18:24 34m bisect fix linux-4.14.y OK (0) job log log

Sample crash report:
gfs2: fsid=syz:syz: Trying to join cluster "lock_nolock", "syz:syz"
gfs2: fsid=syz:syz: Now mounting FS...
==================================================================
BUG: KASAN: stack-out-of-bounds in find_metapath fs/gfs2/bmap.c:239 [inline]
BUG: KASAN: stack-out-of-bounds in gfs2_block_map+0x240b/0x2de0 fs/gfs2/bmap.c:695
Write of size 2 at addr ffff88809ca976a0 by task syz-executor247/7967

CPU: 0 PID: 7967 Comm: syz-executor247 Not tainted 4.14.302-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x1b2/0x281 lib/dump_stack.c:58
 print_address_description.cold+0x54/0x1d3 mm/kasan/report.c:252
 kasan_report_error.cold+0x8a/0x191 mm/kasan/report.c:351
 kasan_report mm/kasan/report.c:409 [inline]
 __asan_report_store2_noabort+0x68/0x70 mm/kasan/report.c:433
 find_metapath fs/gfs2/bmap.c:239 [inline]
 gfs2_block_map+0x240b/0x2de0 fs/gfs2/bmap.c:695
 gfs2_write_alloc_required+0x2dc/0x3c0 fs/gfs2/bmap.c:1693
 gfs2_jdesc_check+0x174/0x220 fs/gfs2/super.c:367
 init_journal fs/gfs2/ops_fstype.c:732 [inline]
 init_inodes+0x110b/0x18d0 fs/gfs2/ops_fstype.c:807
 fill_super+0x1721/0x2310 fs/gfs2/ops_fstype.c:1177
 gfs2_mount+0x439/0x510 fs/gfs2/ops_fstype.c:1340
 mount_fs+0x92/0x2a0 fs/super.c:1237
 vfs_kern_mount.part.0+0x5b/0x470 fs/namespace.c:1046
 vfs_kern_mount fs/namespace.c:1036 [inline]
 do_new_mount fs/namespace.c:2572 [inline]
 do_mount+0xe65/0x2a30 fs/namespace.c:2905
 SYSC_mount fs/namespace.c:3121 [inline]
 SyS_mount+0xa8/0x120 fs/namespace.c:3098
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x5e/0xd3
RIP: 0033:0x7fdd19910ada
RSP: 002b:00007fff18650f18 EFLAGS: 00000282 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007fdd19910ada
RDX: 0000000020037f40 RSI: 0000000020037f80 RDI: 00007fff18650f20
RBP: 00007fff18650f20 R08: 00007fff18650f60 R09: 0000000000043350
R10: 0000000002000011 R11: 0000000000000282 R12: 0000000000000004
R13: 00005555559902c0 R14: 00007fff18650f60 R15: 0000000000000000

The buggy address belongs to the page:
page:ffffea000272a5c0 count:0 mapcount:0 mapping:          (null) index:0x0
flags: 0xfff00000000000()
raw: 00fff00000000000 0000000000000000 0000000000000000 00000000ffffffff
raw: 0000000000000000 0000000100000001 0000000000000000 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88809ca97580: 00 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1
 ffff88809ca97600: f1 00 00 00 f2 f2 f2 00 00 00 00 00 00 00 00 00
>ffff88809ca97680: 00 00 00 00 f3 f3 f3 f3 f3 00 00 00 00 00 00 00
                               ^
 ffff88809ca97700: 00 00 f1 f1 f1 f1 f1 f1 00 00 00 00 00 00 00 00
 ffff88809ca97780: 00 00 00 00 00 f3 f3 f3 f3 f3 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
2022/12/26 03:08 linux-4.14.y c4215ee4771b 9da18ae8 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-4-14 KASAN: stack-out-of-bounds Write in gfs2_block_map
* Struck through repros no longer work on HEAD.