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: <20140522.121215.16105419184813584.davem@davemloft.net>
Date:	Thu, 22 May 2014 12:12:15 -0400 (EDT)
From:	David Miller <davem@...emloft.net>
To:	huizhang@...vell.com
Cc:	netdev@...r.kernel.org, alan@...rguk.ukuu.org.uk,
	nickcave.zhang@...il.com
Subject: Re: [PATCH] net: ipv6: Fixed up ipsec packet be re-routing issue

From: huizhang <huizhang@...vell.com>
Date: Thu, 22 May 2014 15:05:46 +0800

> diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c
> index 5f8e128..869b68b 100644
> --- a/net/ipv6/xfrm6_policy.c
> +++ b/net/ipv6/xfrm6_policy.c
> @@ -134,6 +134,8 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl, int reverse)
>  	const struct ipv6hdr *hdr = ipv6_hdr(skb);
>  	struct ipv6_opt_hdr *exthdr;
>  	const unsigned char *nh = skb_network_header(skb);
> +	if(IP6CB(skb)->nhoff==0)
> +		IP6CB(skb)->nhoff = offsetof(struct ipv6hdr, nexthdr);
>  	u8 nexthdr = nh[IP6CB(skb)->nhoff];
>  	int oif = 0;

Never put actual statements in the middle of a series of variable
declarations.

Also, it would probably be better to do this assignment in
__ip_local_out().

That's the bug, we only set nhoff in the input paths, we need
to set it in the output paths too if reaching _decode_session6
is possible for output packets.
--
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