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] [day] [month] [year] [list]
Date:   Mon, 05 Jun 2017 06:03:33 -0700
From:   Eric Dumazet <eric.dumazet@...il.com>
To:     Haishuang Yan <yanhaishuang@...s.chinamobile.com>
Cc:     "David S. Miller" <davem@...emloft.net>,
        Jesse Gross <jesse@...nel.org>,
        Alexey Kuznetsov <kuznet@....inr.ac.ru>,
        James Morris <jmorris@...ei.org>,
        Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
        Patrick McHardy <kaber@...sh.net>, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] sit: reload iphdr in ipip6_rcv

On Sun, 2017-06-04 at 14:43 +0800, Haishuang Yan wrote:
> Since iptunnel_pull_header() can call pskb_may_pull(),
> we must reload any pointer that was related to skb->head.
> 
> Fixes: a09a4c8dd1ec ("tunnels: Remove encapsulation offloads on decap")
> Signed-off-by: Haishuang Yan <yanhaishuang@...s.chinamobile.com>
> ---
>  net/ipv6/sit.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
> index 61e5902..af832e7 100644
> --- a/net/ipv6/sit.c
> +++ b/net/ipv6/sit.c
> @@ -657,6 +657,7 @@ static int ipip6_rcv(struct sk_buff *skb)
>  		if (iptunnel_pull_header(skb, 0, htons(ETH_P_IPV6),
>  		    !net_eq(tunnel->net, dev_net(tunnel->dev))))
>  			goto out;
> +		iph = ip_hdr(skb);
>  
>  		err = IP_ECN_decapsulate(iph, skb);
>  		if (unlikely(err)) {

This seems unnecessary.

By the time ipip6_rcv() is called, we already have the guarantee the
IPv4 header is in skb linear part.

Otherwise we could not use iph->saddr and iph->daddr in the call to
ipip6_tunnel_lookup()

Therefore, the pskb_may_pull() is a nop in this particular case.




Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ