The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Maxwell Doose <m32285159@gmail.com>
Cc: "David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"open list:IIO SUBSYSTEM AND DRIVERS" <linux-iio@vger.kernel.org>,
	"open list" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v5] iio: imu: kmx61: Use guard(mutex)() over manual locking
Date: Tue, 12 May 2026 12:17:24 +0100	[thread overview]
Message-ID: <20260512121703.54a7c2aa@jic23-huawei> (raw)
In-Reply-To: <CAKqfh0GHY_WkiLQK3rhDYtvyab-iQdiUmGFHnYjix=K3xLXJ8A@mail.gmail.com>

On Mon, 11 May 2026 12:27:27 -0500
Maxwell Doose <m32285159@gmail.com> wrote:

> On Mon, May 11, 2026 at 12:17 PM Jonathan Cameron <jic23@kernel.org> wrote:
> >
> > On Fri, 8 May 2026 08:03:45 -0500
> > Maxwell Doose <m32285159@gmail.com> wrote:
> >  
> > > Hi Jonathan,
> > >
> > > On Thu, May 7, 2026 at 5:33 PM Maxwell Doose <m32285159@gmail.com> wrote:  
> > > >  
> > > [snip]  
> > > > @@ -945,29 +942,26 @@ static int kmx61_write_event_config(struct iio_dev *indio_dev,
> > > >         if (state && data->ev_enable_state)
> > > >                 return 0;
> > > >
> > > > -       mutex_lock(&data->lock);
> > > > +       guard(mutex)(&data->lock);
> > > >  
> > >
> > > Correct me if I'm wrong but this looks like a TOCTOU race, was
> > > reported by sashiko at
> > > https://sashiko.dev/#/patchset/20260507223337.48437-1-m32285159%40gmail.com.
> > > If this is a confirmed race I'll get a fix out this evening.  
> > Indeed looks like a correct report.
> >
> > Take your time though. I'm swamped anyway so will be a while before
> > I get to any new patches (probably!)
> >  
> 
> Alrighty sounds good. Dunno if we merge this or not and then send the
> fix just in case or if I base it off of the original. Former seems
> preferable.

Given we know about it the fix should go first then this change to guard()
etc based on top of that.

Jonathan

> 
> best regards,
> max
> 
> 
> 
> > >
> > > best regards,
> > > max  
> >  


  reply	other threads:[~2026-05-12 11:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-07 22:33 [PATCH v5] iio: imu: kmx61: Use guard(mutex)() over manual locking Maxwell Doose
2026-05-08 13:03 ` Maxwell Doose
2026-05-11 17:17   ` Jonathan Cameron
2026-05-11 17:27     ` Maxwell Doose
2026-05-12 11:17       ` Jonathan Cameron [this message]
2026-05-12 11:48         ` Maxwell Doose

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=20260512121703.54a7c2aa@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m32285159@gmail.com \
    --cc=nuno.sa@analog.com \
    /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