syzbot


KMSAN: uninit-value in fat_evict_inode

Status: fixed on 2020/04/15 17:19
Subsystems: exfat
[Documentation on labels]
Reported-by: syzbot+9d82b8de2992579da5d0@syzkaller.appspotmail.com
Fix commit: bc87302a093f fat: fix uninit-memory access for partial initialized inode
First crash: 1583d, last: 1558d
Discussions (8)
Title Replies (including bot) Last reply
[PATCH 5.5 000/189] 5.5.9-stable review 206 (206) 2020/03/25 17:53
[PATCH 4.19 00/86] 4.19.109-stable review 103 (103) 2020/03/17 19:46
[PATCH 4.14 000/126] 4.14.173-stable review 140 (140) 2020/03/13 16:17
[PATCH 5.4 000/168] 5.4.25-stable review 177 (177) 2020/03/11 18:09
[PATCH 4.4 00/72] 4.4.216-stable review 78 (78) 2020/03/11 10:27
[PATCH 4.9 00/88] 4.9.216-stable review 96 (96) 2020/03/10 21:57
[patch 4/7] fat: fix uninit-memory access for partial initialized inode 1 (1) 2020/03/06 06:28
KMSAN: uninit-value in fat_evict_inode 1 (3) 2020/02/22 05:00

Sample crash report:
FAT-fs (loop0): error, invalid access to FAT (entry 0x00006500)
FAT-fs (loop0): Filesystem has been set read-only
=====================================================
BUG: KMSAN: uninit-value in fat_free_eofblocks fs/fat/inode.c:628 [inline]
BUG: KMSAN: uninit-value in fat_evict_inode+0x2f4/0x920 fs/fat/inode.c:658
CPU: 0 PID: 11199 Comm: syz-executor375 Not tainted 5.6.0-rc2-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:118
 __msan_warning+0x58/0xa0 mm/kmsan/kmsan_instr.c:215
 fat_free_eofblocks fs/fat/inode.c:628 [inline]
 fat_evict_inode+0x2f4/0x920 fs/fat/inode.c:658
 evict+0x4ab/0xe10 fs/inode.c:575
 iput_final fs/inode.c:1571 [inline]
 iput+0xa70/0xe10 fs/inode.c:1597
 fat_build_inode+0x6a3/0x840 fs/fat/inode.c:610
 vfat_mkdir+0x547/0x7d0 fs/fat/namei_vfat.c:871
 vfs_mkdir+0x691/0x920 fs/namei.c:3889
 do_mkdirat+0x39f/0x680 fs/namei.c:3912
 __do_sys_mkdir fs/namei.c:3928 [inline]
 __se_sys_mkdir fs/namei.c:3926 [inline]
 __ia32_sys_mkdir+0x9f/0xd0 fs/namei.c:3926
 do_syscall_32_irqs_on arch/x86/entry/common.c:339 [inline]
 do_fast_syscall_32+0x3c7/0x6e0 arch/x86/entry/common.c:410
 entry_SYSENTER_compat+0x68/0x77 arch/x86/entry/entry_64_compat.S:139
RIP: 0023:0xf7f1bd99
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:00000000ffb4ff4c EFLAGS: 00000292 ORIG_RAX: 0000000000000027
RAX: ffffffffffffffda RBX: 0000000020000740 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 00000000ffb4ffbe RDI: 0000000000000001
RBP: 00000000000000c2 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000

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:307 [inline]
 kmsan_alloc_page+0x12a/0x310 mm/kmsan/kmsan_shadow.c:336
 __alloc_pages_nodemask+0x5712/0x5e80 mm/page_alloc.c:4775
 alloc_pages_current+0x67d/0x990 mm/mempolicy.c:2211
 alloc_pages include/linux/gfp.h:534 [inline]
 alloc_slab_page+0x111/0x12f0 mm/slub.c:1530
 allocate_slab mm/slub.c:1675 [inline]
 new_slab+0x2bc/0x1130 mm/slub.c:1741
 new_slab_objects mm/slub.c:2492 [inline]
 ___slab_alloc+0x1533/0x1f30 mm/slub.c:2643
 __slab_alloc mm/slub.c:2683 [inline]
 slab_alloc_node mm/slub.c:2757 [inline]
 slab_alloc mm/slub.c:2802 [inline]
 kmem_cache_alloc+0xb23/0xd70 mm/slub.c:2807
 fat_alloc_inode+0x58/0x120 fs/fat/inode.c:748
 alloc_inode fs/inode.c:231 [inline]
 new_inode_pseudo+0xb1/0x590 fs/inode.c:927
 new_inode+0x5a/0x3d0 fs/inode.c:956
 fat_fill_super+0x634b/0x89b0 fs/fat/inode.c:1844
 vfat_fill_super+0xa6/0xc0 fs/fat/namei_vfat.c:1050
 mount_bdev+0x654/0x880 fs/super.c:1417
 vfat_mount+0xc9/0xe0 fs/fat/namei_vfat.c:1057
 legacy_get_tree+0x169/0x2e0 fs/fs_context.c:622
 vfs_get_tree+0xdd/0x580 fs/super.c:1547
 do_new_mount fs/namespace.c:2822 [inline]
 do_mount+0x365c/0x4ac0 fs/namespace.c:3107
 __do_compat_sys_mount fs/compat.c:122 [inline]
 __se_compat_sys_mount+0x3a8/0xa10 fs/compat.c:89
 __ia32_compat_sys_mount+0x157/0x1b0 fs/compat.c:89
 do_syscall_32_irqs_on arch/x86/entry/common.c:339 [inline]
 do_fast_syscall_32+0x3c7/0x6e0 arch/x86/entry/common.c:410
 entry_SYSENTER_compat+0x68/0x77 arch/x86/entry/entry_64_compat.S:139
=====================================================

Crashes (256):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/02/22 04:59 https://github.com/google/kmsan.git master 8bbbc5cf3dca 2ffa6679 .config console log report syz C ci-upstream-kmsan-gce-386
2020/03/16 13:42 https://github.com/google/kmsan.git master 8bbbc5cf3dca 749688d2 .config console log report ci-upstream-kmsan-gce-386
2020/03/16 12:23 https://github.com/google/kmsan.git master 8bbbc5cf3dca 749688d2 .config console log report ci-upstream-kmsan-gce-386
2020/03/16 05:16 https://github.com/google/kmsan.git master 8bbbc5cf3dca 749688d2 .config console log report ci-upstream-kmsan-gce-386
2020/03/16 00:33 https://github.com/google/kmsan.git master 8bbbc5cf3dca 749688d2 .config console log report ci-upstream-kmsan-gce-386
2020/03/15 23:30 https://github.com/google/kmsan.git master 8bbbc5cf3dca 749688d2 .config console log report ci-upstream-kmsan-gce-386
2020/03/15 20:23 https://github.com/google/kmsan.git master 8bbbc5cf3dca 749688d2 .config console log report ci-upstream-kmsan-gce-386
2020/03/15 19:11 https://github.com/google/kmsan.git master 8bbbc5cf3dca 749688d2 .config console log report ci-upstream-kmsan-gce-386
2020/03/15 17:48 https://github.com/google/kmsan.git master 8bbbc5cf3dca 749688d2 .config console log report ci-upstream-kmsan-gce-386
2020/03/15 16:28 https://github.com/google/kmsan.git master 8bbbc5cf3dca 749688d2 .config console log report ci-upstream-kmsan-gce-386
2020/03/15 15:13 https://github.com/google/kmsan.git master 8bbbc5cf3dca 749688d2 .config console log report ci-upstream-kmsan-gce-386
2020/03/15 12:42 https://github.com/google/kmsan.git master 8bbbc5cf3dca 749688d2 .config console log report ci-upstream-kmsan-gce-386
2020/03/15 11:39 https://github.com/google/kmsan.git master 8bbbc5cf3dca 749688d2 .config console log report ci-upstream-kmsan-gce-386
2020/03/15 10:27 https://github.com/google/kmsan.git master 8bbbc5cf3dca 749688d2 .config console log report ci-upstream-kmsan-gce-386
2020/03/15 09:24 https://github.com/google/kmsan.git master 8bbbc5cf3dca 749688d2 .config console log report ci-upstream-kmsan-gce-386
2020/03/15 06:23 https://github.com/google/kmsan.git master 8bbbc5cf3dca 749688d2 .config console log report ci-upstream-kmsan-gce-386
2020/03/15 03:45 https://github.com/google/kmsan.git master 8bbbc5cf3dca 749688d2 .config console log report ci-upstream-kmsan-gce-386
2020/03/15 02:11 https://github.com/google/kmsan.git master 8bbbc5cf3dca 749688d2 .config console log report ci-upstream-kmsan-gce-386
2020/03/15 01:00 https://github.com/google/kmsan.git master 8bbbc5cf3dca 749688d2 .config console log report ci-upstream-kmsan-gce-386
2020/03/14 22:33 https://github.com/google/kmsan.git master 8bbbc5cf3dca 749688d2 .config console log report ci-upstream-kmsan-gce-386
2020/03/14 21:43 https://github.com/google/kmsan.git master 8bbbc5cf3dca 749688d2 .config console log report ci-upstream-kmsan-gce-386
2020/03/14 17:28 https://github.com/google/kmsan.git master 8bbbc5cf3dca 749688d2 .config console log report ci-upstream-kmsan-gce-386
2020/03/14 15:38 https://github.com/google/kmsan.git master 8bbbc5cf3dca 749688d2 .config console log report ci-upstream-kmsan-gce-386
2020/03/14 14:35 https://github.com/google/kmsan.git master 8bbbc5cf3dca 749688d2 .config console log report ci-upstream-kmsan-gce-386
2020/03/14 12:36 https://github.com/google/kmsan.git master 8bbbc5cf3dca 749688d2 .config console log report ci-upstream-kmsan-gce-386
2020/03/14 09:46 https://github.com/google/kmsan.git master 8bbbc5cf3dca 749688d2 .config console log report ci-upstream-kmsan-gce-386
2020/03/13 18:56 https://github.com/google/kmsan.git master 8bbbc5cf3dca d850e9d0 .config console log report ci-upstream-kmsan-gce-386
2020/03/13 11:09 https://github.com/google/kmsan.git master 8bbbc5cf3dca d850e9d0 .config console log report ci-upstream-kmsan-gce-386
2020/03/12 16:55 https://github.com/google/kmsan.git master 8bbbc5cf3dca d850e9d0 .config console log report ci-upstream-kmsan-gce-386
2020/03/12 15:49 https://github.com/google/kmsan.git master 8bbbc5cf3dca d850e9d0 .config console log report ci-upstream-kmsan-gce-386
2020/03/12 14:09 https://github.com/google/kmsan.git master 8bbbc5cf3dca d850e9d0 .config console log report ci-upstream-kmsan-gce-386
2020/03/12 12:32 https://github.com/google/kmsan.git master 8bbbc5cf3dca d850e9d0 .config console log report ci-upstream-kmsan-gce-386
2020/03/12 09:11 https://github.com/google/kmsan.git master 8bbbc5cf3dca d850e9d0 .config console log report ci-upstream-kmsan-gce-386
2020/03/12 05:39 https://github.com/google/kmsan.git master 8bbbc5cf3dca e7caca8e .config console log report ci-upstream-kmsan-gce-386
2020/03/12 02:36 https://github.com/google/kmsan.git master 8bbbc5cf3dca e7caca8e .config console log report ci-upstream-kmsan-gce-386
2020/03/12 01:29 https://github.com/google/kmsan.git master 8bbbc5cf3dca e7caca8e .config console log report ci-upstream-kmsan-gce-386
2020/03/12 01:17 https://github.com/google/kmsan.git master 8bbbc5cf3dca e7caca8e .config console log report ci-upstream-kmsan-gce-386
2020/03/11 22:56 https://github.com/google/kmsan.git master 8bbbc5cf3dca e7caca8e .config console log report ci-upstream-kmsan-gce-386
2020/03/11 21:52 https://github.com/google/kmsan.git master 8bbbc5cf3dca e7caca8e .config console log report ci-upstream-kmsan-gce-386
2020/03/11 14:05 https://github.com/google/kmsan.git master 8bbbc5cf3dca 35f53e45 .config console log report ci-upstream-kmsan-gce-386
2020/03/11 12:34 https://github.com/google/kmsan.git master 8bbbc5cf3dca 35f53e45 .config console log report ci-upstream-kmsan-gce-386
2020/03/11 09:55 https://github.com/google/kmsan.git master 8bbbc5cf3dca 35f53e45 .config console log report ci-upstream-kmsan-gce-386
2020/03/11 05:35 https://github.com/google/kmsan.git master 8bbbc5cf3dca 35f53e45 .config console log report ci-upstream-kmsan-gce-386
2020/03/11 01:09 https://github.com/google/kmsan.git master 8bbbc5cf3dca 35f53e45 .config console log report ci-upstream-kmsan-gce-386
2020/03/10 14:53 https://github.com/google/kmsan.git master 8bbbc5cf3dca 35f53e45 .config console log report ci-upstream-kmsan-gce-386
2020/02/21 07:25 https://github.com/google/kmsan.git master 8bbbc5cf3dca bd2a74a3 .config console log report ci-upstream-kmsan-gce-386
2020/02/21 01:39 https://github.com/google/kmsan.git master 8bbbc5cf3dca bd2a74a3 .config console log report ci-upstream-kmsan-gce-386
2020/02/20 22:36 https://github.com/google/kmsan.git master 8bbbc5cf3dca bd2a74a3 .config console log report ci-upstream-kmsan-gce-386
* Struck through repros no longer work on HEAD.