[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20200116172403.18149-164-sashal@kernel.org>
Date: Thu, 16 Jan 2020 12:21:33 -0500
From: Sasha Levin <sashal@...nel.org>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
Cc: Stephen Hemminger <stephen@...workplumber.org>,
Stephen Hemminger <sthemmin@...rosoft.com>,
"David S . Miller" <davem@...emloft.net>,
Sasha Levin <sashal@...nel.org>, linux-hyperv@...r.kernel.org,
netdev@...r.kernel.org
Subject: [PATCH AUTOSEL 4.14 221/371] netvsc: unshare skb in VF rx handler
From: Stephen Hemminger <stephen@...workplumber.org>
[ Upstream commit 996ed04741467f6d1552440c92988b132a9487ec ]
The netvsc VF skb handler should make sure that skb is not
shared. Similar logic already exists in bonding and team device
drivers.
This is not an issue in practice because the VF devicex
does not send up shared skb's. But the netvsc driver
should do the right thing if it did.
Fixes: 0c195567a8f6 ("netvsc: transparent VF management")
Signed-off-by: Stephen Hemminger <sthemmin@...rosoft.com>
Signed-off-by: David S. Miller <davem@...emloft.net>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
drivers/net/hyperv/netvsc_drv.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index a89de5752a8c..9e48855f6407 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -1840,6 +1840,12 @@ static rx_handler_result_t netvsc_vf_handle_frame(struct sk_buff **pskb)
struct netvsc_vf_pcpu_stats *pcpu_stats
= this_cpu_ptr(ndev_ctx->vf_stats);
+ skb = skb_share_check(skb, GFP_ATOMIC);
+ if (unlikely(!skb))
+ return RX_HANDLER_CONSUMED;
+
+ *pskb = skb;
+
skb->dev = ndev;
u64_stats_update_begin(&pcpu_stats->syncp);
--
2.20.1
Powered by blists - more mailing lists