diff options
author | David S. Miller <davem@davemloft.net> | 2019-11-13 11:26:20 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-11-13 11:26:20 -0800 |
commit | c3afb7eab0b3703d77ab3c569fda698ece16a717 (patch) | |
tree | ae45faf700bf57cf2de5df07926d5145e59278ec /net | |
parent | 5aa4277d4368c099223bbcd3a9086f3351a12ce9 (diff) | |
parent | 4944a4b1077f74d89073624bd286219d2fcbfce3 (diff) | |
download | linux-c3afb7eab0b3703d77ab3c569fda698ece16a717.tar.gz linux-c3afb7eab0b3703d77ab3c569fda698ece16a717.tar.bz2 linux-c3afb7eab0b3703d77ab3c569fda698ece16a717.zip |
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 <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/xfrm/xfrm_input.c | 3 | ||||
-rw-r--r-- | net/xfrm/xfrm_state.c | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/net/xfrm/xfrm_input.c b/net/xfrm/xfrm_input.c index 9b599ed66d97..2c86a2fc3915 100644 --- a/net/xfrm/xfrm_input.c +++ b/net/xfrm/xfrm_input.c @@ -480,6 +480,9 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type) else XFRM_INC_STATS(net, LINUX_MIB_XFRMINSTATEINVALID); + + if (encap_type == -1) + dev_put(skb->dev); goto drop; } diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index c6f3c4a1bd99..f3423562d933 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c @@ -495,6 +495,8 @@ static void ___xfrm_state_destroy(struct xfrm_state *x) x->type->destructor(x); xfrm_put_type(x->type); } + if (x->xfrag.page) + put_page(x->xfrag.page); xfrm_dev_state_free(x); security_xfrm_state_free(x); xfrm_state_free(x); |