From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:57410 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751710AbdBAIMk (ORCPT ); Wed, 1 Feb 2017 03:12:40 -0500 Subject: Patch "netvsc: add rcu_read locking to netvsc callback" has been added to the 4.9-stable tree To: stephen@networkplumber.org, davem@davemloft.net, gregkh@linuxfoundation.org, sthemmin@microsoft.com Cc: , From: Date: Wed, 01 Feb 2017 09:11:57 +0100 Message-ID: <1485936717151164@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled netvsc: add rcu_read locking to netvsc callback to the 4.9-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: netvsc-add-rcu_read-locking-to-netvsc-callback.patch and it can be found in the queue-4.9 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From foo@baz Wed Feb 1 08:50:24 CET 2017 From: stephen hemminger Date: Wed, 11 Jan 2017 09:16:32 -0800 Subject: netvsc: add rcu_read locking to netvsc callback From: stephen hemminger [ Upstream commit 0719e72ccb801829a3d735d187ca8417f0930459 ] The receive callback (in tasklet context) is using RCU to get reference to associated VF network device but this is not safe. RCU read lock needs to be held. Found by running with full lockdep debugging enabled. Fixes: f207c10d9823 ("hv_netvsc: use RCU to protect vf_netdev") Signed-off-by: Stephen Hemminger Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/hyperv/netvsc_drv.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c @@ -659,6 +659,7 @@ int netvsc_recv_callback(struct hv_devic * policy filters on the host). Deliver these via the VF * interface in the guest. */ + rcu_read_lock(); vf_netdev = rcu_dereference(net_device_ctx->vf_netdev); if (vf_netdev && (vf_netdev->flags & IFF_UP)) net = vf_netdev; @@ -667,6 +668,7 @@ int netvsc_recv_callback(struct hv_devic skb = netvsc_alloc_recv_skb(net, packet, csum_info, *data, vlan_tci); if (unlikely(!skb)) { ++net->stats.rx_dropped; + rcu_read_unlock(); return NVSP_STAT_FAIL; } @@ -696,6 +698,7 @@ int netvsc_recv_callback(struct hv_devic * TODO - use NAPI? */ netif_rx(skb); + rcu_read_unlock(); return 0; } Patches currently in stable-queue which might be from stephen@networkplumber.org are queue-4.9/netvsc-add-rcu_read-locking-to-netvsc-callback.patch