xfrm: Fix memleak on xfrm state destroy
commit86c6739edaupstream. 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:cac2661c53("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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
0a6f9bc592
commit
171148ea3a
@@ -449,6 +449,8 @@ static void xfrm_state_gc_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);
|
||||
kfree(x);
|
||||
|
||||
Reference in New Issue
Block a user