Received: by 10.192.165.148 with SMTP id m20csp897553imm; Fri, 27 Apr 2018 09:13:25 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr+fdKEMatB4tg2i4Bapzu9wOKlYQM/X7KxQsY3wGA7vz68m8UnYJyk9QRGWfQSMcTa4uds X-Received: by 2002:a65:62c4:: with SMTP id m4-v6mr2585241pgv.329.1524845605288; Fri, 27 Apr 2018 09:13:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524845605; cv=none; d=google.com; s=arc-20160816; b=LbaOHEQp2jCs/BgTceSDCQp6r/+rtZHcb8uHhaTjw5sajcPbvdSWHowAtkh+fFMDjG NgbfKY34jWunIWiOdLARUneNZk6zQiI9JalASKyozbeY/poDBrDnrZ/0kT14Frf6G4fS C/NgpNt9PTcrQDXzjYtsTIBbwm8ru7oy/O4jv8wPuHe2m2yhMbzawZKU7/uoE4b66XI6 8/XSk1wsE7YgyQL3KCg2EHsn+wPHRkDx/4b/ZsbM5m7Cj3lRWcajv7FqSMBfzQ9+rzVe sVr98JPbCrqomxzm2pGZgA8xyPp1KIwY2z7UhNF4fL3dlCWfLsh5dUAT+xPMYrF9Hn9T YHyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=9UqLHFfyOA44VCFMcZXzzUQHUCixUpJG9cetpisBSFs=; b=jc6jeY7ur2U5pRFvcbg3Ii4I46/JesyDDv1lpDU4edrIYBiF4e2H7v1yXZYq0cRgLp kjyiTawKaCkI6JJorPHYlnktLXoDwuNtlGjDK/hekZ+U6xFa1OjhCcVRhxfzNxiIgWrg l5l5DwbXlpx5Z9tJKq2znro7BH3i3Z7BpJfrU72m10Yn0vWa1eVNmuCWXON1GdJ4OcXE fauYJm9v+/uSylr4rUA5NAioAc+7a/6FArT11bVSArgp/t6mLfx2BxsdUZY6AjnpFop+ S+jqMPwcOqpk/6RXMB98xzBFwhzTSI+cpVkxZHdfQBwcnFUQloRwC35E7aaq+plwNz+N 3OLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=U2RZobJc; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s126-v6si1502591pgc.131.2018.04.27.09.13.11; Fri, 27 Apr 2018 09:13:25 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=U2RZobJc; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758747AbeD0QL4 (ORCPT + 99 others); Fri, 27 Apr 2018 12:11:56 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:41740 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758565AbeD0QLx (ORCPT ); Fri, 27 Apr 2018 12:11:53 -0400 Received: by mail-pf0-f195.google.com with SMTP id v63so1816849pfk.8 for ; Fri, 27 Apr 2018 09:11:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=9UqLHFfyOA44VCFMcZXzzUQHUCixUpJG9cetpisBSFs=; b=U2RZobJcfY8Wjs5rmU/8YqLHT4USMz7gRNCLArGuZKJ38BWC7QukqKvJsW8BNfHrHM dwylg7a5QoKv+zHJ+60gar+PkU7x6dmjpODiJpYcK4lbCw5A5oY28v0qg1hoEj+6BMV9 4nRxmibsdNlA29UWaG7A7QR4FznkCI7PyYciy9Im364jqYPu2ojjL/HnzG2A16WDjaSn W++Sn1HOHfeEdu30aTbmximgi4h2zNZztCWZcVKSNASku8u714tK0HyWg4Os97XZ+NmE qK6VFkirqeZiNEHWf3pYD+ibxi8SekrU6BmOhbhA60y2HcS0AT/I9gNVarHo38yrAOt+ w01g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=9UqLHFfyOA44VCFMcZXzzUQHUCixUpJG9cetpisBSFs=; b=EIFQpfCdlFCxJDjUxsCAovo+gIE6QDrosEx5jTk3Qgs/aYUdNLQojGuAmi+M8IAJEh r2bwdx7otgZd5Evu8Evanblv+aarZ2QaSqF0w3eIzdRNJwT2t3LT9VzTIWme9hrDOO8w MmEU3UGeLxSBs52zy2KeDJ8EJnn06SiOZqh7ByQvLTHjCFWoEIF59SHQiRfmCeQMz4e2 yhai4YAwSzdQ50+KO7TIiH7F1G/fiYEJPiVClEZ8NyhF3BSkDqLSaXTSVIC+O9ZOfgv0 qz1Zdq4/DSyO9C1fNfhfYe1me+qQJpBRHKNNkD3VnldBol/4tKK/NjyaoRwZpNDu9c7X zssw== X-Gm-Message-State: ALQs6tA7X2xKKn6GIl/4g7nvXCeEcp0ln+JKb1asWKQN+rQlbGaYNAU3 9eka4Cl62/alOv3FZoYqYkJjtzwTKPfcvO6I1+dQyA== X-Received: by 2002:a65:4801:: with SMTP id h1-v6mr2625551pgs.96.1524845512467; Fri, 27 Apr 2018 09:11:52 -0700 (PDT) MIME-Version: 1.0 Received: by 10.236.147.130 with HTTP; Fri, 27 Apr 2018 09:11:31 -0700 (PDT) In-Reply-To: <20180427185501-mutt-send-email-mst@kernel.org> References: <000000000000a5b2b1056a86e98c@google.com> <20180427154502.GA22544@la.guarana.org> <20180427185501-mutt-send-email-mst@kernel.org> From: Dmitry Vyukov Date: Fri, 27 Apr 2018 18:11:31 +0200 Message-ID: Subject: Re: [PATCH net] vhost: Use kzalloc() to allocate vhost_msg_node To: "Michael S. Tsirkin" Cc: Kevin Easton , Jason Wang , KVM list , virtualization@lists.linux-foundation.org, netdev , LKML , syzkaller-bugs Content-Type: text/plain; charset="UTF-8" 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 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. >> --- >> 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.