All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] IP_GRE: Fix kernel panic in IP_GRE with GRE csum.
@ 2013-01-23 21:45 Pravin B Shelar
  2013-01-23 22:00 ` Eric Dumazet
  0 siblings, 1 reply; 2+ messages in thread
From: Pravin B Shelar @ 2013-01-23 21:45 UTC (permalink / raw)
  To: netdev; +Cc: jesse, Pravin B Shelar

Due to IP_GRE 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@nicira.com>
---
v3: Coding style Fix.

---
 net/ipv4/ip_gre.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index 303012a..e81b1ca 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -963,8 +963,12 @@ static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev
 			ptr--;
 		}
 		if (tunnel->parms.o_flags&GRE_CSUM) {
+			int offset = skb_transport_offset(skb);
+
 			*ptr = 0;
-			*(__sum16 *)ptr = ip_compute_csum((void *)(iph+1), skb->len - sizeof(struct iphdr));
+			*(__sum16 *)ptr = csum_fold(skb_checksum(skb, offset,
+								 skb->len - offset,
+								 0));
 		}
 	}
 
-- 
1.7.10

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v3] IP_GRE: Fix kernel panic in IP_GRE with GRE csum.
  2013-01-23 21:45 [PATCH v3] IP_GRE: Fix kernel panic in IP_GRE with GRE csum Pravin B Shelar
@ 2013-01-23 22:00 ` Eric Dumazet
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Dumazet @ 2013-01-23 22:00 UTC (permalink / raw)
  To: Pravin B Shelar; +Cc: netdev, jesse

On Wed, 2013-01-23 at 13:45 -0800, Pravin B Shelar wrote:
> Due to IP_GRE 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@nicira.com>
> ---
> v3: Coding style Fix.

More precisely, this comes from SG (Scatter Gather) support, not GSO.

Bug introduced in commit 6b78f16e4bdde3936b
(gre: add GSO support)

Acked-by: Eric Dumazet <edumazet@google.com>

Thanks !

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-01-23 22:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-23 21:45 [PATCH v3] IP_GRE: Fix kernel panic in IP_GRE with GRE csum Pravin B Shelar
2013-01-23 22:00 ` Eric Dumazet

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.