diff options
author | Steffen Klassert <steffen.klassert@secunet.com> | 2019-11-06 08:13:49 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-12-04 22:34:12 +0100 |
commit | 52a2326755b195a0fc409ebcc1530fee4ac76982 (patch) | |
tree | 54e52dbfcf68dbc818d0bc6310ffa8e2151624b8 | |
parent | 593c8621dbbac35a4e83d122f7558fdf66de3e33 (diff) | |
download | linux-stable-52a2326755b195a0fc409ebcc1530fee4ac76982.tar.gz linux-stable-52a2326755b195a0fc409ebcc1530fee4ac76982.tar.bz2 linux-stable-52a2326755b195a0fc409ebcc1530fee4ac76982.zip |
xfrm: Fix memleak on xfrm state destroy
commit 86c6739eda7d2a03f2db30cbee67a5fb81afa8ba upstream.
We leak the page that we use to create skb page fragments
when destroying the xfrm_state. Fix this by dropping a
page reference if a page was assigned to the xfrm_state.
Fixes: cac2661c53f3 ("esp4: Avoid skb_cow_data whenever possible")
Reported-by: JD <jdtxs00@gmail.com>
Reported-by: Paul Wouters <paul@nohats.ca>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | net/xfrm/xfrm_state.c | 2 |
1 files changed, 2 insertions, 0 deletions
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); |