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: <Yw3oR6WhM0O5LQX5@shell.armlinux.org.uk>
Date:   Tue, 30 Aug 2022 11:36:55 +0100
From:   "Russell King (Oracle)" <linux@...linux.org.uk>
To:     "Leizhen (ThunderTown)" <thunder.leizhen@...wei.com>
Cc:     Saravana Kannan <saravanak@...gle.com>,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        patches@...linux.org.uk, Kefeng Wang <wangkefeng.wang@...wei.com>,
        Linus Walleij <linus.walleij@...aro.org>
Subject: Re: [PATCH v2] ARM: Add sanity check for dev->periphid in
 amba_probe()

On Tue, Aug 30, 2022 at 06:31:14PM +0800, Leizhen (ThunderTown) wrote:
> On 2022/8/30 18:07, Russell King (Oracle) wrote:
> > For an amba driver, drv->bus will always be pointing at amba_bustype.
> > That always has a "match" operation. Therefore, the default of '1'
> > above will *never* be used for an AMBA driver.
> > 
> > If drv->bus does not point at amba_bustype, then amba_probe() will
> > not be called for "drv".
> > 
> > Therefore, amba_match() must always be called before amba_probe().
> 
> Oh, I was careless. I think it's drv->match. But the processing flow
> will continue to go to "dev->bus->probe".
> 
> __driver_attach():
>         ret = driver_match_device(drv, dev);
>         if (ret == 0) {
>                 /* no match */
>                 return 0;
>         } else if (ret == -EPROBE_DEFER) {               <------no return in this branch
>                 dev_dbg(dev, "Device match requests probe deferral\n");
>                 dev->can_match = true;
>                 driver_deferred_probe_add(dev);
>         } else if (ret < 0) {
>                 dev_dbg(dev, "Bus failed to match device: %d\n", ret);
>                 return ret;
>         } /* ret > 0 means positive match */
> 
>         ... ...
>         driver_probe_device(drv, dev);
>              ......
>                   dev->bus->probe

And that makes no sense, is an already known issue, and there is a patch
to fix it:

https://lore.kernel.org/all/20220817184026.3468620-1-isaacmanjarres@google.com/

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ