Re: KMSAN: uninit-value in simple_attr_read

From: Alexander Potapenko
Date: Thu Feb 27 2020 - 06:57:32 EST


On Thu, Feb 27, 2020 at 10:29 AM syzbot
<syzbot+fcab69d1ada3e8d6f06b@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
>
> Hello,
>
> syzbot found the following crash on:
>
> HEAD commit: 8bbbc5cf kmsan: don't compile memmove
> git tree: https://github.com/google/kmsan.git master
> console output: https://syzkaller.appspot.com/x/log.txt?x=14394265e00000
> kernel config: https://syzkaller.appspot.com/x/.config?x=cd0e9a6b0e555cc3
> dashboard link: https://syzkaller.appspot.com/bug?extid=fcab69d1ada3e8d6f06b
> compiler: clang version 10.0.0 (https://github.com/llvm/llvm-project/ c2443155a0fb245c8f17f2c1c72b6ea391e86e81)
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1338127ee00000
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=161403ede00000
>
> IMPORTANT: if you fix the bug, please add the following tag to the commit:
> Reported-by: syzbot+fcab69d1ada3e8d6f06b@xxxxxxxxxxxxxxxxxxxxxxxxx

This report says it's uninit in strlen, but there's actually an
information leak later on that lets the user read arbitrary data past
the non-terminated attr->get_buf.