]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
xfrm: ipcomp: fix truesize computation on receive
authorSabrina Dubroca <sd@queasysnail.net>
Fri, 25 Apr 2025 14:32:55 +0000 (16:32 +0200)
committerSteffen Klassert <steffen.klassert@secunet.com>
Wed, 30 Apr 2025 06:08:16 +0000 (08:08 +0200)
ipcomp_post_acomp currently drops all frags (via pskb_trim_unique(skb,
0)), and then subtracts the old skb->data_len from truesize. This
adjustment has already be done during trimming (in skb_condense), so
we don't need to do it again.

This shows up for example when running fragmented traffic over ipcomp,
we end up hitting the WARN_ON_ONCE in skb_try_coalesce.

Fixes: eb2953d26971 ("xfrm: ipcomp: Use crypto_acomp interface")
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
net/xfrm/xfrm_ipcomp.c

index 0c14205343941d33e74d7f418444a1d77bd82d85..907c3ccb440dabc6efcee341942a9a9195e4f18b 100644 (file)
@@ -48,7 +48,6 @@ static int ipcomp_post_acomp(struct sk_buff *skb, int err, int hlen)
 {
        struct acomp_req *req = ipcomp_cb(skb)->req;
        struct ipcomp_req_extra *extra;
-       const int plen = skb->data_len;
        struct scatterlist *dsg;
        int len, dlen;
 
@@ -64,7 +63,7 @@ static int ipcomp_post_acomp(struct sk_buff *skb, int err, int hlen)
 
        /* Only update truesize on input. */
        if (!hlen)
-               skb->truesize += dlen - plen;
+               skb->truesize += dlen;
        skb->data_len = dlen;
        skb->len += dlen;