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: <ZN4pZqowqDLmst5Y@smile.fi.intel.com>
Date:   Thu, 17 Aug 2023 17:06:30 +0300
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Peng Fan <peng.fan@....com>
Cc:     "Peng Fan (OSS)" <peng.fan@....nxp.com>,
        "robh+dt@...nel.org" <robh+dt@...nel.org>,
        "krzysztof.kozlowski+dt@...aro.org" 
        <krzysztof.kozlowski+dt@...aro.org>,
        "conor+dt@...nel.org" <conor+dt@...nel.org>,
        "frowand.list@...il.com" <frowand.list@...il.com>,
        "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] of/platform: increase refcount of fwnode

On Thu, Aug 17, 2023 at 01:13:01PM +0000, Peng Fan wrote:
> > On Thu, Aug 17, 2023 at 01:57:39PM +0300, Andy Shevchenko wrote:
> > > On Sat, Aug 12, 2023 at 08:24:11PM +0800, Peng Fan (OSS) wrote:

...

> > > > -	device_set_node(&dev->dev, of_fwnode_handle(node));
> > > > +	device_set_node(&dev->dev, fwnode_handle_get(fwnode));
> > >
> > > Ditto.
> > 
> > Actually no, amba_device_alloc() does not use platform_device_alloc() and
> > defines it's own .release method. There is no reference count drop there
> > AFAICS.
> 
> My test only covers platform device, so ..
> 
> But I have a general question here. Since of_amba_device_create will use
> the of_node or fwnode, shouldn't the refcount_t be increased and released
> in amba device release?

I believe so.
Basically we need two changes:
1) this one with the suggested modifications, and
2) fix the reference count leak in amba release.

-- 
With Best Regards,
Andy Shevchenko


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ