Skip to contentSkip to conversation

ipv6: Fix unbalanced rcu locking in rt6_update_exception_stamp_rt

PATCH Applied David Ahern 2 participants 2 messages Aug 1, 2019 – Aug 5, 2019

Subsystems (3)
lore
Share & tools
lore

David Ahern

author maintainer
#0 lore raw

PATCH 1/1 ipv6: Fix unbalanced rcu locking in rt6_update_exception_stamp_rt

From: David Ahern <[email protected]>

The nexthop path in rt6_update_exception_stamp_rt needs to call rcu_read_unlock if it fails to find a fib6_nh match rather than just returning.

Fixes e659ba31d806 ("ipv6: Handle all fib6_nh in a nexthop in exception handling")
---
 net/ipv6/route.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv6/route.c +1 -1
index e49fec767a10..fd059e08785a 100644
@@ -1951,7 +1951,7 @@ static void rt6_update_exception_stamp_rt(struct rt6_info *rt)
 		nexthop_for_each_fib6_nh(from->nh, fib6_nh_find_match, &arg);
 
 		if (!arg.match)
-			return;
+			goto unlock;
 		fib6_nh = arg.match;
 	} else {
 		fib6_nh = from->fib6_nh;
Signature · 1 line
2.11.0
maintainer Applied
#1 lore raw

From: David Ahern <[email protected]>
Date: Thu, 1 Aug 2019 14:36:35 -0700

Quoted 8 lines

From: David Ahern <[email protected]>

The nexthop path in rt6_update_exception_stamp_rt needs to call rcu_read_unlock if it fails to find a fib6_nh match rather than just returning.

Fixes e659ba31d806 ("ipv6: Handle all fib6_nh in a nexthop in exception handling")

Applied.