Re: [PATCH ipsec] xfrm: unbreak xfrm_sk_policy_lookup

2016-11-18 Thread Steffen Klassert
On Thu, Nov 17, 2016 at 01:21:46PM +0100, Florian Westphal wrote: > if we succeed grabbing the refcount, then > if (err && !xfrm_pol_hold_rcu) > > will evaluate to false so this hits last else branch which then > sets policy to ERR_PTR(0). > > Fixes: ae33786f73a7ce ("xfrm: policy: only use rcu

[PATCH ipsec] xfrm: unbreak xfrm_sk_policy_lookup

2016-11-17 Thread Florian Westphal
if we succeed grabbing the refcount, then if (err && !xfrm_pol_hold_rcu) will evaluate to false so this hits last else branch which then sets policy to ERR_PTR(0). Fixes: ae33786f73a7ce ("xfrm: policy: only use rcu in xfrm_sk_policy_lookup") Reported-by: Nicolas Dichtel Tested-by: Nicolas Dich