Linux IIO development
 help / color / mirror / Atom feed
From: Tzung-Bi Shih <tzungbi@kernel.org>
To: Jonathan Cameron <jic23@kernel.org>
Cc: bleung@chromium.org, groeck@chromium.org, lars@metafoo.de,
	chrome-platform@lists.linux.dev, gwendal@chromium.org,
	linux-iio@vger.kernel.org, dianders@chromium.org,
	swboyd@chromium.org, stable@vger.kernel.org
Subject: Re: [PATCH] iio: cros_ec: fix an use-after-free in cros_ec_sensors_push_data()
Date: Tue, 29 Aug 2023 11:09:18 +0800	[thread overview]
Message-ID: <ZO1hXo7J02w8sv0T@google.com> (raw)
In-Reply-To: <20230828115359.054dc13a@jic23-huawei>

On Mon, Aug 28, 2023 at 11:53:59AM +0100, Jonathan Cameron wrote:
> Can we use iio_device_claim_buffer_mode() here?  I believe that has the right handling
> even though I don't think we've used it to protect iio_push_* before.  Normally it's about
> enforcing we stay in the mode if the read out of a channel needs to be handled differently
> in a read_raw() callback.
> 
> if (iio_device_claim_buffer_mode(indio_dev) < 0) {
> 	/* Not in buffer mode so fine to drop out - we got -EBUSY*/
> 	return 0;
> }
> //Otherwise mlock is held - though that's an implementation detail all we care about is we can't exit buffer mode.
> ...
> iio_push_...
> iio_device_release_buffer_mode(indio_dev);
> return 0;

Ack, fix it in v2(https://patchwork.kernel.org/project/linux-iio/patch/20230829030622.1571852-1-tzungbi@kernel.org/).

      reply	other threads:[~2023-08-29  3:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-28  9:43 [PATCH] iio: cros_ec: fix an use-after-free in cros_ec_sensors_push_data() Tzung-Bi Shih
2023-08-28 10:53 ` Jonathan Cameron
2023-08-29  3:09   ` Tzung-Bi Shih [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=ZO1hXo7J02w8sv0T@google.com \
    --to=tzungbi@kernel.org \
    --cc=bleung@chromium.org \
    --cc=chrome-platform@lists.linux.dev \
    --cc=dianders@chromium.org \
    --cc=groeck@chromium.org \
    --cc=gwendal@chromium.org \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=swboyd@chromium.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