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: <20200916005553.GF1681290@dtor-ws>
Date:   Tue, 15 Sep 2020 17:55:53 -0700
From:   Dmitry Torokhov <dmitry.torokhov@...il.com>
To:     Krzysztof Kozlowski <krzk@...nel.org>
Cc:     Maxime Ripard <mripard@...nel.org>, Chen-Yu Tsai <wens@...e.org>,
        linux-input@...r.kernel.org,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH v2 1/4] Input: ep93xx_keypad - Fix handling of
 platform_get_irq() error

On Tue, Sep 15, 2020 at 06:05:22PM +0200, Krzysztof Kozlowski wrote:
> On Mon, 14 Sep 2020 at 08:51, Dmitry Torokhov <dmitry.torokhov@...il.com> wrote:
> >
> > Hi Krzysztof,
> >
> > On Fri, Aug 28, 2020 at 04:57:41PM +0200, Krzysztof Kozlowski wrote:
> > > platform_get_irq() returns -ERRNO on error.  In such case comparison
> > > to 0 would pass the check.
> >
> > platform_get_irq() is a bit of a mess. Historically we allowed defining
> > interrupt resource with r->start == 0 and for such cases non-OF non-ACPI
> > code will return 0 from platform_get_irq() to indicate that IRQ is not
> > assigned.
> >
> > We either need to stop doing this in platform_get_irq(), or the
> > conditions in this patch and followups should be "irq <= 0" and we need
> > to make sure we do not accidentally return 0 from probe ...
> 
> Hi,
> 
> It's then contradictory to platform_get_irq documentation which
> explicitly says - zero will not be returned on error. This was also
> clarified in commit e330b9a6bb35 ("platform: don't return 0 from
> platform_get_irq[_byname]() on error").

It was for OF/ACPI, but not for resources described via DEFINE_RES_IRQ
or other means. However I see we added a big fat WARN_ON() in case if we
end up returning 0 still, so I will be applying your patches.

Thanks.

-- 
Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ