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]
Date:   Thu, 18 Feb 2021 09:58:15 -0800
From:   Saravana Kannan <saravanak@...gle.com>
To:     "Rafael J. Wysocki" <rafael@...nel.org>
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Geert Uytterhoeven <geert@...ux-m68k.org>,
        "Cc: Android Kernel" <kernel-team@...roid.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] driver core: Avoid pointless deferred probe attempts

On Thu, Feb 18, 2021 at 9:24 AM Saravana Kannan <saravanak@...gle.com> wrote:
>
> On Thu, Feb 18, 2021 at 9:18 AM Rafael J. Wysocki <rafael@...nel.org> wrote:
> >
> > On Thu, Feb 18, 2021 at 12:51 AM Saravana Kannan <saravanak@...gle.com> wrote:
> > >
> > > There's no point in adding a device to the deferred probe list if we
> > > know for sure that it doesn't have a matching driver. So, check if a
> > > device can match with a driver before adding it to the deferred probe
> > > list.
> >
> > What if a matching driver module loads in the meantime?
>
> Driver registration always triggers a match attempt and this flag will
> get set at that point. Yes, the user can disable autoprobe, but
> that'll block deferred probes too.
>

Btw, this can wait for 5.13. Doesn't need to go into 5.12-rcX.

> > > diff --git a/drivers/base/dd.c b/drivers/base/dd.c
> > > index 9179825ff646..f18963f42e21 100644
> > > --- a/drivers/base/dd.c
> > > +++ b/drivers/base/dd.c
> > > @@ -123,6 +123,9 @@ static DECLARE_WORK(deferred_probe_work, deferred_probe_work_func);
> > >
> > >  void driver_deferred_probe_add(struct device *dev)
> > >  {
> > > +       if (!dev->can_match)
> > > +               return;
> > > +

Also, if you are worried about this check, for now, I can move it
inside device_links_driver_bound() which is the only place that
currently adds a device to the deferred probe list before the driver
is present. But it seemed like a good check in general to have in
driver_deferred_probe_add(), so I put it there.

-Saravana

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ