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]
Date:	Mon, 11 Feb 2013 22:30:49 +0000
From:	Grant Likely <grant.likely@...retlab.ca>
To:	Rob Herring <robherring2@...il.com>
Cc:	devicetree-discuss <devicetree-discuss@...ts.ozlabs.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Stephen Warren <swarren@...dotorg.org>
Subject: Re: [PATCH] of: Fix locking when calling of_get_next_available_child()

On Mon, Feb 11, 2013 at 10:27 PM, Rob Herring <robherring2@...il.com> wrote:
> On 02/11/2013 04:19 PM, Grant Likely wrote:
>> of_get_next_available_child() obtains the devtree_lock and then calls
>> of_device_is_available() which also attempts to claim the lock. This is
>> obviously incorrect and causes a deadlock on boot. Fix issue by adding
>> an variant of of_device_is_available() which doesn't obtain the lock.
>>
>> Cc: Stephen Warren <swarren@...dotorg.org>
>> Cc: Rob Herring <robherring2@...il.com>
>> Signed-off-by: Grant Likely <grant.likely@...retlab.ca>
>> ---
>>  drivers/of/base.c |   15 +++++++++++++--
>>  1 file changed, 13 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/of/base.c b/drivers/of/base.c
>> index e8d65af..4af74b7 100644
>> --- a/drivers/of/base.c
>> +++ b/drivers/of/base.c
>> @@ -297,7 +297,7 @@ EXPORT_SYMBOL(of_machine_is_compatible);
>>   *  Returns 1 if the status property is absent or set to "okay" or "ok",
>>   *  0 otherwise
>>   */
>> -int of_device_is_available(const struct device_node *device)
>> +int __of_device_is_available(const struct device_node *device)
>>  {
>>       const char *status;
>>       int statlen;
>> @@ -313,6 +313,17 @@ int of_device_is_available(const struct device_node *device)
>>
>>       return 0;
>>  }
>> +
>> +int of_device_is_available(const struct device_node *device)
>
> Stephen's version wins because he preserved the documentation. :)

Pish. He just cut and paste the documentation so now we have 2 copies.
My version wins because it is already in my tree. So ptfff!

:-)

g.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ