]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
xfrm: policy: use atomic_inc_not_zero in rcu section
authorFlorian Westphal <fw@strlen.de>
Thu, 11 Aug 2016 13:17:55 +0000 (15:17 +0200)
committerSteffen Klassert <steffen.klassert@secunet.com>
Fri, 12 Aug 2016 06:07:11 +0000 (08:07 +0200)
commite37cc8ade5afaf082f804c6d18eb23377146bec4
treec9e1bf67bfedc04fb6e0b6840bd280198c300549
parent30846090a746edfdb230deadd638cfa96f7b8c91
xfrm: policy: use atomic_inc_not_zero in rcu section

If we don't hold the policy lock anymore the refcnt might
already be 0, i.e. policy struct is about to be free'd.

Switch to atomic_inc_not_zero to avoid this.

On removal policies are already unlinked from the tables (lists)
before the last _put occurs so we are not supposed to find the same
'dead' entry on the next loop, so its safe to just repeat the lookup.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
net/xfrm/xfrm_policy.c