diff options
author | Sabrina Dubroca <sd@queasysnail.net> | 2018-06-30 17:38:55 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-07-02 20:34:04 +0900 |
commit | 603d4cf8fe095b1ee78f423d514427be507fb513 (patch) | |
tree | a4051b67f31ba061752f8c5326fa9c6aab528e7f /drivers/net/geneve.c | |
parent | 1236f22fbae15df3736ab4a984c64c0c6ee6254c (diff) | |
download | talos-obmc-linux-603d4cf8fe095b1ee78f423d514427be507fb513.tar.gz talos-obmc-linux-603d4cf8fe095b1ee78f423d514427be507fb513.zip |
net: fix use-after-free in GRO with ESP
Since the addition of GRO for ESP, gro_receive can consume the skb and
return -EINPROGRESS. In that case, the lower layer GRO handler cannot
touch the skb anymore.
Commit 5f114163f2f5 ("net: Add a skb_gro_flush_final helper.") converted
some of the gro_receive handlers that can lead to ESP's gro_receive so
that they wouldn't access the skb when -EINPROGRESS is returned, but
missed other spots, mainly in tunneling protocols.
This patch finishes the conversion to using skb_gro_flush_final(), and
adds a new helper, skb_gro_flush_final_remcsum(), used in VXLAN and
GUE.
Fixes: 5f114163f2f5 ("net: Add a skb_gro_flush_final helper.")
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Reviewed-by: Stefano Brivio <sbrivio@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/geneve.c')
-rw-r--r-- | drivers/net/geneve.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c index 750eaa53bf0c..ada33c2d9ac2 100644 --- a/drivers/net/geneve.c +++ b/drivers/net/geneve.c @@ -476,7 +476,7 @@ static struct sk_buff **geneve_gro_receive(struct sock *sk, out_unlock: rcu_read_unlock(); out: - NAPI_GRO_CB(skb)->flush |= flush; + skb_gro_flush_final(skb, pp, flush); return pp; } |