Skip to contentSkip to conversation

xfrm: fix a rcu_read_lock() imbalance in make_blackhole

PATCH Applied [email protected] 2 participants 2 messages Sep 18, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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.

---
 net/xfrm/xfrm_policy.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/xfrm/xfrm_policy.c +1 -1
index 741a32a..878835b 100644
@@ -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
maintainer Applied
#1 lore raw

From: [email protected]
Date: Tue, 18 Sep 2012 16:40:10 +0800

Quoted 6 lines

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.

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.