mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 11:50:43 +09:00
netvsc: unshare skb in VF rx handler
[ Upstream commit996ed04741] 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:0c195567a8("netvsc: transparent VF management") Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
7f548acece
commit
1c12bf1ebe
@@ -2004,6 +2004,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);
|
||||
|
||||
Reference in New Issue
Block a user