syzbot


KMSAN: uninit-value in simple_attr_read

Status: fixed on 2020/05/10 10:42
Subsystems: fs
[Documentation on labels]
Reported-by: syzbot+fcab69d1ada3e8d6f06b@syzkaller.appspotmail.com
Fix commit: a65cab7d7f05 libfs: fix infoleak in simple_attr_read()
First crash: 1517d, last: 1443d
Discussions (9)
Title Replies (including bot) Last reply
[PATCH 4.9 000/102] 4.9.218-rc1 review 112 (112) 2020/04/07 06:05
[PATCH 5.6 00/23] 5.6.1-rc1 review 47 (47) 2020/04/04 08:41
[PATCH 4.14 000/148] 4.14.175-rc1 review 153 (153) 2020/04/02 22:47
[PATCH 4.19 000/116] 4.19.114-rc1 review 129 (129) 2020/04/02 20:04
[PATCH 5.5 000/170] 5.5.14-rc1 review 180 (180) 2020/04/02 17:40
[PATCH 4.4 00/91] 4.4.218-rc1 review 97 (97) 2020/04/02 14:13
[PATCH 5.4 000/155] 5.4.29-rc1 review 156 (156) 2020/03/31 08:59
[PATCH] libfs: fix infoleak in simple_attr_read() 6 (6) 2020/03/24 12:13
KMSAN: uninit-value in simple_attr_read 2 (3) 2020/03/04 14:36

Sample crash report:
=====================================================
BUG: KMSAN: uninit-value in strlen+0x5e/0xa0 lib/string.c:552
CPU: 1 PID: 11402 Comm: syz-executor230 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
 strlen+0x5e/0xa0 lib/string.c:552
 simple_attr_read+0x1ec/0x740 fs/libfs.c:935
 debugfs_attr_read+0x13e/0x290 fs/debugfs/file.c:360
 __vfs_read+0x1a9/0xc80 fs/read_write.c:425
 vfs_read+0x346/0x6a0 fs/read_write.c:461
 ksys_read+0x267/0x450 fs/read_write.c:587
 __do_sys_read fs/read_write.c:597 [inline]
 __se_sys_read+0x92/0xb0 fs/read_write.c:595
 __x64_sys_read+0x4a/0x70 fs/read_write.c:595
 do_syscall_64+0xb8/0x160 arch/x86/entry/common.c:296
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x440269
Code: 18 89 d0 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 fb 13 fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007fff09d3bc68 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
RAX: ffffffffffffffda RBX: 00000000004002c8 RCX: 0000000000440269
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000004
RBP: 00000000006ca018 R08: 000000000000000a R09: 000000000000000a
R10: 0000000000010001 R11: 0000000000000246 R12: 0000000000401af0
R13: 0000000000401b80 R14: 0000000000000000 R15: 0000000000000000

Uninit was created at:
 kmsan_save_stack_with_flags mm/kmsan/kmsan.c:144 [inline]
 kmsan_internal_poison_shadow+0x66/0xd0 mm/kmsan/kmsan.c:127
 kmsan_slab_alloc+0x8a/0xe0 mm/kmsan/kmsan_hooks.c:82
 slab_alloc_node mm/slub.c:2793 [inline]
 slab_alloc mm/slub.c:2802 [inline]
 kmem_cache_alloc_trace+0x6f3/0xd70 mm/slub.c:2819
 kmalloc include/linux/slab.h:555 [inline]
 simple_attr_open+0xd4/0x400 fs/libfs.c:894
 lowpan_enable_fops_open+0x94/0xb0 net/bluetooth/6lowpan.c:1105
 open_proxy_open+0x657/0x800 fs/debugfs/file.c:189
 do_dentry_open+0xf89/0x1820 fs/open.c:797
 vfs_open+0xaf/0xe0 fs/open.c:914
 do_last fs/namei.c:3490 [inline]
 path_openat+0x4d57/0x6bd0 fs/namei.c:3607
 do_filp_open+0x2b8/0x710 fs/namei.c:3637
 do_sys_openat2+0x92e/0xd40 fs/open.c:1149
 do_sys_open fs/open.c:1165 [inline]
 __do_sys_openat fs/open.c:1179 [inline]
 __se_sys_openat+0x24a/0x2b0 fs/open.c:1174
 __x64_sys_openat+0x56/0x70 fs/open.c:1174
 do_syscall_64+0xb8/0x160 arch/x86/entry/common.c:296
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
=====================================================

Crashes (6):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/02/23 01:26 https://github.com/google/kmsan.git master 8bbbc5cf3dca 2c36e7a7 .config console log report syz C ci-upstream-kmsan-gce
2020/02/26 10:37 https://github.com/google/kmsan.git master 8bbbc5cf3dca 59b57593 .config console log report syz C ci-upstream-kmsan-gce-386
2020/05/07 08:50 https://github.com/google/kmsan.git master 21c44613a2fe 4618eb2d .config console log report ci-upstream-kmsan-gce
2020/05/04 09:21 https://github.com/google/kmsan.git master bfa90a4a3f3f 58ae5e18 .config console log report ci-upstream-kmsan-gce
2020/04/16 12:34 https://github.com/google/kmsan.git master 5356842da2b5 c743fcb3 .config console log report ci-upstream-kmsan-gce
2020/02/23 00:00 https://github.com/google/kmsan.git master 8bbbc5cf3dca 2c36e7a7 .config console log report ci-upstream-kmsan-gce
* Struck through repros no longer work on HEAD.