Received: by 10.192.165.148 with SMTP id m20csp1097319imm; Fri, 27 Apr 2018 12:38:16 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp0rSKXDewqF9aVhTRoDNzBCjhnDK4IzYgz6X2Q+jYj8zS1hLmGKV/8j9/jvfL1pUPZ30r/ X-Received: by 2002:a17:902:7d86:: with SMTP id a6-v6mr3492969plm.264.1524857896721; Fri, 27 Apr 2018 12:38:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524857896; cv=none; d=google.com; s=arc-20160816; b=Es6QaZ4B0xStimK0cKOJchw0ARPVBMiHc3nisVDp62pgSZgjJcX7Ky5NDd5sKVhlSA 7JKBBmMY8UgHJtexuQOvnLp16nxXIxbwGmtm8So8S5ehhKWuzGI7y2Cw0X4l/kyW+MzI MqPyjuX/hwGraIIz89EqgHoRw4oPBPxnRtmDa5ryl6oiBKEFtBae3XtY63hOGS6sLcjl koHVwYb/d4d8HZZBO3IzTm6iLDoJioPjayjmb0voj56g2q9mZuwEBtObZTq4QvysF4nU GC2fiwdZl7ginv855MzpSUgiCf7J4Zmf5uokisfKXkKR8U4E82r9yU86mRglHU23OkZV rZZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=c0fNvGvWzybVY4YFMK1utCKBgCAI40/fmutVf/QBcVo=; b=qisVSao1MAEIqfjnV+m9sBRvNxeiJx7lSoRBbbJ4xofTkdV9ZJ03jUI1iR1rk9GaKv cLLOkXBIcoSM2Qqas88l4j4k21dr93T+xL0A/JN1+b8IEsoocRmihXBK0MLwnXePCt6x /0t/tCz+yJ9/S5lV4/y3XSU1ZV3EjPB6uW++99Ta8otg9ydBttk50VdwjUr74Yu9czDs Nl19d91jVyMDHyWmQVfi20mGcKguALV1gDei6WUX9cBDNUEKGdrnBdw/89pPE8GSNA3o b6Jj4OdcZBfzGHAosP06H8PcKt7HZ2Ly8jgEu7/oTtLyCe+JMNeyADUdTc6kwQ6yVg9a fYEQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g14-v6si1781977plj.146.2018.04.27.12.38.02; Fri, 27 Apr 2018 12:38:16 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758884AbeD0Tgw (ORCPT + 99 others); Fri, 27 Apr 2018 15:36:52 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:44926 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1757590AbeD0Tgv (ORCPT ); Fri, 27 Apr 2018 15:36:51 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A7CE6401F9AF; Fri, 27 Apr 2018 19:36:50 +0000 (UTC) Received: from redhat.com (ovpn-124-199.rdu2.redhat.com [10.10.124.199]) by smtp.corp.redhat.com (Postfix) with SMTP id E280B215CDCB; Fri, 27 Apr 2018 19:36:49 +0000 (UTC) Date: Fri, 27 Apr 2018 22:36:49 +0300 From: "Michael S. Tsirkin" To: Dmitry Vyukov Cc: Kevin Easton , Jason Wang , KVM list , virtualization@lists.linux-foundation.org, netdev , LKML , syzkaller-bugs Subject: Re: [PATCH net] vhost: Use kzalloc() to allocate vhost_msg_node Message-ID: <20180427223636-mutt-send-email-mst@kernel.org> References: <000000000000a5b2b1056a86e98c@google.com> <20180427154502.GA22544@la.guarana.org> <20180427185501-mutt-send-email-mst@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 27 Apr 2018 19:36:50 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 27 Apr 2018 19:36:50 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'mst@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 27, 2018 at 06:11:31PM +0200, Dmitry Vyukov wrote: > On Fri, Apr 27, 2018 at 6:05 PM, Michael S. Tsirkin wrote: > > On Fri, Apr 27, 2018 at 11:45:02AM -0400, Kevin Easton wrote: > >> The struct vhost_msg within struct vhost_msg_node is copied to userspace, > >> so it should be allocated with kzalloc() to ensure all structure padding > >> is zeroed. > >> > >> Signed-off-by: Kevin Easton > >> Reported-by: syzbot+87cfa083e727a224754b@syzkaller.appspotmail.com > > > > Does it help if a patch naming the padding is applied, > > and then we init just the relevant field? > > Just curious. > > Yes, it would help. How about a Tested-by tag then? > >> --- > >> drivers/vhost/vhost.c | 2 +- > >> 1 file changed, 1 insertion(+), 1 deletion(-) > >> > >> diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c > >> index f3bd8e9..1b84dcff 100644 > >> --- a/drivers/vhost/vhost.c > >> +++ b/drivers/vhost/vhost.c > >> @@ -2339,7 +2339,7 @@ EXPORT_SYMBOL_GPL(vhost_disable_notify); > >> /* Create a new message. */ > >> struct vhost_msg_node *vhost_new_msg(struct vhost_virtqueue *vq, int type) > >> { > >> - struct vhost_msg_node *node = kmalloc(sizeof *node, GFP_KERNEL); > >> + struct vhost_msg_node *node = kzalloc(sizeof *node, GFP_KERNEL); > >> if (!node) > >> return NULL; > >> node->vq = vq; > >> -- > >> 2.8.1 > > > > -- > > 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/20180427185501-mutt-send-email-mst%40kernel.org. > > For more options, visit https://groups.google.com/d/optout.