* [PATCH net] adding missing rcu_read_unlock in ipxip6_rcv
@ 2017-12-06 18:19 Nikita V. Shirokov
2017-12-06 20:50 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Nikita V. Shirokov @ 2017-12-06 18:19 UTC (permalink / raw)
To: netdev; +Cc: ast, vnuorval, 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
Signed-off-by: Nikita V. Shirokov <tehnerd@fb.com>
---
net/ipv6/ip6_tunnel.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index 3d3092a..00f2c79 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -903,8 +903,10 @@ static int ipxip6_rcv(struct sk_buff *skb, u8 ipproto,
goto drop;
if (t->parms.collect_md) {
tun_dst = ipv6_tun_rx_dst(skb, 0, 0, 0);
- if (!tun_dst)
+ if (!tun_dst) {
+ rcu_read_unlock();
return 0;
+ }
}
ret = __ip6_tnl_rcv(t, skb, tpi, tun_dst, dscp_ecn_decapsulate,
log_ecn_error);
--
2.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net] adding missing rcu_read_unlock in ipxip6_rcv
2017-12-06 18:19 [PATCH net] adding missing rcu_read_unlock in ipxip6_rcv Nikita V. Shirokov
@ 2017-12-06 20:50 ` David Miller
2017-12-07 0:28 ` Nikita Shirokov
0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2017-12-06 20:50 UTC (permalink / raw)
To: tehnerd; +Cc: netdev, ast, vnuorval
From: "Nikita V. Shirokov" <tehnerd@fb.com>
Date: Wed, 6 Dec 2017 10:19:33 -0800
> 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
>
> Signed-off-by: Nikita V. Shirokov <tehnerd@fb.com>
...
> @@ -903,8 +903,10 @@ static int ipxip6_rcv(struct sk_buff *skb, u8 ipproto,
> goto drop;
> if (t->parms.collect_md) {
> tun_dst = ipv6_tun_rx_dst(skb, 0, 0, 0);
> - if (!tun_dst)
> + if (!tun_dst) {
> + rcu_read_unlock();
> return 0;
> + }
> }
> ret = __ip6_tnl_rcv(t, skb, tpi, tun_dst, dscp_ecn_decapsulate,
> log_ecn_error);
Shouldn't it branch to 'drop' otherwise we leak the skb?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net] adding missing rcu_read_unlock in ipxip6_rcv
2017-12-06 20:50 ` David Miller
@ 2017-12-07 0:28 ` Nikita Shirokov
0 siblings, 0 replies; 3+ messages in thread
From: Nikita Shirokov @ 2017-12-07 0:28 UTC (permalink / raw)
To: David Miller; +Cc: netdev@vger.kernel.org, ast@kernel.org, vnuorval@tcs.hut.fi
On 12/6/17, 12:50 PM, "David Miller" <davem@davemloft.net> wrote:
From: "Nikita V. Shirokov" <tehnerd@fb.com>
Date: Wed, 6 Dec 2017 10:19:33 -0800
> 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
>
> Signed-off-by: Nikita V. Shirokov <tehnerd@fb.com>
...
> @@ -903,8 +903,10 @@ static int ipxip6_rcv(struct sk_buff *skb, u8 ipproto,
> goto drop;
> if (t->parms.collect_md) {
> tun_dst = ipv6_tun_rx_dst(skb, 0, 0, 0);
> - if (!tun_dst)
> + if (!tun_dst) {
> + rcu_read_unlock();
> return 0;
> + }
> }
> ret = __ip6_tnl_rcv(t, skb, tpi, tun_dst, dscp_ecn_decapsulate,
> log_ecn_error);
Shouldn't it branch to 'drop' otherwise we leak the skb?
Fair point, will rework.
--
Nikita
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-12-07 0:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-06 18:19 [PATCH net] adding missing rcu_read_unlock in ipxip6_rcv Nikita V. Shirokov
2017-12-06 20:50 ` David Miller
2017-12-07 0:28 ` Nikita Shirokov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).