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] [thread-next>] [day] [month] [year] [list]
Message-ID: <TY2PR01MB3692A94CD6479F2976458B0FD84E0@TY2PR01MB3692.jpnprd01.prod.outlook.com>
Date:   Fri, 31 Jul 2020 06:43:17 +0000
From:   Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>
To:     Sergei Shtylyov <sergei.shtylyov@...il.com>,
        Yuusuke Ashizuka <ashiduka@...itsu.com>
CC:     "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "linux-renesas-soc@...r.kernel.org" 
        <linux-renesas-soc@...r.kernel.org>
Subject: RE: [PATCH v2] ravb: Fixed the problem that rmmod can not be done

Hello!

> From: Sergei Shtylyov, Sent: Friday, July 31, 2020 1:24 AM
> 
> Hello!
> 
> On 7/30/20 2:37 PM, Yoshihiro Shimoda wrote:
> 
> >> From: Yuusuke Ashizuka, Sent: Thursday, July 30, 2020 7:02 PM
> >> Subject: [PATCH v2] ravb: Fixed the problem that rmmod can not be done
> >
> > Thank you for the patch! I found a similar patch for another driver [1].
> 
>    It's not the same case -- that driver hadn't had the MDIO release code at all
> before that patch.

You're correct. I didn't realized it...

> > So, we should apply this patch to the ravb driver.
> 
>    I believe the driver is innocent. :-)

I hope so :)

<snip>
> >> $ lsmod
> >> Module                  Size  Used by
> >> ravb                   40960  1
> >> $ rmmod ravb
> >> rmmod: ERROR: Module ravb is in use
> 
>    Shouldn't the driver core call the remove() method for the affected devices
> first, before checking the refcount?

In this case, an mii bus of "mdiobb_ops bb_ops" is affected "device" by the ravb driver.
And the ravb driver sets the owner of mii bus as THIS_MODULE like below:

static struct mdiobb_ops bb_ops = {
        .owner = THIS_MODULE,
        .set_mdc = ravb_set_mdc,
        .set_mdio_dir = ravb_set_mdio_dir,
        .set_mdio_data = ravb_set_mdio_data,
        .get_mdio_data = ravb_get_mdio_data,
};

So, I don't think the driver core can call the remove() method for the mii bus
because it's a part of the ravb driver...

By the way, about the mdio-gpio driver, I'm wondering if the mdio-gpio
driver cannot be removed by rmmod too. (perhaps, we need "rmmod -f" to remove it.)

> >> Fixed to execute mdio_init() at open and free_mdio() at close, thereby rmmod is
> >
> > I think "Fixed to call ravb_mdio_init() at open and ravb_mdio_release() ..." is better.
> > However, I'm not sure whether that Sergei who is the reviwer of this driver accepts
> > the descriptions which I suggested though :)
> 
>    The language barrier isn't the only obstacle. :-)

I agree with you :)

> > By the way, I think you have to send this patch to the following maintainers too:
> > # We can get it by using scripts/get_maintainers.pl.
> > David S. Miller <davem@...emloft.net> (maintainer:NETWORKING DRIVERS,commit_signer:8/8=100%)
> > Jakub Kicinski <kuba@...nel.org> (maintainer:NETWORKING DRIVERS)
> >
> > Best regards,
> > Yoshihiro Shimoda
> 
>    For the future, please trim your reply before the patch starts as you
> don't comment on the patch itself anyway...

Oops, I'm sorry. I'll do that for the future.

Best regards,
Yoshihiro Shimoda

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ