Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2524507imm; Thu, 7 Jun 2018 12:06:32 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLQ4KFjza0KnBEQeWyu185KS9l3R5tk7n9xa6dDqV0IMkfimFyxtbjczh7s+1iQ445g2TeL X-Received: by 2002:a17:902:b20d:: with SMTP id t13-v6mr3271749plr.121.1528398392751; Thu, 07 Jun 2018 12:06:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528398392; cv=none; d=google.com; s=arc-20160816; b=UU0kLGN/Rgy19C/pUAel8zTub0Lx44PwQGJ/u0vV5SYScqWSeoQGcXdQ9VkoVi4/kr A2KuvINNdKu3rbTSm/44CkwLZ25LaBqVN3aarhkbdTyl0RbGoK4P8dC3fQpcjGE4Sgjv SEShnhYAhQ5sH85Anwea4tP/6UjaHxWrdn8HByACRmWLJ1spKJT1ZMz7dCmT7POQqkLu pkuafxDD4Z5aNmALTkbB4sHKkNRB2eJDCqMSkH3B1WKMhUlBOiIgH9dCJNiMIlLus0IV jz750DtWGRShRkZ3vaIdw9UhMIQeTGn2EylphSwca6rzITyFISg6cIx8s3+dvTl0fNvq blJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=DLw6zWpoTN1r2dbKjEVltQmhaAAOo28wCfP+mCtDD9c=; b=HmhxqDoVbqKY7S3bU6LTzZV8MR1tAMjMzDEEd/L6qfcCkqk3HCRn2v3ra2Vldy795z 2QDbLv00COZM91uTfT7O5vYV6FM0BEFEUbiJv2MmyQHdze9F9Y+tWVNOoPxN3qw139Cz q3fHDkD2MrIHvrUcS05ooJHiq8WKIVR5xVKUiqnoxXKxzZtfHCGBvkpz9cLr/NSgANV2 YVTYceZ0ovtZK4I3X/viS65SkqpzXRQ1xf27AevG6Kgeo1QSFrdXDyCkBX7ELYj3BGEg agVaffHNbyD9w8KeTbfyqBNV8B57zYQH6ln80cZuKyX57UQYMTMO6dNW7Nk5u0GEEFZJ H/vQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p5-v6si1102915pls.53.2018.06.07.12.06.18; Thu, 07 Jun 2018 12:06:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934979AbeFGRoW (ORCPT + 99 others); Thu, 7 Jun 2018 13:44:22 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:51046 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933088AbeFGRoV (ORCPT ); Thu, 7 Jun 2018 13:44:21 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.87 #1 (Red Hat Linux)) id 1fQyx1-0001Fs-QP; Thu, 07 Jun 2018 17:43:55 +0000 Date: Thu, 7 Jun 2018 18:43:55 +0100 From: Al Viro To: "Michael S. Tsirkin" Cc: syzbot , 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, virtualization@lists.linux-foundation.org, willemb@google.com Subject: Re: KMSAN: uninit-value in _copy_to_iter (2) Message-ID: <20180607174355.GR30522@ZenIV.linux.org.uk> References: <000000000000a5b2b1056a86e98c@google.com> <000000000000cf4578056ab12452@google.com> <20180607183627-mutt-send-email-mst@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180607183627-mutt-send-email-mst@kernel.org> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 07, 2018 at 06:38:48PM +0300, Michael S. Tsirkin wrote: > #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); Umm... Maybe kzalloc(), then? You have struct vhost_msg_node { struct vhost_msg msg; struct vhost_virtqueue *vq; struct list_head node; }; and that's what, 68 bytes in msg, then either 4 bytes pointer or 4 bytes padding + 8 bytes pointer, then two pointers? How much does explicit partial memset() save you here? > node->vq = vq; > node->msg.type = type; > return node;