Skip to content

Commit c3afb7e

Browse files
committed
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec
Steffen Klassert says: ==================== pull request (net): ipsec 2019-11-13 1) Fix a page memleak on xfrm state destroy. 2) Fix a refcount imbalance if a xfrm_state gets invaild during async resumption. From Xiaodong Xu. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 5aa4277 + 4944a4b commit c3afb7e

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

net/xfrm/xfrm_input.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,9 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type)
480480
else
481481
XFRM_INC_STATS(net,
482482
LINUX_MIB_XFRMINSTATEINVALID);
483+
484+
if (encap_type == -1)
485+
dev_put(skb->dev);
483486
goto drop;
484487
}
485488

net/xfrm/xfrm_state.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,8 @@ static void ___xfrm_state_destroy(struct xfrm_state *x)
495495
x->type->destructor(x);
496496
xfrm_put_type(x->type);
497497
}
498+
if (x->xfrag.page)
499+
put_page(x->xfrag.page);
498500
xfrm_dev_state_free(x);
499501
security_xfrm_state_free(x);
500502
xfrm_state_free(x);

0 commit comments

Comments
 (0)