KMSAN: uninit-value in path_openat

From: syzbot
Date: Sun Jul 12 2020 - 04:44:29 EST


Hello,

syzbot found the following crash on:

HEAD commit: f0d5ec90 kmsan: apply __no_sanitize_memory to dotraplinkag..
git tree: https://github.com/google/kmsan.git master
console output: https://syzkaller.appspot.com/x/log.txt?x=159636b7100000
kernel config: https://syzkaller.appspot.com/x/.config?x=86e4f8af239686c6
dashboard link: https://syzkaller.appspot.com/bug?extid=4191a44ad556eacc1a7a
compiler: clang version 10.0.0 (https://github.com/llvm/llvm-project/ c2443155a0fb245c8f17f2c1c72b6ea391e86e81)
userspace arch: i386
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1073c0bd100000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=13974b2f100000

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+4191a44ad556eacc1a7a@xxxxxxxxxxxxxxxxxxxxxxxxx

=====================================================
BUG: KMSAN: uninit-value in may_create_in_sticky fs/namei.c:1060 [inline]
BUG: KMSAN: uninit-value in do_open fs/namei.c:3207 [inline]
BUG: KMSAN: uninit-value in path_openat+0x48be/0x5d50 fs/namei.c:3346
CPU: 1 PID: 8815 Comm: syz-executor333 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
may_create_in_sticky fs/namei.c:1060 [inline]
do_open fs/namei.c:3207 [inline]
path_openat+0x48be/0x5d50 fs/namei.c:3346
do_file_open_root+0x469/0xb40 fs/namei.c:3401
file_open_root+0x6f1/0x760 fs/open.c:1128
do_handle_open+0xa11/0xe30 fs/fhandle.c:232
__do_compat_sys_open_by_handle_at fs/fhandle.c:277 [inline]
__se_compat_sys_open_by_handle_at+0x8e/0xa0 fs/fhandle.c:274
__ia32_compat_sys_open_by_handle_at+0x4a/0x70 fs/fhandle.c:274
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:0xf7f3bdd9
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:00000000ff8507fc EFLAGS: 00000207 ORIG_RAX: 0000000000000156
RAX: ffffffffffffffda RBX: 00000000ffffff9c RCX: 0000000020000200
RDX: 0000000000002f40 RSI: 0000000000000001 RDI: 00000000080bb4c8
RBP: 0000000000000012 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000

Local variable ----nd@do_file_open_root created at:
do_file_open_root+0xa4/0xb40 fs/namei.c:3385
do_file_open_root+0xa4/0xb40 fs/namei.c:3385
=====================================================


---
This bug is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@xxxxxxxxxxxxxxxxx

syzbot will keep track of this bug report. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
syzbot can test patches for this bug, for details see:
https://goo.gl/tpsmEJ#testing-patches