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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20181002230038.GA11102@kroah.com>
Date:   Tue, 2 Oct 2018 16:00:38 -0700
From:   Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To:     Sebastian Reichel <sebastian.reichel@...labora.com>
Cc:     Sebastian Reichel <sre@...nel.org>,
        Pali Rohár <pali.rohar@...il.com>,
        Milo Kim <milo.kim@...com>,
        Andreas Dannenberg <dannenberg@...com>,
        Krzysztof Kozlowski <k.kozlowski@...sung.com>,
        Hans de Goede <hdegoede@...hat.com>,
        Liam Breck <kernel@...workimprov.net>,
        linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org
Subject: Re: [PATCHv1 00/14] power: supply: Fix custom sysfs attribute
 registration

On Mon, Oct 01, 2018 at 12:03:35AM +0200, Sebastian Reichel wrote:
> Hi,
> 
> Udev may not detect sysfs attributes, that have been added
> after the device has been created. Code doing that is racy [0].
> The power-supply class properly registers its attributes
> when the device is created, but some drivers add additional
> custom attributes in a racy way.
> 
> The first patch from this series adds native support for custom
> sysfs attributes to the power-supply subsystem. This feature
> allows cleaner code and avoids a race condition preventing udev
> from noticing the custom properties.
> 
> The following patches replace all instances of sysfs_create_*
> in drivers/power/supply to use the new feature and a couple
> of small cleanups.
> 
> TL;DR: This patchsets replaces all sysfs_create_* in power-supply.
> 
> [0] http://kroah.com/log/blog/2013/06/26/how-to-create-a-sysfs-file-correctly/
> 
> -- Sebastian
> 
> Sebastian Reichel (14):
>   power: supply: core: add support for custom sysfs attributes
>   power: supply: bq2415x: fix race-condition in sysfs registration
>   power: supply: ds2780: fix race-condition in sysfs registration
>   power: supply: ds2781: fix race-condition in sysfs registration
>   power: supply: lp8788: fix race-condition in sysfs registration
>   power: supply: bq24190_charger: fix race-condition in sysfs
>     registration
>   power: supply: bq24257: fix race-condition in sysfs registration
>   power: supply: charger-manager: simplify generation of sysfs attribute
>     group name
>   power: supply: charger-manager: fix race-condition in sysfs
>     registration
>   power: supply: pcf50633: fix race-condition in sysfs registration
>   power: supply: ds2780: fix race-condition in bin attribute
>     registration
>   power: supply: ds2781: fix race-condition in bin attribute
>     registration
>   power: supply: ds2780: switch to devm_power_supply_register
>   power: supply: ds2781: switch to devm_power_supply_register
> 
>  drivers/power/supply/bq2415x_charger.c   | 119 ++++++++++-------------
>  drivers/power/supply/bq24190_charger.c   |  43 ++------
>  drivers/power/supply/bq24257_charger.c   |  15 +--
>  drivers/power/supply/charger-manager.c   |  62 +++++-------
>  drivers/power/supply/ds2780_battery.c    |  87 +++++------------
>  drivers/power/supply/ds2781_battery.c    |  82 +++++-----------
>  drivers/power/supply/lp8788-charger.c    |  62 +++++-------
>  drivers/power/supply/pcf50633-charger.c  |  17 ++--
>  drivers/power/supply/power_supply_core.c |   1 +
>  include/linux/power/charger-manager.h    |   3 +-
>  include/linux/power_supply.h             |   3 +
>  11 files changed, 172 insertions(+), 322 deletions(-)

Nice work, and it removes more code than it adds, always a win.

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ