xfrm: fix a rcu_read_lock() imbalance in make_blackhole
Subsystems (3)
PATCH 1/1 xfrm: fix a rcu_read_lock() imbalance in make_blackhole
From: Li RongQing <[email protected]>
if xfrm_policy_get_afinfo returns 0, it has already called rcu_read_unlock, xfrm_policy_put_afinfo should not be called again.
Signed-off-by Li RongQing <[email protected]>
--- net/xfrm/xfrm_policy.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
net/xfrm/xfrm_policy.c +1 -1
@@ -1780,7 +1780,7 @@ static struct dst_entry *make_blackhole(struct net *net, u16 family,if (!afinfo) {dst_release (dst_orig); - ret =ERR_PTR (-EINVAL ); +return ERR_PTR (-EINVAL ); }else { ret = afinfo->blackhole_route (net, dst_orig); }
Signature · 1 line
1.7.4.1
From: [email protected]
Date: Tue, 18 Sep 2012 16:40:10 +0800
Quoted 6 lines
From: Li RongQing <[email protected]>
if
xfrm_policy_get_afinforeturns 0, it has already calledrcu_read_unlock,xfrm_policy_put_afinfoshould not be called again.Signed-off-by Li RongQing <[email protected]>
This bug exists in the 'net' tree too, where this lock is a read lock.
I've applied this patch and adjusted the commit log text to accomodate to difference.
Thanks.