lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140106155253.GA10204@order.stressinduktion.org>
Date:	Mon, 6 Jan 2014 16:52:53 +0100
From:	Hannes Frederic Sowa <hannes@...essinduktion.org>
To:	François-Xavier Le Bail <fx.lebail@...oo.com>
Cc:	netdev@...r.kernel.org, "David S. Miller" <davem@...emloft.net>,
	Alexey Kuznetsov <kuznet@....inr.ac.ru>,
	James Morris <jmorris@...ei.org>,
	Hideaki Yoshifuji <yoshfuji@...ux-ipv6.org>,
	Patrick McHardy <kaber@...sh.net>
Subject: Re: [PATCH net-next v4] IPv6: use anycast addresses as source addresses in echo reply

On Mon, Jan 06, 2014 at 05:48:16AM -0800, François-Xavier Le Bail wrote:
> On Mon, 1/6/14, Hannes Frederic Sowa <hannes@...essinduktion.org> wrote:
> 
> > On Mon, Jan 06, 2014 at 02:41:41AM -0800, François-Xavier Le Bail wrote:
> > > On Sun, 1/5/14, Hannes Frederic Sowa <hannes@...essinduktion.org> wrote:
> > > 
> > > > On Fri, Jan 03, 2014 at 05:43:31PM +0100, Francois-Xavier Le Bail wrote:
> > > > > diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c
> > > > > index 5d42009..65c8619 100644
> > > > > --- a/net/ipv6/icmp.c
> > > > > +++ b/net/ipv6/icmp.c
> > > > > @@ -556,7 +556,9 @@ static void icmpv6_echo_reply(struct sk_buff *skb)
> > > > >  
> > > > >  	saddr = &ipv6_hdr(skb)->daddr;
> > > > >  
> > > > > -	if (!ipv6_unicast_destination(skb))
> > > > > +	if (!ipv6_unicast_destination(skb) &&
> > > > > +	    !(net->ipv6.anycast_src_echo_reply &&
> > > > > +	      ipv6_chk_acast_addr(net, NULL, saddr)))
> > > > >  		saddr = NULL;
> > > 
> > > > I am not sure why you left out the device at ipv6_chk_acast_addr?
> > > 
> > > > IMHO this logic is a bit more complex, we can pass NULL for ipv6 addresses of
> > > > scope global but need to check the interface for scope link.
> > > 
> > > > It is already possible via setsockopt JOIN_ANYCAST that an ll address is
> > > > anycast on another interface which may not be checked here.
> > > 
> > > In this case, there are neighbor solicitations "who has LL anycast" with no reply, so no echo request is sent.
> > 
> > A counter-example would be NOARP interfaces where we also don't speak ndisc.
> 
> Right. But if an echo request arrive on an interface which do not listen at this LL anycast, is a reply can occur ?

I thought quite the opposite with anycast + forwarding enabled, that
we would process the packet. But a quick test with this snippet showed no
problems on a tunnel router. Local input is ok, too.

#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <net/if.h>

int main(int argc, char **argv)
{
  struct ipv6_mreq mreq = {0};
  int sockfd=socket(AF_INET6, SOCK_DGRAM,0);
  inet_pton(AF_INET6, "fe80::AAAA", &mreq.ipv6mr_multiaddr);
  mreq.ipv6mr_interface = if_nametoindex("dummy0");
  setsockopt(sockfd, IPPROTO_IPV6, IPV6_JOIN_ANYCAST, &mreq, sizeof(mreq));
  pause();
}

I guess, I would have added skb->dev for the sake of defensive style
(and maybe performance, if tables get large). I have not tested that
and it's your choice (or Davids, of course). But I currently don't see
a reason why it should break. ;)

Greetings,

  Hannes

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ