* [PATCH] net/ipv6/udp: Fix ipv6 multicast socket filter regression
@ 2015-05-18 19:08 Henning Rogge
2015-05-18 20:22 ` Eric Dumazet
2015-05-19 20:35 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Henning Rogge @ 2015-05-18 19:08 UTC (permalink / raw)
To: netdev; +Cc: Henning Rogge, David S. Miller
Commit <5cf3d46192fc> ("udp: Simplify__udp*_lib_mcast_deliver")
simplified the filter for incoming IPv6 multicast but removed
the check of the local socket address and the UDP destination
address.
This patch restores the filter to prevent sockets bound to a IPv6
multicast IP to receive other UDP traffic link unicast.
Signed-off-by: Henning Rogge <hrogge@gmail.com>
Fixes: 5cf3d46192fc ("udp: Simplify__udp*_lib_mcast_deliver")
Cc: "David S. Miller" <davem@davemloft.net>
---
The commit above was found by me with a git bisect. I think the
patch should be included into the stable kernel trees.
---
net/ipv6/udp.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 3477c919fcc8..c2ec41617a35 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -731,7 +731,9 @@ static bool __udp_v6_is_mcast_sock(struct net *net, struct sock *sk,
(inet->inet_dport && inet->inet_dport != rmt_port) ||
(!ipv6_addr_any(&sk->sk_v6_daddr) &&
!ipv6_addr_equal(&sk->sk_v6_daddr, rmt_addr)) ||
- (sk->sk_bound_dev_if && sk->sk_bound_dev_if != dif))
+ (sk->sk_bound_dev_if && sk->sk_bound_dev_if != dif) ||
+ (!ipv6_addr_any(&sk->sk_v6_rcv_saddr) &&
+ !ipv6_addr_equal(&sk->sk_v6_rcv_saddr, loc_addr)))
return false;
if (!inet6_mc_check(sk, loc_addr, rmt_addr))
return false;
--
2.1.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] net/ipv6/udp: Fix ipv6 multicast socket filter regression
2015-05-18 19:08 [PATCH] net/ipv6/udp: Fix ipv6 multicast socket filter regression Henning Rogge
@ 2015-05-18 20:22 ` Eric Dumazet
2015-05-19 20:35 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Eric Dumazet @ 2015-05-18 20:22 UTC (permalink / raw)
To: Henning Rogge; +Cc: netdev, David S. Miller, David Held
On Mon, 2015-05-18 at 21:08 +0200, Henning Rogge wrote:
> Commit <5cf3d46192fc> ("udp: Simplify__udp*_lib_mcast_deliver")
> simplified the filter for incoming IPv6 multicast but removed
> the check of the local socket address and the UDP destination
> address.
>
> This patch restores the filter to prevent sockets bound to a IPv6
> multicast IP to receive other UDP traffic link unicast.
>
> Signed-off-by: Henning Rogge <hrogge@gmail.com>
> Fixes: 5cf3d46192fc ("udp: Simplify__udp*_lib_mcast_deliver")
> Cc: "David S. Miller" <davem@davemloft.net>
> ---
> The commit above was found by me with a git bisect. I think the
> patch should be included into the stable kernel trees.
> ---
> net/ipv6/udp.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
> index 3477c919fcc8..c2ec41617a35 100644
> --- a/net/ipv6/udp.c
> +++ b/net/ipv6/udp.c
> @@ -731,7 +731,9 @@ static bool __udp_v6_is_mcast_sock(struct net *net, struct sock *sk,
> (inet->inet_dport && inet->inet_dport != rmt_port) ||
> (!ipv6_addr_any(&sk->sk_v6_daddr) &&
> !ipv6_addr_equal(&sk->sk_v6_daddr, rmt_addr)) ||
> - (sk->sk_bound_dev_if && sk->sk_bound_dev_if != dif))
> + (sk->sk_bound_dev_if && sk->sk_bound_dev_if != dif) ||
> + (!ipv6_addr_any(&sk->sk_v6_rcv_saddr) &&
> + !ipv6_addr_equal(&sk->sk_v6_rcv_saddr, loc_addr)))
> return false;
> if (!inet6_mc_check(sk, loc_addr, rmt_addr))
> return false;
Nice catch. I've CC faulty commit author.
Acked-by: Eric Dumazet <edumazet@google.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] net/ipv6/udp: Fix ipv6 multicast socket filter regression
2015-05-18 19:08 [PATCH] net/ipv6/udp: Fix ipv6 multicast socket filter regression Henning Rogge
2015-05-18 20:22 ` Eric Dumazet
@ 2015-05-19 20:35 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2015-05-19 20:35 UTC (permalink / raw)
To: hrogge; +Cc: netdev
From: Henning Rogge <hrogge@gmail.com>
Date: Mon, 18 May 2015 21:08:49 +0200
> Commit <5cf3d46192fc> ("udp: Simplify__udp*_lib_mcast_deliver")
> simplified the filter for incoming IPv6 multicast but removed
> the check of the local socket address and the UDP destination
> address.
>
> This patch restores the filter to prevent sockets bound to a IPv6
> multicast IP to receive other UDP traffic link unicast.
>
> Signed-off-by: Henning Rogge <hrogge@gmail.com>
> Fixes: 5cf3d46192fc ("udp: Simplify__udp*_lib_mcast_deliver")
Applied and queued up for -stable, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-05-19 20:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-18 19:08 [PATCH] net/ipv6/udp: Fix ipv6 multicast socket filter regression Henning Rogge
2015-05-18 20:22 ` Eric Dumazet
2015-05-19 20:35 ` David Miller
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).