[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAeHK+y3eQ7bXvo1tiAkwLCsFkbSU5B+6hsKbdEzkSXP2_Jyzg@mail.gmail.com>
Date: Thu, 5 Sep 2019 13:24:21 +0200
From: Andrey Konovalov <andreyknvl@...gle.com>
To: Hui Peng <benquike@...il.com>
Cc: Stephen Hemminger <stephen@...workplumber.org>,
syzbot+44d53c7255bb1aea22d2@...kaller.appspotmail.com,
alexios.zavras@...el.com, "David S. Miller" <davem@...emloft.net>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
LKML <linux-kernel@...r.kernel.org>,
USB list <linux-usb@...r.kernel.org>,
Mathias Payer <mathias.payer@...elwelt.net>,
netdev <netdev@...r.kernel.org>, rfontana@...hat.com,
syzkaller-bugs <syzkaller-bugs@...glegroups.com>,
Thomas Gleixner <tglx@...utronix.de>,
Oliver Neukum <oneukum@...e.com>
Subject: Re: WARNING in hso_free_net_device
On Thu, Sep 5, 2019 at 4:20 AM Hui Peng <benquike@...il.com> wrote:
>
> Can you guys have a look at the attached patch?
Let's try it:
#syz test: https://github.com/google/kasan.git eea39f24
FYI: there are two more reports coming from this driver, which might
(or might not) have the same root cause. One of them has a suggested
fix by Oliver.
https://syzkaller.appspot.com/bug?extid=67b2bd0e34f952d0321e
https://syzkaller.appspot.com/bug?extid=93f2f45b19519b289613
>
> On 9/4/19 6:41 PM, Stephen Hemminger wrote:
> > On Wed, 4 Sep 2019 16:27:50 -0400
> > Hui Peng <benquike@...il.com> wrote:
> >
> >> Hi, all:
> >>
> >> I looked at the bug a little.
> >>
> >> The issue is that in the error handling code, hso_free_net_device
> >> unregisters
> >>
> >> the net_device (hso_net->net) by calling unregister_netdev. In the
> >> error handling code path,
> >>
> >> hso_net->net has not been registered yet.
> >>
> >> I think there are two ways to solve the issue:
> >>
> >> 1. fix it in drivers/net/usb/hso.c to avoiding unregistering the
> >> net_device when it is still not registered
> >>
> >> 2. fix it in unregister_netdev. We can add a field in net_device to
> >> record whether it is registered, and make unregister_netdev return if
> >> the net_device is not registered yet.
> >>
> >> What do you guys think ?
> > #1
View attachment "0001-Fix-a-wrong-unregistering-bug-in-hso_free_net_device.patch" of type "text/x-patch" (2399 bytes)
Powered by blists - more mailing lists