linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oliver Hartkopp <socketcan@hartkopp.net>
To: Daniel Steer <daniel.steer@mclaren.com>
Cc: linux-can@vger.kernel.org, Marc Kleine-Budde <mkl@pengutronix.de>,
	Austin Schuh <austin@peloton-tech.com>
Subject: Re: skbuff panic
Date: Mon, 23 Feb 2015 13:55:00 +0100	[thread overview]
Message-ID: <54EB2324.3030407@hartkopp.net> (raw)
In-Reply-To: <loom.20150219T121134-213@post.gmane.org>

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
>

      reply	other threads:[~2015-02-23 12:55 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-03 23:03 skbuff panic Austin Schuh
2014-07-03 23:18 ` Austin Schuh
2014-07-05 10:40 ` Oliver Hartkopp
2014-07-05 18:38   ` Austin Schuh
2014-07-05 19:21     ` Oliver Hartkopp
2014-07-06  5:07       ` Austin Schuh
2014-07-06 12:12         ` Oliver Hartkopp
2014-07-06 16:13           ` Oliver Hartkopp
2014-07-06 19:38             ` Marc Kleine-Budde
2014-07-07  4:11               ` Austin Schuh
2014-07-10  0:07                 ` Austin Schuh
2014-07-10 17:37                   ` Austin Schuh
2014-07-11 13:27                     ` Oliver Hartkopp
2014-07-11 14:58                       ` Austin Schuh
2014-07-11 17:48                         ` Marc Kleine-Budde
2015-02-19 11:48                           ` Daniel Steer
2015-02-23 12:55                             ` Oliver Hartkopp [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54EB2324.3030407@hartkopp.net \
    --to=socketcan@hartkopp.net \
    --cc=austin@peloton-tech.com \
    --cc=daniel.steer@mclaren.com \
    --cc=linux-can@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).