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:	Wed, 23 Jan 2013 23:00:48 +0900
From:	YOSHIFUJI Hideaki <yoshfuji@...ux-ipv6.org>
To:	Pravin B Shelar <pshelar@...ira.com>
CC:	netdev@...r.kernel.org, jesse@...ira.com,
	YOSHIFUJI Hideaki <yoshfuji@...ux-ipv6.org>,
	David Miller <davem@...emloft.net>
Subject: Re: [PATCH v2] IP_GRE: Fix kernel panic in IP_GRE with GRE csum.

Pravin B Shelar wrote:
> Fixed code indentation according to comments from David Miller.
> 
> --8<--------------------------cut here-------------------------->8--
> Due to GSO support, GRE can recieve non linear skb which
> results in panic in case of GRE_CSUM.
> Following patch fixes it by using correct csum API.
> 
> Signed-off-by: Pravin B Shelar <pshelar@...ira.com>
> ---
>  net/ipv4/ip_gre.c |    5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
> index 303012a..8179e066 100644
> --- a/net/ipv4/ip_gre.c
> +++ b/net/ipv4/ip_gre.c
> @@ -964,7 +964,10 @@ static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev
>  		}
>  		if (tunnel->parms.o_flags&GRE_CSUM) {
>  			*ptr = 0;
> -			*(__sum16 *)ptr = ip_compute_csum((void *)(iph+1), skb->len - sizeof(struct iphdr));
> +			*(__sum16 *)ptr = csum_fold(skb_checksum(skb,
> +						    skb_transport_offset(skb),
> +						    skb->len - skb_transport_offset(skb),
> +						    0));

IMHO, arguments for skb_checksum() should be aligned:

			*(__sum16 *)ptr = csum_fold(skb_checksum(skb,
								 skb_transport_offset(skb),
								 skb->len - skb_transport_offset(skb),
								 0));

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