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]
Message-ID: <20220607165438.d4txhgccxfojlstv@CAB-WSD-L081021.sigma.sbrf.ru>
Date:   Tue, 7 Jun 2022 16:54:35 +0000
From:   Dmitry Rokosov <DDRokosov@...rdevices.ru>
To:     Andy Shevchenko <andy.shevchenko@...il.com>
CC:     "robh+dt@...nel.org" <robh+dt@...nel.org>,
        "jic23@...nel.org" <jic23@...nel.org>,
        "lars@...afoo.de" <lars@...afoo.de>,
        "noname.nuno@...il.com" <noname.nuno@...il.com>,
        "linux-iio@...r.kernel.org" <linux-iio@...r.kernel.org>,
        kernel <kernel@...rdevices.ru>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] iio: trigger: warn about non-registered iio trigger
 getting attempt

Hello Andy,

Thank you for the quick reply.

On Mon, Jun 06, 2022 at 02:42:18PM +0200, Andy Shevchenko wrote:
> On Mon, Jun 6, 2022 at 1:23 PM Dmitry Rokosov <DDRokosov@...rdevices.ru> wrote:
> >
> > As a part of patch series about wrong trigger register() and get()
> > calls order in the some IIO drivers trigger initialization path:
> >
> > https://lore.kernel.org/all/20220524181150.9240-1-ddrokosov@sberdevices.ru/
> >
> > runtime WARN() is added to alarm IIO driver authors who make such
> > a mistake.
> >
> > When IIO driver allocates a new IIO trigger, it should register it before
> 
> an IIO
> 
> > calling the get() operation. In other words, each IIO driver must abide by
> > IIO trigger alloc()/register()/get() calls order.
> 
> I believe triggers usually acquired at ->probe() time, means that in
> case if the following code (however, I believe it will be quite rare)
> goes into deferred probe cycle the WARN will be repeated. Perhaps
> WARN_ONCE() ?

You are totally right. I've tested deferred probing using -EPROBE_DEFER
injection to probe() code path and WARN() was called each time. I'll fix
it in the v3 as you suggested.

-- 
Thank you,
Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ