Commit 86c6739e authored by Steffen Klassert's avatar Steffen Klassert

xfrm: Fix memleak on xfrm state destroy

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: cac2661c ("esp4: Avoid skb_cow_data whenever possible")
Reported-by: default avatarJD <jdtxs00@gmail.com>
Reported-by: default avatarPaul Wouters <paul@nohats.ca>
Signed-off-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
parent 99a8efbb
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment