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] [day] [month] [year] [list]
Date:	Fri, 10 Jun 2016 07:55:18 -0500
From:	Rob Herring <robh@...nel.org>
To:	Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
Cc:	Grant Likely <grant.likely@...aro.org>,
	"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
	Frank Rowand <frowand.list@...il.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] of: irq: don't return 0 from of_irq_get()

On Fri, Jun 10, 2016 at 7:14 AM, Sergei Shtylyov
<sergei.shtylyov@...entembedded.com> wrote:
> On 6/3/2016 3:14 PM, Rob Herring wrote:
>
>>> of_irq_get() returns 0 iff irq_create_of_mapping() call fails. Returning
>>> both error code  and 0 on failure is a sign of a misdesigned API. Return
>>> -ENXIO instead like one of the callers, platform_get_irq(), does; fix up
>>> the kernel-doc as well...
>>>
>>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
>>
>>
>> So I think this is done this way because of the variation in NO_IRQ
>> definition across architectures.
>
>
>    I remember that NO_IRQ is "considered harmful" by Linus. Actually, I'm
> nit sure what you mean, could you elaborate on that?

Calling locations could handle 0 vs. negative differently. The return
value propagates as well, so you can't easily audit how it is handled.
I'm being paranoid, but we need a better reason than "misdesigned
API". I'm pretty sure we misdesigned it on purpose.

Rob

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ