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: <20130313150510.GF19577@valinux.co.jp>
Date:	Thu, 14 Mar 2013 00:05:10 +0900
From:	Isaku Yamahata <yamahata@...inux.co.jp>
To:	Timo Teräs <timo.teras@....fi>
Cc:	netdev@...r.kernel.org, Eric Dumazet <edumazet@...gle.com>,
	"David S. Miller" <davem@...emloft.net>
Subject: Re: [PATCH] Revert "ip_gre: make ipgre_tunnel_xmit() not parse
	network header as IP unconditionally"

Hi.

On Wed, Mar 13, 2013 at 02:37:49PM +0200, Timo Teräs wrote:
> This reverts commit 412ed94744d16806fbec3bd250fd94e71cde5a1f.
> 
> The commit is wrong as tiph points to the outer IPv4 header which is
> installed at ipgre_header() and not the inner one which is protocol dependant.
> 
> This commit broke succesfully opennhrp which use PF_PACKET socket with
> ETH_P_NHRP protocol. Additionally ssl_addr is set to the link-layer
> IPv4 address. This address is written by ipgre_header() to the skb
> earlier, and this is the IPv4 header tiph should point to - regardless
> of the inner protocol payload.

Is this the case only for ETH_P_HNRP?
I wrote the patch having MPLS over GRE in mind.
Should it be something like this?
  if (protocol == htons(ETH_P_IP) || protocol == htons(ETH_P_NHRP))
    ....
thanks,

> 
> Signed-off-by: Timo Teräs <timo.teras@....fi>
> ---
>  net/ipv4/ip_gre.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>  
> This commit appeared in 3.8.x. So should go to 3.8.x-stable.
> 
> diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
> index d0ef0e6..91d66db 100644
> --- a/net/ipv4/ip_gre.c
> +++ b/net/ipv4/ip_gre.c
> @@ -798,10 +798,7 @@ static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev
>  
>  	if (dev->header_ops && dev->type == ARPHRD_IPGRE) {
>  		gre_hlen = 0;
> -		if (skb->protocol == htons(ETH_P_IP))
> -			tiph = (const struct iphdr *)skb->data;
> -		else
> -			tiph = &tunnel->parms.iph;
> +		tiph = (const struct iphdr *)skb->data;
>  	} else {
>  		gre_hlen = tunnel->hlen;
>  		tiph = &tunnel->parms.iph;
> -- 
> 1.8.1.5
> 

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