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:   Sat, 13 Feb 2021 15:52:06 +0100
From:   Hans de Goede <>
To:     Greg Kroah-Hartman <>
Cc:     Matti Vaittinen <>,, "Rafael J. Wysocki" <>,
        MyungJoo Ham <>,
        Chanwoo Choi <>,
        Andy Gross <>,
        Bjorn Andersson <>,
        Jean Delvare <>,
        Guenter Roeck <>,
        Mark Gross <>,
        Sebastian Reichel <>,
        Chen-Yu Tsai <>,
        Liam Girdwood <>,
        Mark Brown <>,
        Wim Van Sebroeck <>,
        Saravana Kannan <>,
        Heikki Krogerus <>,
        Andy Shevchenko <>,
        Joerg Roedel <>,
        Dan Williams <>,
        Bartosz Golaszewski <>,,,,,,
Subject: Re: [RFC PATCH 1/7] drivers: base: Add resource managed version of
 delayed work init


On 2/13/21 3:38 PM, Hans de Goede wrote:
> Hi,
> On 2/13/21 2:33 PM, Greg Kroah-Hartman wrote:


> Having this new devm_delayed_work_autocancel() helper will allow a
> bunch of drivers to move away from mixing the 2, which is a good thing
> in my book.
> As I said above I believe that having devm_delayed_work_autocancel() (1)
> in our toolbox will be a good thing to have. Driver authors can then choose
> to use it; or they can choose to not use it if they don't like it.
> I know that the reason why I did not use it in the
> drivers/extcon/extcon-intel-int3496.c driver is because it was not available
> if it had been available then I would definitely have used it, as it avoids the
> mixing of resource-management styles which that driver is currently doing.
> And I think that that is what this is ultimately about, there are 2 styles
> of resource-management:
> 1. manual
> 2. devm based
> And they both have their pros and cons, problems mostly arise when mixing them
> and adding new devm helpers for commonly used cleanup patterns is a good thing
> as it helps to get rid of mixing these 2 styles in a single driver.

I just noticed that I forgot to fill in the (1) footnote above:

1) And we probably will want one for non delayed work items to: devm_work_autocancel(),
but lets cross that bridge when we get there.

Also when reviewing: "[RFC PATCH 2/7] extconn: Clean-up few drivers by using managed work init"
I noticed that the extcon-qcom-spmi-misc.c and extcon-palmas.c follow the same standard
pattern of having an IRQ which queues a delayed work and they both miss the devm_free_irq
call before the cancel_delayed_work_sync() on driver release. So just patch 2/7 here
fixes 3 driver-release race conditions (fixing 3/4 drivers which it touches) as a
bonus to the code-cleanup which it does.

So as this clearly seems to be fixing a bunch of bugs, by simply completely removing the
buggy code driver remove callbacks, this really seems like a good idea to me.



Powered by blists - more mailing lists