Skip to content

Commit

Permalink
xfrm: Fix memleak on xfrm state destroy
Browse files Browse the repository at this point in the history
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: cac2661 ("esp4: Avoid skb_cow_data whenever possible")
Reported-by: JD <[email protected]>
Reported-by: Paul Wouters <[email protected]>
Signed-off-by: Steffen Klassert <[email protected]>
  • Loading branch information
klassert committed Nov 7, 2019
1 parent 99a8efb commit 86c6739
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/xfrm/xfrm_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 86c6739

Please sign in to comment.