[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-can
Subject:    Re: skbuff panic
From:       Oliver Hartkopp <socketcan () hartkopp ! net>
Date:       2015-02-23 12:55:00
Message-ID: 54EB2324.3030407 () hartkopp ! net
[Download RAW message or body]

Hello Daniel,

thanks for pointing me to this issue (again)!

I was checking the mail thread from July 2014 and found this fix for 
linux/driver/net/can/dev.c

http://marc.info/?l=linux-can&m=140458812201304&w=2

Which addresses this issue too.

So obviously we will need to reset the mac/network/transport header in

af_can.c: can_send()
dev.c: alloc_can_skb()
dev.c: alloc_canfd_skb()

to make sure it runs properly with af_packet (and kernel-dhcp) too.

Last time I announced to create a patch for it. This time I will DO SO!

Thanks for your patience :-)

Best regards,
Oliver


On 19.02.2015 12:48, Daniel Steer wrote:
> Marc Kleine-Budde <mkl <at> pengutronix.de> writes:
>
>>
>> On 07/11/2014 04:58 PM, Austin Schuh wrote:
>>> On Fri, Jul 11, 2014 at 6:27 AM, Oliver Hartkopp <socketcan <at>
> hartkopp.net> wrote:
>>>> Thanks for testing, Austin!
>>>>
>>>> I'll cook a patch for stable to add these settings.
>>>> Even if we do not know why someone requests obviously all netdev
> skbs and
>>>> treats them to be Ethernet/IP packets we should fix it in our code.
>>>>
>>>> If we fix it somewhere else it will last one year until some of the
>>>> is-there-anything-else-than-ethernet-networking guys will break it
> again.
>>>>
>>>
>>> Is it worth debugging why as well?  Defense in layers?
>>
>> Anything new about the kernel-dhcp?
>>
>> Marc
>>
>
> Hi,
>
> I have been investigating a similar issue on our system when running
> dhclient on a wireless network interface whilst sending and receiving on
> CAN via the BCM. I have applied your suggested patch, but also needed to
> reset the mac header pointer in alloc_can_skb() as looped back transmit
> packets will also cause an sk_buff under panic in af_packet.c. Ours is
> an older kernel and not the latest CAN code, but I can't see any changes
> in the latest code that would address this.
>
> diff --git a/net/can/af_can.c b/net/can/af_can.c
> --- a/net/can/af_can.c
> +++ b/net/can/af_can.c
> @@ -318,6 +318,8 @@
>   #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
>       skb_reset_network_header(skb);
>       skb_reset_transport_header(skb);
> +    /* dhclient interacting badly with CAN. */
> +    skb_reset_mac_header(skb);
>   #else
>       skb->nh.raw = skb->data;
>       skb->h.raw  = skb->data;
>
> Thank you,
>
> Daniel
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-can" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe linux-can" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic