From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH net] virtio-net: serialize tx routine during reset Date: Thu, 29 Jun 2017 12:52:41 -0400 (EDT) Message-ID: <20170629.125241.1456732917773572552.davem@davemloft.net> References: <1498614663-7711-1-git-send-email-jasowang@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1498614663-7711-1-git-send-email-jasowang@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: virtualization-bounces@lists.linux-foundation.org Errors-To: virtualization-bounces@lists.linux-foundation.org To: jasowang@redhat.com Cc: mst@redhat.com, netdev@vger.kernel.org, john.fastabend@gmail.com, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, jpmenil@gmail.com List-Id: virtualization@lists.linuxfoundation.org From: Jason Wang Date: Wed, 28 Jun 2017 09:51:03 +0800 > We don't hold any tx lock when trying to disable TX during reset, this > would lead a use after free since ndo_start_xmit() tries to access > the virtqueue which has already been freed. Fix this by using > netif_tx_disable() before freeing the vqs, this could make sure no tx > after vq freeing. > > Reported-by: Jean-Philippe Menil > Tested-by: Jean-Philippe Menil > Fixes commit f600b6905015 ("virtio_net: Add XDP support") > Cc: John Fastabend > Signed-off-by: Jason Wang Applied and queued up for -stable.