OSDN Git Service

xfrm: Fix memleak on xfrm state destroy
authorSteffen Klassert <steffen.klassert@secunet.com>
Wed, 6 Nov 2019 07:13:49 +0000 (08:13 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Dec 2019 08:21:27 +0000 (09:21 +0100)
commit55b5cbaa468a778fac157141e443e90fe0d201cd
tree0f8fe09ad1c3dd1f89b5dd01b624dcd5e6df2167
parentc01cffbcdb5273c64a2b4003220a27042afc87c2
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>
net/xfrm/xfrm_state.c