Commit a717e3f7 authored by Jakub Kicinski's avatar Jakub Kicinski Committed by David S. Miller

geneve: lock RCU on TX path

There is no guarantees that callers of the TX path will hold
the RCU lock.  Grab it explicitly.

Fixes: fceb9c3e ("geneve: avoid using stale geneve socket.")
Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 56de859e
...@@ -881,12 +881,14 @@ static netdev_tx_t geneve_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -881,12 +881,14 @@ static netdev_tx_t geneve_xmit(struct sk_buff *skb, struct net_device *dev)
info = &geneve->info; info = &geneve->info;
} }
rcu_read_lock();
#if IS_ENABLED(CONFIG_IPV6) #if IS_ENABLED(CONFIG_IPV6)
if (info->mode & IP_TUNNEL_INFO_IPV6) if (info->mode & IP_TUNNEL_INFO_IPV6)
err = geneve6_xmit_skb(skb, dev, geneve, info); err = geneve6_xmit_skb(skb, dev, geneve, info);
else else
#endif #endif
err = geneve_xmit_skb(skb, dev, geneve, info); err = geneve_xmit_skb(skb, dev, geneve, info);
rcu_read_unlock();
if (likely(!err)) if (likely(!err))
return NETDEV_TX_OK; return NETDEV_TX_OK;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment