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: <alpine.LFD.2.03.1309232135570.6779@mail.embedromix.ro>
Date:	Mon, 23 Sep 2013 21:36:33 +0300 (EEST)
From:	catab@...edromix.ro
To:	Joe Perches <joe@...ches.com>
cc:	netdev@...r.kernel.org, hannes@...essinduktion.org,
	yoshfuji@...ux-ipv6.org, davem@...emloft.net
Subject: Re: [PATCH] Do not drop DNATed 6to4/6rd packets

On Sun, 22 Sep 2013, Joe Perches wrote:

> On Sun, 2013-09-22 at 13:58 +0300, Catalin(ux) M. BOIE wrote:
>> From: "Catalin(ux) M. BOIE" <catab@...edromix.ro>
>>
>> When a router is doing  DNAT for 6to4/6rd packets the latest anti-spoofing
>> patch (218774dc) will drop them because the IPv6 address embedded
>> does not match the IPv4 destination. This patch will allow them to
>> pass by testing if we have an address that matches on 6to4/6rd interface.
>> I have been hit by this problem using Fedora and IPV6TO4_IPV4ADDR.
>> Also, log the dropped packets (with rate limit).
>
> Thanks.  trivial nits which maybe fixed later:
>
>> diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
> []
>> +/* Returns true if a packet is spoofed
>> + */
>
> probably nicer as single line /* Returns true ... */
>
>> +static bool packet_is_spoofed(struct sk_buff *skb,
>> +			      const struct iphdr *iph,
>> +			      struct ip_tunnel *tunnel)
>> +{
>> +	const struct ipv6hdr *ipv6h = ipv6_hdr(skb);
>> +
>> +	if (tunnel->dev->priv_flags & IFF_ISATAP) {
>> +		if (!isatap_chksrc(skb, iph, tunnel))
>> +			return true;
>> +
>> +		return false;
>> +	}
>> +
>> +	if ((tunnel->dev->flags&IFF_POINTOPOINT))
>
> It'd be nicer with spaces around the &
>
>> +		return false;
>
> It'd be slightly faster code moving the ipv6_hdr(skb)
> assignment below these tests.

Sorry, v3 was missing the changes suggested.
v4 fill fix it.
Sorry.

--
Catalin(ux) M. BOIE
http://kernel.embedromix.ro/

--
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