mirror of
https://github.com/torvalds/linux.git
synced 2026-06-03 20:14:06 +02:00
esp: fix skb leak with espintcp and async crypto
When the TX queue for espintcp is full, esp_output_tail_tcp will
return an error and not free the skb, because with synchronous crypto,
the common xfrm output code will drop the packet for us.
With async crypto (esp_output_done), we need to drop the skb when
esp_output_tail_tcp returns an error.
Fixes: e27cca96cd ("xfrm: add espintcp (RFC 8229)")
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
This commit is contained in:
parent
7d2fc41f91
commit
0c0eef8ccd
|
|
@ -235,10 +235,13 @@ static void esp_output_done(void *data, int err)
|
|||
xfrm_dev_resume(skb);
|
||||
} else {
|
||||
if (!err &&
|
||||
x->encap && x->encap->encap_type == TCP_ENCAP_ESPINTCP)
|
||||
esp_output_tail_tcp(x, skb);
|
||||
else
|
||||
x->encap && x->encap->encap_type == TCP_ENCAP_ESPINTCP) {
|
||||
err = esp_output_tail_tcp(x, skb);
|
||||
if (err != -EINPROGRESS)
|
||||
kfree_skb(skb);
|
||||
} else {
|
||||
xfrm_output_resume(skb_to_full_sk(skb), skb, err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -271,10 +271,13 @@ static void esp_output_done(void *data, int err)
|
|||
xfrm_dev_resume(skb);
|
||||
} else {
|
||||
if (!err &&
|
||||
x->encap && x->encap->encap_type == TCP_ENCAP_ESPINTCP)
|
||||
esp_output_tail_tcp(x, skb);
|
||||
else
|
||||
x->encap && x->encap->encap_type == TCP_ENCAP_ESPINTCP) {
|
||||
err = esp_output_tail_tcp(x, skb);
|
||||
if (err != -EINPROGRESS)
|
||||
kfree_skb(skb);
|
||||
} else {
|
||||
xfrm_output_resume(skb_to_full_sk(skb), skb, err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user