syzbot


KMSAN: uninit-value in get_block

Status: fixed on 2020/09/16 22:51
Subsystems: fs
[Documentation on labels]
Reported-by: syzbot+6e056ee473568865f3e6@syzkaller.appspotmail.com
Fix commit: 270ef41094e9 fs/minix: reject too-large maximum file size
First crash: 1496d, last: 1490d
Discussions (10)
Title Replies (including bot) Last reply
[PATCH 4.4 000/149] 4.4.233-rc1 review 163 (163) 2020/10/31 20:04
[PATCH 4.9 000/212] 4.9.233-rc1 review 220 (220) 2020/08/21 09:40
[PATCH 4.19 000/168] 4.19.140-rc1 review 183 (183) 2020/08/21 08:05
[PATCH 4.14 000/228] 4.14.194-rc1 review 234 (234) 2020/08/21 06:59
[PATCH 5.8 000/464] 5.8.2-rc1 review 475 (475) 2020/08/19 06:11
[PATCH 5.4 000/270] 5.4.59-rc1 review 275 (275) 2020/08/18 22:37
[PATCH 5.7 000/393] 5.7.16-rc1 review 398 (398) 2020/08/18 22:36
[patch 100/165] fs/minix: reject too-large maximum file size 1 (1) 2020/08/12 01:35
[PATCH 0/6] fs/minix: fix syzbot bugs and set s_maxbytes 10 (10) 2020/07/07 20:34
KMSAN: uninit-value in get_block 0 (1) 2020/05/20 18:23

Sample crash report:
Process accounting resumed
=====================================================
BUG: KMSAN: uninit-value in get_branch fs/minix/itree_common.c:54 [inline]
BUG: KMSAN: uninit-value in get_block+0xa00/0x1f80 fs/minix/itree_common.c:160
CPU: 0 PID: 8783 Comm: syz-executor148 Not tainted 5.7.0-rc4-syzkaller #0
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+0x1c9/0x220 lib/dump_stack.c:118
 kmsan_report+0xf7/0x1e0 mm/kmsan/kmsan_report.c:121
 __msan_warning+0x58/0xa0 mm/kmsan/kmsan_instr.c:215
 get_branch fs/minix/itree_common.c:54 [inline]
 get_block+0xa00/0x1f80 fs/minix/itree_common.c:160
 V1_minix_get_block+0xb5/0xd0 fs/minix/itree_v1.c:56
 minix_get_block+0x13e/0x1f0 fs/minix/inode.c:376
 __block_write_begin_int+0xb05/0x2ad0 fs/buffer.c:2013
 __block_write_begin fs/buffer.c:2063 [inline]
 block_write_begin+0x16c/0x340 fs/buffer.c:2122
 minix_write_begin+0x119/0x3d0 fs/minix/inode.c:412
 generic_perform_write+0x3d4/0x9a0 mm/filemap.c:3302
 __generic_file_write_iter+0x44e/0xa50 mm/filemap.c:3431
 generic_file_write_iter+0x770/0xad0 mm/filemap.c:3463
 call_write_iter include/linux/fs.h:1907 [inline]
 new_sync_write fs/read_write.c:484 [inline]
 __vfs_write+0xa5a/0xca0 fs/read_write.c:497
 __kernel_write+0x205/0x600 fs/read_write.c:516
 do_acct_process+0x1b6a/0x1fb0 kernel/acct.c:522
 acct_pin_kill+0x54/0x250 kernel/acct.c:174
 pin_kill+0x1c8/0x5d0 fs/fs_pin.c:44
 acct_on kernel/acct.c:254 [inline]
 __do_sys_acct kernel/acct.c:286 [inline]
 __se_sys_acct+0xbcd/0xdd0 kernel/acct.c:273
 __ia32_sys_acct+0x32/0x50 kernel/acct.c:273
 do_syscall_32_irqs_on arch/x86/entry/common.c:339 [inline]
 do_fast_syscall_32+0x3bf/0x6d0 arch/x86/entry/common.c:398
 entry_SYSENTER_compat+0x68/0x77 arch/x86/entry/entry_64_compat.S:139
RIP: 0023:0xf7fb7dd9
Code: 90 e8 0b 00 00 00 f3 90 0f ae e8 eb f9 8d 74 26 00 89 3c 24 c3 90 90 90 90 90 90 90 90 90 90 90 90 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 eb 0d 90 90 90 90 90 90 90 90 90 90 90 90
RSP: 002b:00000000f7f9112c EFLAGS: 00000292 ORIG_RAX: 0000000000000033
RAX: ffffffffffffffda RBX: 0000000020000480 RCX: 0000000000000081
RDX: 00000000000f4240 RSI: 0000000000000000 RDI: 00000000080fbff0
RBP: 00000000080fbffc R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000

Uninit was stored to memory at:
 kmsan_save_stack_with_flags mm/kmsan/kmsan.c:144 [inline]
 kmsan_internal_chain_origin+0xad/0x130 mm/kmsan/kmsan.c:310
 __msan_chain_origin+0x50/0x90 mm/kmsan/kmsan_instr.c:165
 add_chain fs/minix/itree_common.c:14 [inline]
 get_branch fs/minix/itree_common.c:52 [inline]
 get_block+0xa4d/0x1f80 fs/minix/itree_common.c:160
 V1_minix_get_block+0xb5/0xd0 fs/minix/itree_v1.c:56
 minix_get_block+0x13e/0x1f0 fs/minix/inode.c:376
 __block_write_begin_int+0xb05/0x2ad0 fs/buffer.c:2013
 __block_write_begin fs/buffer.c:2063 [inline]
 block_write_begin+0x16c/0x340 fs/buffer.c:2122
 minix_write_begin+0x119/0x3d0 fs/minix/inode.c:412
 generic_perform_write+0x3d4/0x9a0 mm/filemap.c:3302
 __generic_file_write_iter+0x44e/0xa50 mm/filemap.c:3431
 generic_file_write_iter+0x770/0xad0 mm/filemap.c:3463
 call_write_iter include/linux/fs.h:1907 [inline]
 new_sync_write fs/read_write.c:484 [inline]
 __vfs_write+0xa5a/0xca0 fs/read_write.c:497
 __kernel_write+0x205/0x600 fs/read_write.c:516
 do_acct_process+0x1b6a/0x1fb0 kernel/acct.c:522
 acct_pin_kill+0x54/0x250 kernel/acct.c:174
 pin_kill+0x1c8/0x5d0 fs/fs_pin.c:44
 acct_on kernel/acct.c:254 [inline]
 __do_sys_acct kernel/acct.c:286 [inline]
 __se_sys_acct+0xbcd/0xdd0 kernel/acct.c:273
 __ia32_sys_acct+0x32/0x50 kernel/acct.c:273
 do_syscall_32_irqs_on arch/x86/entry/common.c:339 [inline]
 do_fast_syscall_32+0x3bf/0x6d0 arch/x86/entry/common.c:398
 entry_SYSENTER_compat+0x68/0x77 arch/x86/entry/entry_64_compat.S:139

Uninit was created at:
 kmsan_save_stack_with_flags+0x3c/0x90 mm/kmsan/kmsan.c:144
 kmsan_internal_alloc_meta_for_pages mm/kmsan/kmsan_shadow.c:269 [inline]
 kmsan_alloc_page+0xb9/0x180 mm/kmsan/kmsan_shadow.c:293
 __alloc_pages_nodemask+0x56a2/0x5dc0 mm/page_alloc.c:4848
 alloc_pages_current+0x67d/0x990 mm/mempolicy.c:2295
 alloc_pages include/linux/gfp.h:540 [inline]
 __page_cache_alloc+0x95/0x310 mm/filemap.c:959
 pagecache_get_page+0xab7/0x1250 mm/filemap.c:1645
 find_or_create_page include/linux/pagemap.h:308 [inline]
 grow_dev_page fs/buffer.c:983 [inline]
 grow_buffers fs/buffer.c:1052 [inline]
 __getblk_slow fs/buffer.c:1079 [inline]
 __getblk_gfp+0x4bb/0xfc0 fs/buffer.c:1356
 __bread_gfp+0xb9/0x670 fs/buffer.c:1401
 sb_bread include/linux/buffer_head.h:309 [inline]
 get_branch fs/minix/itree_common.c:46 [inline]
 get_block+0x73e/0x1f80 fs/minix/itree_common.c:160
 V1_minix_get_block+0xb5/0xd0 fs/minix/itree_v1.c:56
 minix_get_block+0x13e/0x1f0 fs/minix/inode.c:376
 __block_write_begin_int+0xb05/0x2ad0 fs/buffer.c:2013
 __block_write_begin fs/buffer.c:2063 [inline]
 block_write_begin+0x16c/0x340 fs/buffer.c:2122
 minix_write_begin+0x119/0x3d0 fs/minix/inode.c:412
 generic_perform_write+0x3d4/0x9a0 mm/filemap.c:3302
 __generic_file_write_iter+0x44e/0xa50 mm/filemap.c:3431
 generic_file_write_iter+0x770/0xad0 mm/filemap.c:3463
 call_write_iter include/linux/fs.h:1907 [inline]
 new_sync_write fs/read_write.c:484 [inline]
 __vfs_write+0xa5a/0xca0 fs/read_write.c:497
 __kernel_write+0x205/0x600 fs/read_write.c:516
 do_acct_process+0x1b6a/0x1fb0 kernel/acct.c:522
 acct_pin_kill+0x54/0x250 kernel/acct.c:174
 pin_kill+0x1c8/0x5d0 fs/fs_pin.c:44
 acct_on kernel/acct.c:254 [inline]
 __do_sys_acct kernel/acct.c:286 [inline]
 __se_sys_acct+0xbcd/0xdd0 kernel/acct.c:273
 __ia32_sys_acct+0x32/0x50 kernel/acct.c:273
 do_syscall_32_irqs_on arch/x86/entry/common.c:339 [inline]
 do_fast_syscall_32+0x3bf/0x6d0 arch/x86/entry/common.c:398
 entry_SYSENTER_compat+0x68/0x77 arch/x86/entry/entry_64_compat.S:139
=====================================================

Crashes (13):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/05/19 07:42 https://github.com/google/kmsan.git master 8b97c6271626 684d3606 .config console log report syz C ci-upstream-kmsan-gce-386
2020/05/24 00:06 https://github.com/google/kmsan.git master 8b97c6271626 9682898d .config console log report ci-upstream-kmsan-gce-386
2020/05/23 20:17 https://github.com/google/kmsan.git master 8b97c6271626 9682898d .config console log report ci-upstream-kmsan-gce-386
2020/05/23 08:33 https://github.com/google/kmsan.git master 8b97c6271626 9682898d .config console log report ci-upstream-kmsan-gce-386
2020/05/22 04:35 https://github.com/google/kmsan.git master 8b97c6271626 5afa2ddd .config console log report ci-upstream-kmsan-gce-386
2020/05/21 15:17 https://github.com/google/kmsan.git master 8b97c6271626 1f30020f .config console log report ci-upstream-kmsan-gce-386
2020/05/18 22:24 https://github.com/google/kmsan.git master 8b97c6271626 684d3606 .config console log report ci-upstream-kmsan-gce-386
2020/05/18 22:00 https://github.com/google/kmsan.git master 8b97c6271626 684d3606 .config console log report ci-upstream-kmsan-gce-386
2020/05/18 20:30 https://github.com/google/kmsan.git master 8b97c6271626 684d3606 .config console log report ci-upstream-kmsan-gce-386
2020/05/18 20:19 https://github.com/google/kmsan.git master 8b97c6271626 684d3606 .config console log report ci-upstream-kmsan-gce-386
2020/05/18 20:19 https://github.com/google/kmsan.git master 8b97c6271626 684d3606 .config console log report ci-upstream-kmsan-gce-386
2020/05/17 19:44 https://github.com/google/kmsan.git master 8b97c6271626 37bccd4e .config console log report ci-upstream-kmsan-gce-386
2020/05/17 10:05 https://github.com/google/kmsan.git master 8b97c6271626 37bccd4e .config console log report ci-upstream-kmsan-gce-386
* Struck through repros no longer work on HEAD.