From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f196.google.com ([209.85.192.196]:40266 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754184AbeCHPPW (ORCPT ); Thu, 8 Mar 2018 10:15:22 -0500 Subject: Re: [PATCH] vhost_net: initialize rx_ring in vhost_net_open() To: Alexander Potapenko , dvyukov@google.com, jasowang@redhat.com, mst@redhat.com Cc: kvm@vger.kernel.org, netdev@vger.kernel.org References: <20180308133717.149524-1-glider@google.com> From: Eric Dumazet Message-ID: <307d6f9e-e308-9d0b-aaac-f3afa65f1164@gmail.com> Date: Thu, 8 Mar 2018 07:15:19 -0800 MIME-Version: 1.0 In-Reply-To: <20180308133717.149524-1-glider@google.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org List-ID: On 03/08/2018 05:37 AM, Alexander Potapenko wrote: > KMSAN reported a use of uninit memory in vhost_net_buf_unproduce() > while trying to access n->vqs[VHOST_NET_VQ_TX].rx_ring: > > > ================================================================== > > Signed-off-by: Alexander Potapenko Please identify bug origin with a Fixes: tag This will tremendously help stable teams that are struggling with many backports these days. Thanks. > --- > drivers/vhost/net.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c > index 610cba276d47..60f1080bffc7 100644 > --- a/drivers/vhost/net.c > +++ b/drivers/vhost/net.c > @@ -948,6 +948,7 @@ static int vhost_net_open(struct inode *inode, struct file *f) > n->vqs[i].done_idx = 0; > n->vqs[i].vhost_hlen = 0; > n->vqs[i].sock_hlen = 0; > + n->vqs[i].rx_ring = NULL; > vhost_net_buf_init(&n->vqs[i].rxq); > } > vhost_dev_init(dev, vqs, VHOST_NET_VQ_MAX); >