syzbot


KASAN: global-out-of-bounds Write in string

Status: fixed on 2018/07/24 12:55
Subsystems: reiserfs
[Documentation on labels]
Reported-by: syzbot+b890b3335a4d8c608963@syzkaller.appspotmail.com
Fix commit: fe10e398e860 reiserfs: fix buffer overflow with long warning messages
First crash: 2384d, last: 2327d
Discussions (6)
Title Replies (including bot) Last reply
[PATCH 3.16 000/366] 3.16.61-rc1 review 375 (376) 2019/01/02 17:44
[PATCH 4.17 000/101] 4.17.9-stable review 100 (101) 2018/07/22 11:42
[PATCH 4.14 00/92] 4.14.57-stable review 91 (92) 2018/07/21 13:41
[PATCH 4.9 00/66] 4.9.114-stable review 69 (69) 2018/07/21 13:40
[PATCH] reiserfs: fix buffer overflow with long warning messages 2 (2) 2018/07/16 15:25
KASAN: global-out-of-bounds Write in string 1 (3) 2018/04/17 07:24

Sample crash report:
VFS: Can't find a Minix filesystem V1 | V2 | V3 on device loop5.
==================================================================
BUG: KASAN: global-out-of-bounds in string+0x291/0x2c0 lib/vsprintf.c:608
Write of size 1 at addr ffffffff8a5405c0 by task syzkaller915239/4487

CPU: 1 PID: 4487 Comm: syzkaller915239 Not tainted 4.17.0-rc1+ #6
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x1b9/0x294 lib/dump_stack.c:113
 print_address_description+0x6c/0x20b mm/kasan/report.c:256
 kasan_report_error mm/kasan/report.c:354 [inline]
 kasan_report.cold.7+0x242/0x2fe mm/kasan/report.c:412
 __asan_report_store1_noabort+0x17/0x20 mm/kasan/report.c:435
 string+0x291/0x2c0 lib/vsprintf.c:608
 vsnprintf+0x4b7/0x1b40 lib/vsprintf.c:2292
 vsprintf+0x2a/0x40 lib/vsprintf.c:2472
 prepare_error_buf+0x23b/0x1aa0 fs/reiserfs/prints.c:240
 __reiserfs_warning+0xb0/0xd0 fs/reiserfs/prints.c:267
 reiserfs_getopt fs/reiserfs/super.c:1044 [inline]
 reiserfs_parse_options+0x11f4/0x27f0 fs/reiserfs/super.c:1194
 reiserfs_fill_super+0x520/0x3900 fs/reiserfs/super.c:1946
 mount_bdev+0x30c/0x3e0 fs/super.c:1165
 get_super_block+0x34/0x40 fs/reiserfs/super.c:2605
 mount_fs+0xae/0x328 fs/super.c:1268
 vfs_kern_mount.part.34+0xd4/0x4d0 fs/namespace.c:1037
 vfs_kern_mount fs/namespace.c:1027 [inline]
 do_new_mount fs/namespace.c:2517 [inline]
 do_mount+0x564/0x3070 fs/namespace.c:2847
 ksys_mount+0x12d/0x140 fs/namespace.c:3063
 __do_sys_mount fs/namespace.c:3077 [inline]
 __se_sys_mount fs/namespace.c:3074 [inline]
 __x64_sys_mount+0xbe/0x150 fs/namespace.c:3074
 do_syscall_64+0x1b1/0x800 arch/x86/entry/common.c:287
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x448bca
RSP: 002b:00007f33571ccc68 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 0000000020000040 RCX: 0000000000448bca
RDX: 0000000020000000 RSI: 0000000020000040 RDI: 00007f33571ccc80
RBP: 0000000000000004 R08: 0000000020000380 R09: 000000000000000a
R10: 0000000001000000 R11: 0000000000000202 R12: 0000000000000043
R13: 0000000000000044 R14: 0000000001000000 R15: 0000000000000004

The buggy address belongs to the variable:
 error_buf+0x400/0x420

Memory state around the buggy address:
 ffffffff8a540480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffffffff8a540500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffffffff8a540580: 00 00 00 00 00 00 00 00 fa fa fa fa 04 fa fa fa
                                           ^
 ffffffff8a540600: fa fa fa fa 00 fa fa fa fa fa fa fa 00 fa fa fa
 ffffffff8a540680: fa fa fa fa 00 fa fa fa fa fa fa fa 00 fa fa fa
==================================================================

Crashes (7):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/04/17 07:23 upstream a27fc14219f2 b80fd3b5 .config console log report syz C ci-upstream-kasan-gce-root
2018/04/03 15:09 upstream 642e7fd23353 676bd07e .config console log report syz ci-upstream-kasan-gce-root
2018/05/30 09:32 upstream 0044cdeb7313 2f93b54f .config console log report ci-upstream-kasan-gce-root
2018/05/20 10:52 upstream 203ec2fed17a f48c20b8 .config console log report ci-upstream-kasan-gce-root
2018/05/10 00:05 upstream 008464a9360e 12c7428a .config console log report ci-upstream-kasan-gce-root
2018/04/18 01:28 upstream a27fc14219f2 b80fd3b5 .config console log report ci-upstream-kasan-gce-root
2018/04/17 07:00 upstream a27fc14219f2 b80fd3b5 .config console log report ci-upstream-kasan-gce-root
* Struck through repros no longer work on HEAD.