[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VcHqqu+gJA-7Kz+eFu_CCh13SyNmvUC0E2Rp3ucLhUmqA@mail.gmail.com>
Date: Fri, 30 May 2025 22:51:17 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: David Lechner <dlechner@...libre.com>
Cc: Sean Nyekjaer <sean@...nix.com>, Jonathan Cameron <jic23@...nel.org>, Nuno Sá <nuno.sa@...log.com>,
Jonathan Cameron <Jonathan.Cameron@...wei.com>, linux-iio@...r.kernel.org,
linux-kernel@...r.kernel.org, stable@...r.kernel.org
Subject: Re: [PATCH] iio: accel: fxls8962af: Fix use after free in fxls8962af_fifo_flush
On Fri, May 30, 2025 at 8:57 PM David Lechner <dlechner@...libre.com> wrote:
> On 5/30/25 12:51 PM, Andy Shevchenko wrote:
> > On Thu, May 29, 2025 at 01:49:16PM -0500, David Lechner wrote:
> >> On 5/29/25 1:16 PM, Andy Shevchenko wrote:
> >>> On Thu, May 29, 2025 at 7:02 PM David Lechner <dlechner@...libre.com> wrote:
> >>>> On 5/24/25 5:34 AM, Sean Nyekjaer wrote:
...
> >>>> fxls8962af_suspend() calls enable_irq_wake(data->irq); before disabling the
> >>>> interrupt by calling fxls8962af_buffer_predisable(indio_dev);
> >>>>
> >>>> It seems like the order should be reversed.
> >>>
> >>> AFAIU the wake capability of IRQ line is orthogonal to the interrupt
> >>> controller enabling (unmasking) / disabling (masking) the line itself.
> >>> Or did you mean something else?
> >>
> >> I don't know enough about how suspend/wake stuff works to say for sure.
> >>
> >> I just saw the comment:
> >>
> >> /*
> >> * Disable buffer, as the buffer is so small the device will wake
> >> * almost immediately.
> >> */
> >>
> >> so I assumed someone had observed something like this happening already.
> >> If an interrupt occurs between enable_irq_wake() and actually
> >> going into a low power mode, what effect does it have? I ask because I
> >> don't know.
> >
> > To be a "wake source" means to be capable of signaling to the system that wake
> > is needed. If an event comes after enabling an IRQ line to be a wake source,
> > that should wakeup the system (independently if that IRQ line is disabled or
> > not on the IRQ controller side).
>
> OK, more clear now.
FWIW, https://elixir.bootlin.com/linux/v6.15/source/kernel/irq/manage.c#L887
> So I should have been more specific with my previous
> comment. When I said, "before disabling the interrupt", I didn't mean
> calling disable_irq(). I meant disabling the actual output pin on the
> accelerometer chip.
Ah, in that case it's of course a different case.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists