Skip to content

Commit 417fae2

Browse files
qsnklassert
authored andcommitted
xfrm: ipcomp: fix truesize computation on receive
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: eb2953d ("xfrm: ipcomp: Use crypto_acomp interface") Signed-off-by: Sabrina Dubroca <[email protected]> Acked-by: Herbert Xu <[email protected]> Signed-off-by: Steffen Klassert <[email protected]>
1 parent e3fd057 commit 417fae2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

net/xfrm/xfrm_ipcomp.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ static int ipcomp_post_acomp(struct sk_buff *skb, int err, int hlen)
4848
{
4949
struct acomp_req *req = ipcomp_cb(skb)->req;
5050
struct ipcomp_req_extra *extra;
51-
const int plen = skb->data_len;
5251
struct scatterlist *dsg;
5352
int len, dlen;
5453

@@ -64,7 +63,7 @@ static int ipcomp_post_acomp(struct sk_buff *skb, int err, int hlen)
6463

6564
/* Only update truesize on input. */
6665
if (!hlen)
67-
skb->truesize += dlen - plen;
66+
skb->truesize += dlen;
6867
skb->data_len = dlen;
6968
skb->len += dlen;
7069

0 commit comments

Comments
 (0)