diff mbox

[Bug,42809] New: kernel panic when receiving an ipsec packet

Message ID 1329962785.15610.8.camel@edumazet-laptop
State RFC, archived
Delegated to: David Miller
Headers show

Commit Message

Eric Dumazet Feb. 23, 2012, 2:06 a.m. UTC
Le jeudi 23 février 2012 à 03:02 +0100, Niccolò Belli a écrit :
> Il 23/02/2012 02:38, Eric Dumazet ha scritto:
> > Which driver handles this Traverse Solos card ?
> 
> drivers/atm/solos-pci.c
> 
> ~# lsmod | grep solos
> solos_pci              20009  2
> atm                    32378  7 pppoatm,br2684,solos_pci
> 

Thanks !

Please try following patch.



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Niccolò Belli Feb. 23, 2012, 2:12 a.m. UTC | #1
Il 23/02/2012 03:06, Eric Dumazet ha scritto:
> Please try following patch.
>
> diff --git a/net/ipv4/xfrm4_mode_tunnel.c b/net/ipv4/xfrm4_mode_tunnel.c
> index 534972e..f170933 100644
> --- a/net/ipv4/xfrm4_mode_tunnel.c
> +++ b/net/ipv4/xfrm4_mode_tunnel.c
> @@ -84,9 +84,11 @@ static int xfrm4_mode_tunnel_input(struct xfrm_state *x, struct sk_buff *skb)
>   	if (!(x->props.flags&  XFRM_STATE_NOECN))
>   		ipip_ecn_decapsulate(skb);
>
> -	old_mac = skb_mac_header(skb);
> -	skb_set_mac_header(skb, -skb->mac_len);
> -	memmove(skb_mac_header(skb), old_mac, skb->mac_len);
> +	if (skb_mac_header_was_set(skb)) {
> +		old_mac = skb_mac_header(skb);
> +		skb_set_mac_header(skb, -skb->mac_len);
> +		memmove(skb_mac_header(skb), old_mac, skb->mac_len);
> +	}
>   	skb_reset_network_header(skb);
>   	err = 0;

Wow, thanks! It will try it as soon as possible tomorrow, going sleeping 
now :)

Niccolò
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Niccolò Belli Feb. 23, 2012, 1:45 p.m. UTC | #2
Il 23/02/2012 03:06, Eric Dumazet ha scritto:
> Thanks !
>
> Please try following patch.
>
> diff --git a/net/ipv4/xfrm4_mode_tunnel.c b/net/ipv4/xfrm4_mode_tunnel.c
> index 534972e..f170933 100644
> --- a/net/ipv4/xfrm4_mode_tunnel.c
> +++ b/net/ipv4/xfrm4_mode_tunnel.c
> @@ -84,9 +84,11 @@ static int xfrm4_mode_tunnel_input(struct xfrm_state *x, struct sk_buff *skb)
>   	if (!(x->props.flags&  XFRM_STATE_NOECN))
>   		ipip_ecn_decapsulate(skb);
>
> -	old_mac = skb_mac_header(skb);
> -	skb_set_mac_header(skb, -skb->mac_len);
> -	memmove(skb_mac_header(skb), old_mac, skb->mac_len);
> +	if (skb_mac_header_was_set(skb)) {
> +		old_mac = skb_mac_header(skb);
> +		skb_set_mac_header(skb, -skb->mac_len);
> +		memmove(skb_mac_header(skb), old_mac, skb->mac_len);
> +	}
>   	skb_reset_network_header(skb);
>   	err = 0;
>

Your patch does solve the problem, thanks!

Niccolò
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/ipv4/xfrm4_mode_tunnel.c b/net/ipv4/xfrm4_mode_tunnel.c
index 534972e..f170933 100644
--- a/net/ipv4/xfrm4_mode_tunnel.c
+++ b/net/ipv4/xfrm4_mode_tunnel.c
@@ -84,9 +84,11 @@  static int xfrm4_mode_tunnel_input(struct xfrm_state *x, struct sk_buff *skb)
 	if (!(x->props.flags & XFRM_STATE_NOECN))
 		ipip_ecn_decapsulate(skb);
 
-	old_mac = skb_mac_header(skb);
-	skb_set_mac_header(skb, -skb->mac_len);
-	memmove(skb_mac_header(skb), old_mac, skb->mac_len);
+	if (skb_mac_header_was_set(skb)) {
+		old_mac = skb_mac_header(skb);
+		skb_set_mac_header(skb, -skb->mac_len);
+		memmove(skb_mac_header(skb), old_mac, skb->mac_len);
+	}
 	skb_reset_network_header(skb);
 	err = 0;