linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be>
To: Oliver Hartkopp <socketcan@hartkopp.net>
Cc: Dmitry Vyukov <dvyukov@google.com>,
	Marc Kleine-Budde <mkl@pengutronix.de>,
	o.rempel@pengutronix.de,
	syzbot <syzbot+c3ea30e1e2485573f953@syzkaller.appspotmail.com>,
	David Miller <davem@davemloft.net>,
	linux-can@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
	netdev <netdev@vger.kernel.org>,
	syzkaller-bugs <syzkaller-bugs@googlegroups.com>
Subject: Re: general protection fault in can_rx_register
Date: Tue, 21 Jan 2020 20:47:11 +0100	[thread overview]
Message-ID: <20200121194711.GD13462@x1.vandijck-laurijssen.be> (raw)
In-Reply-To: <a04209c8-747b-6116-d915-21c285f48730@hartkopp.net>

On di, 21 jan 2020 20:28:51 +0100, Oliver Hartkopp wrote:
> Hi Kurt,
> 
> On 21/01/2020 19.54, Kurt Van Dijck wrote:
> >On di, 21 jan 2020 09:30:35 +0100, Kurt Van Dijck wrote:
> >>On ma, 20 jan 2020 23:35:16 +0100, Oliver Hartkopp wrote:
> 
> 
> >>>But it is still open why dev->ml_priv is not set correctly in vxcan.c as all
> >>>the settings for .priv_size and in vxcan_setup look fine.
> >>
> >>Maybe I got completely lost:
> >>Shouldn't can_ml_priv and vxcan_priv not be similar?
> >>Where is the dev_rcv_lists in the vxcan case?
> >
> >I indeed got completely lost. vxcan_priv & can_ml_priv form together the
> >private part. I continue looking
> 
> I added some more debug output:
> 
> @@ -463,6 +463,10 @@ int can_rx_register(struct net *net, struct net_device
> *dev, canid_t can_id,
>         spin_lock_bh(&net->can.rcvlists_lock);
> 
>         dev_rcv_lists = can_dev_rcv_lists_find(net, dev);
> +       if (!dev_rcv_lists) {
> +               pr_err("dev_rcv_lists == NULL! %p (%s)\n", dev, dev->name);
> +               goto out_unlock;
> +       }
>         rcv_list = can_rcv_list_find(&can_id, &mask, dev_rcv_lists);
> 
>         rcv->can_id = can_id;
> 
> 
> and the output becomes:
> 
> [ 1814.644087] bond5130: (slave vxcan1): The slave device specified does not
> support setting the MAC address
> [ 1814.644106] bond5130: (slave vxcan1): Error -22 calling dev_set_mtu
> [ 1814.648867] bond5128: (slave vxcan1): The slave device specified does not
> support setting the MAC address
> [ 1814.648904] bond5128: (slave vxcan1): Error -22 calling dev_set_mtu
> [ 1814.649124] dev_rcv_lists == NULL! 000000008e41fb06 (bond5128)
> [ 1814.696420] bond5129: (slave vxcan1): The slave device specified does not
> support setting the MAC address
> [ 1814.696438] bond5129: (slave vxcan1): Error -22 calling dev_set_mtu
> 
> So it's not the vxcan1 netdev that causes the issue but (sporadically!!) the
> bonding netdev.
> 
> Interesting enough that the bonding device bond5128 obviously passes the
> 
>        if (dev && dev->type != ARPHRD_CAN)
>                 return -ENODEV;
> test.
> 
> ?!?
Did you consider my hypothesis I sent you (at 20h22 tonight)?
I don't personally understand all the locks around networking, but your
observation acks my theory of race condition.

> 
> Regards,
> Oliver

      reply	other threads:[~2020-01-21 19:47 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-17 13:46 general protection fault in can_rx_register syzbot
2020-01-17 20:02 ` Oliver Hartkopp
2020-01-20  9:11   ` Kurt Van Dijck
2020-01-20  9:22     ` Dmitry Vyukov
2020-01-20 22:02       ` Oliver Hartkopp
2020-01-20 22:35         ` Oliver Hartkopp
2020-01-21  8:30           ` Kurt Van Dijck
2020-01-21  8:35             ` Kurt Van Dijck
2020-01-21 18:54             ` Kurt Van Dijck
2020-01-21 19:28               ` Oliver Hartkopp
2020-01-21 19:47                 ` Kurt Van Dijck [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=20200121194711.GD13462@x1.vandijck-laurijssen.be \
    --to=dev.kurt@vandijck-laurijssen.be \
    --cc=davem@davemloft.net \
    --cc=dvyukov@google.com \
    --cc=linux-can@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=netdev@vger.kernel.org \
    --cc=o.rempel@pengutronix.de \
    --cc=socketcan@hartkopp.net \
    --cc=syzbot+c3ea30e1e2485573f953@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    /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).