lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200121194711.GD13462@x1.vandijck-laurijssen.be>
Date:   Tue, 21 Jan 2020 20:47:11 +0100
From:   Kurt Van Dijck <dev.kurt@...dijck-laurijssen.be>
To:     Oliver Hartkopp <socketcan@...tkopp.net>
Cc:     Dmitry Vyukov <dvyukov@...gle.com>,
        Marc Kleine-Budde <mkl@...gutronix.de>,
        o.rempel@...gutronix.de,
        syzbot <syzbot+c3ea30e1e2485573f953@...kaller.appspotmail.com>,
        David Miller <davem@...emloft.net>, linux-can@...r.kernel.org,
        LKML <linux-kernel@...r.kernel.org>,
        netdev <netdev@...r.kernel.org>,
        syzkaller-bugs <syzkaller-bugs@...glegroups.com>
Subject: Re: general protection fault in can_rx_register

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ