From: Peter Rosin <peda@axentia.se>
To: Matteo Martelli <matteomartelli3@gmail.com>,
Jonathan Cameron <jic23@kernel.org>,
Lars-Peter Clausen <lars@metafoo.de>,
Michael Hennerich <Michael.Hennerich@analog.com>,
Alisa-Dariana Roman <alisa.roman@analog.com>,
Christian Eggers <ceggers@arri.de>,
Paul Cercueil <paul@crapouillou.net>,
Sebastian Reichel <sre@kernel.org>
Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-mips@vger.kernel.org, linux-pm@vger.kernel.org
Subject: Re: [PATCH v2 0/7] iio: fix possible race condition during access of available info lists
Date: Tue, 8 Oct 2024 13:36:48 +0200 [thread overview]
Message-ID: <d1d7b4be-60d7-b9ab-448c-a0d1e23f3daf@axentia.se> (raw)
In-Reply-To: <20241007-iio-read-avail-release-v2-0-245002d5869e@gmail.com>
Hi!
2024-10-07 at 10:37, Matteo Martelli wrote:
> Some iio drivers currently share an available info list buffer that
> might be changed while iio core prints it to sysfs. This could cause the
> buffer shared with iio core to be corrupted. However, note that I was
> able to trigger the race condition only by adding a delay between each
> sysfs_emit_at calls in the iio_format_list() to force the concurrent
> access to the shared available list buffer.
>
> This patch set extends the iio APIs and fixes some affected drivers.
>
> Summary:
> - Patch 1: iio core: introduce a iio info release callback to let
> drivers share a copy of their available info list and later free it.
>
> - Patch 2: pac1921: handle the current scale available info via the
> read_avail+read_avail_release_resource APIs instead of using an ad-hoc
> ext_info attribute. The latter was used to avoid the risk of a race in
> the available list.
>
> - Patch 3,4: ad7192, as73211: fix the possible race in the drivers by
> copying/releasing the affected available lists.
>
> - Patch 5: inkern: make consumers copy and release the available info
> lists of their producers, necessary after patch 1.
>
> - Patch 6,7: iio-mux, iio-rescale, dpot-dac, ingenic-battery: adapt
> consumers to inkern API change by freeing the now copied available
> lists of their producers.
The series not bisectable because of leaks. I'm not certain if a simple
reordering is all that is needed or if some things have to be squashed?
Cheers,
Peter
prev parent reply other threads:[~2024-10-08 11:36 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-07 8:37 [PATCH v2 0/7] iio: fix possible race condition during access of available info lists Matteo Martelli
2024-10-07 8:37 ` [PATCH v2 1/7] iio: core: add read_avail_release_resource callback to fix race Matteo Martelli
2024-10-07 8:37 ` [PATCH v2 2/7] iio: pac1921: use read_avail+release APIs instead of custom ext_info Matteo Martelli
2024-10-07 8:37 ` [PATCH v2 3/7] iio: ad7192: copy/release available filter frequencies to fix race Matteo Martelli
2024-10-07 8:37 ` [PATCH v2 4/7] iio: as73211: copy/release available integration times " Matteo Martelli
2024-10-07 15:44 ` Christian Eggers
2024-10-07 8:37 ` [PATCH v2 5/7] iio: inkern: copy/release available info from producer Matteo Martelli
2024-10-07 15:15 ` Nuno Sá
2024-10-08 6:47 ` Matteo Martelli
2024-10-08 7:29 ` Nuno Sá
2024-10-08 8:03 ` Matteo Martelli
2024-10-08 12:37 ` Nuno Sá
2024-10-09 18:30 ` Matteo Martelli
2024-10-12 15:47 ` Jonathan Cameron
2024-10-12 23:09 ` Matteo Martelli
2024-10-14 6:39 ` Nuno Sá
2024-10-07 8:37 ` [PATCH v2 6/7] iio: consumers: release available info buffer copied " Matteo Martelli
2024-10-07 8:37 ` [PATCH v2 7/7] power: supply: ingenic-battery: free scale buffer after use Matteo Martelli
2024-10-08 11:36 ` Peter Rosin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d1d7b4be-60d7-b9ab-448c-a0d1e23f3daf@axentia.se \
--to=peda@axentia.se \
--cc=Michael.Hennerich@analog.com \
--cc=alisa.roman@analog.com \
--cc=ceggers@arri.de \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=matteomartelli3@gmail.com \
--cc=paul@crapouillou.net \
--cc=sre@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).