Skip to contentSkip to conversation

adding missing rcu_read_unlock in ipxip6_rcv

PATCH In review Nikita V. Shirokov 3 participants 3 messages Dec 7, 2017

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

PATCH v2 1/1 adding missing rcu_read_unlock in ipxip6_rcv

commit 8d79266bc48c ("ip6_tunnel: add collect_md mode to IPv6 tunnels") introduced new exit point in ipxip6_rcv. however rcu_read_unlock is missing there. this diff is fixing this

v1->v2:
instead of doing rcu_read_unlock in place, we are going to "drop" section (to prevent skb leakage)

---
 net/ipv6/ip6_tunnel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv6/ip6_tunnel.c +1 -1
index 3d3092a..db84f52 100644
@@ -904,7 +904,7 @@ static int ipxip6_rcv(struct sk_buff *skb, u8 ipproto,
 		if (t->parms.collect_md) {
 			tun_dst = ipv6_tun_rx_dst(skb, 0, 0, 0);
 			if (!tun_dst)
-				return 0;
+				goto drop;
 		}
 		ret = __ip6_tnl_rcv(t, skb, tpi, tun_dst, dscp_ecn_decapsulate,
 				    log_ecn_error);
Signature · 1 line
2.9.5
Acked-by on v2 1/1
#1 lore raw
Quoted 9 lines · Nikita V. Shirokov

commit 8d79266bc48c ("ip6_tunnel: add collect_md mode to IPv6 tunnels") introduced new exit point in ipxip6_rcv. however rcu_read_unlock is missing there. this diff is fixing this

v1->v2:
instead of doing rcu_read_unlock in place, we are going to "drop" section (to prevent skb leakage)

thanks for fixing my mess.

Fixes 8d79266bc48c ("ip6_tunnel: add collect_md mode to IPv6 tunnels")
maintainer
#2 lore raw
In reply to Nikita V. Shirokov

From: "Nikita V. Shirokov" <[email protected]>
Date: Wed, 6 Dec 2017 17:15:43 -0800

Quoted 9 lines

commit 8d79266bc48c ("ip6_tunnel: add collect_md mode to IPv6 tunnels") introduced new exit point in ipxip6_rcv. however rcu_read_unlock is missing there. this diff is fixing this

v1->v2:
instead of doing rcu_read_unlock in place, we are going to "drop" section (to prevent skb leakage)

Applied and queued up for -stable, thanks.