linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* KMSAN: uninit-value in p9_client_rpc
@ 2018-07-10 18:41 syzbot
  2018-07-12  9:24 ` syzbot
  0 siblings, 1 reply; 3+ messages in thread
From: syzbot @ 2018-07-10 18:41 UTC (permalink / raw)
  To: davem, ericvh, linux-kernel, lucho, netdev, rminnich,
	syzkaller-bugs, v9fs-developer

Hello,

syzbot found the following crash on:

HEAD commit:    b64f7ec04e12 kmsan: implement kmsan_memmove_shadow() and k..
git tree:       https://github.com/google/kmsan.git/master
console output: https://syzkaller.appspot.com/x/log.txt?x=127179b2400000
kernel config:  https://syzkaller.appspot.com/x/.config?x=93d57043084eee38
dashboard link: https://syzkaller.appspot.com/bug?extid=4de40388f584432bf004
compiler:       clang version 7.0.0 (trunk 334104)

Unfortunately, I don't have any reproducer for this crash yet.

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+4de40388f584432bf004@syzkaller.appspotmail.com

==================================================================
BUG: KMSAN: uninit-value in p9_client_rpc+0x194c/0x1dc0 net/9p/client.c:818
CPU: 0 PID: 14601 Comm: syz-executor4 Not tainted 4.18.0-rc4+ #24
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+0x185/0x1e0 lib/dump_stack.c:113
  kmsan_report+0x195/0x2c0 mm/kmsan/kmsan.c:1092
  __msan_warning_32+0x7d/0xe0 mm/kmsan/kmsan_instr.c:640
  p9_client_rpc+0x194c/0x1dc0 net/9p/client.c:818
  p9_client_attach+0x35b/0xc30 net/9p/client.c:1147
  v9fs_session_init+0x24b9/0x2970 fs/9p/v9fs.c:449
  v9fs_mount+0x107/0x11b0 fs/9p/vfs_super.c:135
  mount_fs+0x29b/0x780 fs/super.c:1277
  vfs_kern_mount+0x222/0x990 fs/namespace.c:1037
  do_new_mount fs/namespace.c:2518 [inline]
  do_mount+0xd30/0x5310 fs/namespace.c:2848
  ksys_mount+0x32e/0x3d0 fs/namespace.c:3064
  __do_sys_mount fs/namespace.c:3078 [inline]
  __se_sys_mount fs/namespace.c:3075 [inline]
  __x64_sys_mount+0x157/0x1c0 fs/namespace.c:3075
  do_syscall_64+0x15b/0x230 arch/x86/entry/common.c:290
  entry_SYSCALL_64_after_hwframe+0x63/0xe7
RIP: 0033:0x455e29
Code: 1d ba fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 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 eb b9 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007f2b81f7fc68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007f2b81f806d4 RCX: 0000000000455e29
RDX: 0000000020000080 RSI: 0000000020000000 RDI: 0000000000000000
RBP: 000000000072bea0 R08: 0000000020000380 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff
R13: 00000000004c05ca R14: 00000000004d0070 R15: 0000000000000000

Local variable description: ----ecode.i@p9_client_rpc
Variable was created at:
  p9_client_rpc+0x183/0x1dc0 net/9p/client.c:750
  p9_client_attach+0x35b/0xc30 net/9p/client.c:1147
==================================================================


---
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@googlegroups.com.

syzbot will keep track of this bug report. See:
https://goo.gl/tpsmEJ#bug-status-tracking for how to communicate with  
syzbot.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: KMSAN: uninit-value in p9_client_rpc
  2018-07-10 18:41 KMSAN: uninit-value in p9_client_rpc syzbot
@ 2018-07-12  9:24 ` syzbot
  2018-07-12 13:36   ` Alexander Potapenko
  0 siblings, 1 reply; 3+ messages in thread
From: syzbot @ 2018-07-12  9:24 UTC (permalink / raw)
  To: davem, ericvh, linux-kernel, lucho, netdev, rminnich,
	syzkaller-bugs, v9fs-developer

syzbot has found a reproducer for the following crash on:

HEAD commit:    b64f7ec04e12 kmsan: implement kmsan_memmove_shadow() and k..
git tree:       https://github.com/google/kmsan.git/master
console output: https://syzkaller.appspot.com/x/log.txt?x=12f6791c400000
kernel config:  https://syzkaller.appspot.com/x/.config?x=93d57043084eee38
dashboard link: https://syzkaller.appspot.com/bug?extid=4de40388f584432bf004
compiler:       clang version 7.0.0 (trunk 334104)
syzkaller repro:https://syzkaller.appspot.com/x/repro.syz?x=147c36dc400000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=14e87044400000

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+4de40388f584432bf004@syzkaller.appspotmail.com

FS-Cache: O-key=[10] '34323934373135343132'
FS-Cache: N-cookie c=(____ptrval____) [p=(____ptrval____) fl=2 nc=0 na=1]
FS-Cache: N-cookie d=(____ptrval____) n=(____ptrval____)
FS-Cache: N-key=[10] '34323934373135343132'
==================================================================
BUG: KMSAN: uninit-value in p9_client_rpc+0x194c/0x1dc0 net/9p/client.c:818
CPU: 1 PID: 4620 Comm: syz-executor262 Not tainted 4.18.0-rc4+ #24
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+0x185/0x1e0 lib/dump_stack.c:113
  kmsan_report+0x195/0x2c0 mm/kmsan/kmsan.c:1092
  __msan_warning_32+0x7d/0xe0 mm/kmsan/kmsan_instr.c:640
  p9_client_rpc+0x194c/0x1dc0 net/9p/client.c:818
  p9_client_attach+0x35b/0xc30 net/9p/client.c:1147
  v9fs_session_init+0x24b9/0x2970 fs/9p/v9fs.c:449
  v9fs_mount+0x107/0x11b0 fs/9p/vfs_super.c:135
  mount_fs+0x29b/0x780 fs/super.c:1277
  vfs_kern_mount+0x222/0x990 fs/namespace.c:1037
  do_new_mount fs/namespace.c:2518 [inline]
  do_mount+0xd30/0x5310 fs/namespace.c:2848
  ksys_mount+0x32e/0x3d0 fs/namespace.c:3064
  __do_sys_mount fs/namespace.c:3078 [inline]
  __se_sys_mount fs/namespace.c:3075 [inline]
  __x64_sys_mount+0x157/0x1c0 fs/namespace.c:3075
  do_syscall_64+0x15b/0x230 arch/x86/entry/common.c:290
  entry_SYSCALL_64_after_hwframe+0x63/0xe7
RIP: 0033:0x445f79
Code: e8 cc e6 ff ff 48 83 c4 18 c3 0f 1f 80 00 00 00 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 3b 0d fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007ffb83104da8 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00000000006dbc3c RCX: 0000000000445f79
RDX: 0000000020000180 RSI: 00000000200000c0 RDI: 0000000000000000
RBP: 00000000006dbc38 R08: 00000000200001c0 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000202 R12: 0030656c69662f2e
R13: 64663d736e617274 R14: 7974697275636573 R15: 0000000000000001

Local variable description: ----ecode.i@p9_client_rpc
Variable was created at:
  p9_client_rpc+0x183/0x1dc0 net/9p/client.c:750
  p9_client_attach+0x35b/0xc30 net/9p/client.c:1147
==================================================================


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: KMSAN: uninit-value in p9_client_rpc
  2018-07-12  9:24 ` syzbot
@ 2018-07-12 13:36   ` Alexander Potapenko
  0 siblings, 0 replies; 3+ messages in thread
From: Alexander Potapenko @ 2018-07-12 13:36 UTC (permalink / raw)
  To: syzbot+4de40388f584432bf004
  Cc: David Miller, ericvh, LKML, lucho, Networking, rminnich,
	syzkaller-bugs, v9fs-developer

On Thu, Jul 12, 2018 at 11:24 AM syzbot
<syzbot+4de40388f584432bf004@syzkaller.appspotmail.com> wrote:
>
> syzbot has found a reproducer for the following crash on:
>
> HEAD commit:    b64f7ec04e12 kmsan: implement kmsan_memmove_shadow() and k..
> git tree:       https://github.com/google/kmsan.git/master
> console output: https://syzkaller.appspot.com/x/log.txt?x=12f6791c400000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=93d57043084eee38
> dashboard link: https://syzkaller.appspot.com/bug?extid=4de40388f584432bf004
> compiler:       clang version 7.0.0 (trunk 334104)
> syzkaller repro:https://syzkaller.appspot.com/x/repro.syz?x=147c36dc400000
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=14e87044400000
>
> IMPORTANT: if you fix the bug, please add the following tag to the commit:
> Reported-by: syzbot+4de40388f584432bf004@syzkaller.appspotmail.com
>
> FS-Cache: O-key=[10] '34323934373135343132'
> FS-Cache: N-cookie c=(____ptrval____) [p=(____ptrval____) fl=2 nc=0 na=1]
> FS-Cache: N-cookie d=(____ptrval____) n=(____ptrval____)
> FS-Cache: N-key=[10] '34323934373135343132'
> ==================================================================
> BUG: KMSAN: uninit-value in p9_client_rpc+0x194c/0x1dc0 net/9p/client.c:818
> CPU: 1 PID: 4620 Comm: syz-executor262 Not tainted 4.18.0-rc4+ #24
> 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+0x185/0x1e0 lib/dump_stack.c:113
>   kmsan_report+0x195/0x2c0 mm/kmsan/kmsan.c:1092
>   __msan_warning_32+0x7d/0xe0 mm/kmsan/kmsan_instr.c:640
>   p9_client_rpc+0x194c/0x1dc0 net/9p/client.c:818
>   p9_client_attach+0x35b/0xc30 net/9p/client.c:1147
>   v9fs_session_init+0x24b9/0x2970 fs/9p/v9fs.c:449
>   v9fs_mount+0x107/0x11b0 fs/9p/vfs_super.c:135
>   mount_fs+0x29b/0x780 fs/super.c:1277
>   vfs_kern_mount+0x222/0x990 fs/namespace.c:1037
>   do_new_mount fs/namespace.c:2518 [inline]
>   do_mount+0xd30/0x5310 fs/namespace.c:2848
>   ksys_mount+0x32e/0x3d0 fs/namespace.c:3064
>   __do_sys_mount fs/namespace.c:3078 [inline]
>   __se_sys_mount fs/namespace.c:3075 [inline]
>   __x64_sys_mount+0x157/0x1c0 fs/namespace.c:3075
>   do_syscall_64+0x15b/0x230 arch/x86/entry/common.c:290
>   entry_SYSCALL_64_after_hwframe+0x63/0xe7
> RIP: 0033:0x445f79
> Code: e8 cc e6 ff ff 48 83 c4 18 c3 0f 1f 80 00 00 00 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 3b 0d fc ff c3 66 2e 0f 1f 84 00 00 00 00
> RSP: 002b:00007ffb83104da8 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5
> RAX: ffffffffffffffda RBX: 00000000006dbc3c RCX: 0000000000445f79
> RDX: 0000000020000180 RSI: 00000000200000c0 RDI: 0000000000000000
> RBP: 00000000006dbc38 R08: 00000000200001c0 R09: 0000000000000000
> R10: 0000000000000000 R11: 0000000000000202 R12: 0030656c69662f2e
> R13: 64663d736e617274 R14: 7974697275636573 R15: 0000000000000001
>
> Local variable description: ----ecode.i@p9_client_rpc
> Variable was created at:
>   p9_client_rpc+0x183/0x1dc0 net/9p/client.c:750
>   p9_client_attach+0x35b/0xc30 net/9p/client.c:1147
> ==================================================================
FWIW the bug occurs here:
https://elixir.bootlin.com/linux/latest/source/net/9p/client.c#L560

  } else {
    err = p9pdu_readf(req->rc, c->proto_version, "d", &ecode);
    err = -ecode;

    p9_debug(P9_DEBUG_9P, "<<< RLERROR (%d)\n", -ecode);
  }

When p9pdu_readf() fails with -EFAULT, |ecode| may remain uninitialized.
We need to check the value of |err| before assigning |-ecode| to it.

> --
> You received this message because you are subscribed to the Google Groups "syzkaller-bugs" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to syzkaller-bugs+unsubscribe@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/syzkaller-bugs/00000000000077da4b0570c9eccc%40google.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
Alexander Potapenko
Software Engineer

Google Germany GmbH
Erika-Mann-Straße, 33
80636 München

Geschäftsführer: Paul Manicle, Halimah DeLaine Prado
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-07-12 13:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-10 18:41 KMSAN: uninit-value in p9_client_rpc syzbot
2018-07-12  9:24 ` syzbot
2018-07-12 13:36   ` Alexander Potapenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).