syzbot


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

Status: upstream: reported on 2023/02/19 09:04
Reported-by: syzbot+c38cd2b599cca861b761@syzkaller.appspotmail.com
First crash: 425d, last: 425d

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:247 [inline]
BUG: KASAN: stack-out-of-bounds in gfs2_iomap_get+0x1273/0x1520 fs/gfs2/bmap.c:908
Write of size 2 at addr ffff88822324f5c6 by task syz-executor.2/8043

CPU: 1 PID: 8043 Comm: syz-executor.2 Not tainted 4.19.211-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/21/2023
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x1fc/0x2ef lib/dump_stack.c:118
 print_address_description.cold+0x54/0x219 mm/kasan/report.c:256
 kasan_report_error.cold+0x8a/0x1b9 mm/kasan/report.c:354
 kasan_report mm/kasan/report.c:412 [inline]
 __asan_report_store2_noabort+0x88/0x90 mm/kasan/report.c:436
 find_metapath fs/gfs2/bmap.c:247 [inline]
 gfs2_iomap_get+0x1273/0x1520 fs/gfs2/bmap.c:908
 gfs2_block_map+0x577/0xc60 fs/gfs2/bmap.c:1238
 gfs2_write_alloc_required+0x35f/0x460 fs/gfs2/bmap.c:2369
 gfs2_jdesc_check+0x18f/0x250 fs/gfs2/super.c:367
 init_journal fs/gfs2/ops_fstype.c:708 [inline]
 init_inodes+0x13da/0x1cf0 fs/gfs2/ops_fstype.c:783
 fill_super+0x18a6/0x2550 fs/gfs2/ops_fstype.c:1153
 gfs2_mount+0x4c0/0x5a0 fs/gfs2/ops_fstype.c:1316
 mount_fs+0xa3/0x310 fs/super.c:1261
 vfs_kern_mount.part.0+0x68/0x470 fs/namespace.c:961
 vfs_kern_mount fs/namespace.c:951 [inline]
 do_new_mount fs/namespace.c:2492 [inline]
 do_mount+0x115c/0x2f50 fs/namespace.c:2822
 ksys_mount+0xcf/0x130 fs/namespace.c:3038
 __do_sys_mount fs/namespace.c:3052 [inline]
 __se_sys_mount fs/namespace.c:3049 [inline]
 __x64_sys_mount+0xba/0x150 fs/namespace.c:3049
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7f6db582e62a
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:00007f6db3d9ef88 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 000000000001343f RCX: 00007f6db582e62a
RDX: 0000000020000100 RSI: 0000000020013440 RDI: 00007f6db3d9efe0
RBP: 00007f6db3d9f020 R08: 00007f6db3d9f020 R09: 0000000000000081
R10: 0000000000000081 R11: 0000000000000202 R12: 0000000020000100
R13: 0000000020013440 R14: 00007f6db3d9efe0 R15: 0000000020000140

The buggy address belongs to the page:
page:ffffea00088c93c0 count:0 mapcount:0 mapping:0000000000000000 index:0x0
flags: 0x57ff00000000000()
raw: 057ff00000000000 0000000000000000 ffffffff00000101 0000000000000000
raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88822324f480: 00 00 00 00 00 f1 f1 f1 f1 00 00 00 00 00 00 00
 ffff88822324f500: 00 00 f2 f2 f2 f2 f2 00 00 00 00 00 00 00 00 00
>ffff88822324f580: 00 00 00 00 00 f3 f3 f3 f3 00 00 00 00 00 00 00
                                           ^
 ffff88822324f600: 00 00 00 00 00 00 00 f1 f1 f1 f1 f1 f1 00 00 00
 ffff88822324f680: 00 00 00 00 00 00 00 00 00 00 f3 f3 f3 f3 f3 00
==================================================================
sysfs: cannot create duplicate filename '/fs/gfs2/syz:syz'
CPU: 1 PID: 8052 Comm: syz-executor.3 Tainted: G    B             4.19.211-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/21/2023
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x1fc/0x2ef lib/dump_stack.c:118
 sysfs_warn_dup.cold+0x1c/0x29 fs/sysfs/dir.c:30
 sysfs_create_dir_ns+0x228/0x280 fs/sysfs/dir.c:63
 create_dir lib/kobject.c:88 [inline]
 kobject_add_internal+0x2a5/0x9c0 lib/kobject.c:247
 kobject_add_varg lib/kobject.c:382 [inline]
 kobject_init_and_add+0x101/0x160 lib/kobject.c:453
 gfs2_sys_fs_add+0x18e/0x440 fs/gfs2/sys.c:659
 fill_super+0x1240/0x2550 fs/gfs2/ops_fstype.c:1103
 gfs2_mount+0x4c0/0x5a0 fs/gfs2/ops_fstype.c:1316
 mount_fs+0xa3/0x310 fs/super.c:1261
 vfs_kern_mount.part.0+0x68/0x470 fs/namespace.c:961
 vfs_kern_mount fs/namespace.c:951 [inline]
 do_new_mount fs/namespace.c:2492 [inline]
 do_mount+0x115c/0x2f50 fs/namespace.c:2822
 ksys_mount+0xcf/0x130 fs/namespace.c:3038
 __do_sys_mount fs/namespace.c:3052 [inline]
 __se_sys_mount fs/namespace.c:3049 [inline]
 __x64_sys_mount+0xba/0x150 fs/namespace.c:3049
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7fc8bda5b62a
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:00007fc8bbfcbf88 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 000000000001343f RCX: 00007fc8bda5b62a
RDX: 0000000020000100 RSI: 0000000020013440 RDI: 00007fc8bbfcbfe0
RBP: 00007fc8bbfcc020 R08: 00007fc8bbfcc020 R09: 0000000000000081
R10: 0000000000000081 R11: 0000000000000202 R12: 0000000020000100
R13: 0000000020013440 R14: 00007fc8bbfcbfe0 R15: 0000000020000140
kobject_add_internal failed for syz:syz with -EEXIST, don't try to register things with the same name in the same directory.
gfs2: fsid=syz:syz: error -17 adding sysfs files
sysfs: cannot create duplicate filename '/fs/gfs2/syz:syz'

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/02/19 09:04 linux-4.19.y 3f8a27f9e27b bcdf85f8 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: stack-out-of-bounds Write in gfs2_iomap_get
* Struck through repros no longer work on HEAD.