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: <55B93978.9070306@roeck-us.net>
Date:	Wed, 29 Jul 2015 13:37:12 -0700
From:	Guenter Roeck <linux@...ck-us.net>
To:	"Rafael J. Wysocki" <rafael@...nel.org>
CC:	"Moore, Robert" <robert.moore@...el.com>,
	"rjw@...ysocki.net" <rjw@...ysocki.net>,
	"lenb@...nel.org" <lenb@...nel.org>,
	"Zheng, Lv" <lv.zheng@...el.com>,
	"linux-acpi@...r.kernel.org" <linux-acpi@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"devel@...ica.org" <devel@...ica.org>
Subject: Re: [PATCH v2] acpi: Use kstrtoul() instead of strtoul()/simple_strtoul()

On 07/29/2015 01:04 PM, Rafael J. Wysocki wrote:
> Hi Guenter,
>
> On Wed, Jul 29, 2015 at 9:58 PM, Guenter Roeck <linux@...ck-us.net> wrote:
>> On 07/29/2015 12:33 PM, Moore, Robert wrote:
>>>>
>>>> -----Original Message-----
>>>> From: Guenter Roeck [mailto:linux@...ck-us.net]
>>>> Sent: Wednesday, July 29, 2015 11:39 AM
>>>> To: Moore, Robert; rjw@...ysocki.net
>>>> Cc: lenb@...nel.org; Zheng, Lv; linux-acpi@...r.kernel.org; linux-
>>>> kernel@...r.kernel.org; devel@...ica.org
>>>> Subject: Re: [PATCH v2] acpi: Use kstrtoul() instead of
>>>> strtoul()/simple_strtoul()
>>>>
>>>> On 07/29/2015 10:51 AM, Moore, Robert wrote:
>>>>>
>>>>>
>>>>>
>>>>>> -----Original Message-----
>>>>>> From: Guenter Roeck [mailto:linux@...ck-us.net]
>>>>>> Sent: Monday, July 27, 2015 5:32 PM
>>>>>> To: rjw@...ysocki.net
>>>>>> Cc: lenb@...nel.org; Moore, Robert; Zheng, Lv;
>>>>>> linux-acpi@...r.kernel.org; linux-kernel@...r.kernel.org;
>>>>>> devel@...ica.org; Guenter Roeck
>>>>>> Subject: [PATCH v2] acpi: Use kstrtoul() instead of
>>>>>> strtoul()/simple_strtoul()
>>>>>>
>>>>>> simple_strtoul() is deprecated; replace with kstrtoul() and
>>>>
>>>> kstrtouint().
>>>>>
>>>>>
>>>>> The ACPICA code is os-independent and cannot use these functions (at
>>>>
>>>> least not directly).
>>>>>
>>>>>
>>>>>
>>>> Odd argument, given that kstrtoul() is used already in the acpi code.
>>>
>>>
>>> They are not in the os-independent ACPICA code. The ACPI-related drivers
>>> are another story, since they are OS-dendent.
>>>
>>
>> That this OS independent code mandates functions such as strtoul(),
>> which may not exist in a target OS, and that it maps strtoul() to
>> simple_strtoul() in a global include file, doesn't seem to be
>> correct either and is asking for repeated trouble. I would have
>> hoped that at the very least such mappings would be implemented
>> in local include files.
>
> The header is obviously OS-dependent and it does what it does just
> because simple_strtoul() is available and serves the purpose.
>
> As I said in the previous message, the strtoul() used by ACPICA might
> be redefined in terms of kstroul().
>
> And the change in sysfs.c is still OK.  Do you want me to apply this
> change only?
>

Let's step back a bit. The problem I was trying to solve was that
there were two definitions of strtoul(), which caused compile errors
for some builds.

libcfs_string.h 105 #define strtoul(str, endp, base) simple_strtoul(str, endp, base)
aclinux.h       122 #define strtoul simple_strtoul

The first was in lustre code. My patch to remove that definition
has been accepted, so now there is only one such definition left.

Fixing the sysfs code only might make some sense - I'll leave that
up to you - but it doesn't address the problem I was trying to solve,
which is that strtoul() is defined in a global but driver specific include
file (include/linux/...). That definition would still be there and may
cause trouble again if someone else defines strtoul elsewhere for similar
reasons.

A fix might be to move the definition of strtoul from aclinux.h to
some include file in drivers/acpi, but I don't know the code well
enough to know if that is even feasible, or which file to move it to.

Thanks,
Guenter

--
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