From patchwork Thu Jun 7 15:38:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 10452857 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 32DCC60234 for ; Thu, 7 Jun 2018 15:39:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 24FC0298DA for ; Thu, 7 Jun 2018 15:39:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 19D63298F0; Thu, 7 Jun 2018 15:39:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.4 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,SORTED_RECIPS autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CC66E298DA for ; Thu, 7 Jun 2018 15:39:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934765AbeFGPiz (ORCPT ); Thu, 7 Jun 2018 11:38:55 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:54968 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933039AbeFGPiw (ORCPT ); Thu, 7 Jun 2018 11:38:52 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 62B3740200A0; Thu, 7 Jun 2018 15:38:51 +0000 (UTC) Received: from redhat.com (ovpn-123-113.rdu2.redhat.com [10.10.123.113]) by smtp.corp.redhat.com (Postfix) with SMTP id A5ABB2026DEF; Thu, 7 Jun 2018 15:38:48 +0000 (UTC) Date: Thu, 7 Jun 2018 18:38:48 +0300 From: "Michael S. Tsirkin" To: syzbot Cc: avagin@openvz.org, davem@davemloft.net, dingtianhong@huawei.com, edumazet@google.com, elena.reshetova@intel.com, jasowang@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, matthew@mjdsystems.ca, mingo@kernel.org, netdev@vger.kernel.org, pabeni@redhat.com, syzkaller-bugs@googlegroups.com, viro@zeniv.linux.org.uk, virtualization@lists.linux-foundation.org, willemb@google.com Subject: Re: KMSAN: uninit-value in _copy_to_iter (2) Message-ID: <20180607183627-mutt-send-email-mst@kernel.org> References: <000000000000a5b2b1056a86e98c@google.com> <000000000000cf4578056ab12452@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <000000000000cf4578056ab12452@google.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Thu, 07 Jun 2018 15:38:51 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Thu, 07 Jun 2018 15:38:51 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'mst@redhat.com' RCPT:'' Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP #syz test: https://github.com/google/kmsan.git/master d2d741e5d1898dfde1a75ea3d29a9a3e2edf0617 Subject: vhost: fix info leak Fixes: CVE-2018-1118 Signed-off-by: Michael S. Tsirkin diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index f0be5f35ab28..9beefa6ed1ce 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -2345,6 +2345,9 @@ struct vhost_msg_node *vhost_new_msg(struct vhost_virtqueue *vq, int type) struct vhost_msg_node *node = kmalloc(sizeof *node, GFP_KERNEL); if (!node) return NULL; + + /* Make sure all padding within the structure is initialized. */ + memset(&node->msg, 0, sizeof node->msg); node->vq = vq; node->msg.type = type; return node;