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: <YLDNKekDfNQPorRG@smile.fi.intel.com>
Date:   Fri, 28 May 2021 13:59:53 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Pavel Machek <pavel@....cz>
Cc:     Amireddy Mallikarjuna reddy <mallikarjunax.reddy@...ux.intel.com>,
        Linus Walleij <linus.walleij@...aro.org>,
        Marek BehĂșn <marek.behun@....cz>,
        Abanoub Sameh <abanoubsameh8@...il.com>,
        Dan Murphy <dmurphy@...com>,
        Krzysztof Kozlowski <krzk@...nel.org>,
        linux-leds@...r.kernel.org, linux-kernel@...r.kernel.org,
        Luca Weiss <luca@...tu.xyz>
Subject: Re: [PATCH v1 28/28] leds: sgm3140: Put fwnode in any case during
 ->probe()

On Fri, May 28, 2021 at 12:14:54PM +0200, Pavel Machek wrote:
> Hi!
> 
> > fwnode_get_next_child_node() bumps a reference counting of a returned variable.
> > We have to balance it whenever we return to the caller.
> 
> This (and similar) -- in half of the drivers we hold the handle from
> successful probe. Is it a problem and why is it problem only for some
> drivers?

Hmm... I'm not sure I have understood the question correctly. Any examples of
the driver that you think needs some attention?

In general the idea is that these kind of for-loops or getting next fwnode
should be balanced.

In case of for-loops the error or any other breakage means that reference count
is bumped, for the get_next API it's always the case.

I have checked between drivers and only considered above cases. Wherever there
is a for-loop which isn't broken, we are fine. Wherever we have explicit
reference counter drop for get_next cases, we are fine. If (any) framework
requires the resource to be present that framework should bump and drop
reference count on the resource by itself (so I split LED framework out from
the consideration and consider that it does the right things)

> Thanks for series, btw, I pushed out current version of the tree.

Should I rebase the new version on something I can find in your Git tree?

-- 
With Best Regards,
Andy Shevchenko


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ