Re: [PATCH] gpio: prevent potential speculation leaks in gpio_device_get_desc()

From: Kent Gibson
Date: Thu May 16 2024 - 12:22:51 EST


On Thu, May 16, 2024 at 10:55:40PM +0800, Kent Gibson wrote:
> On Thu, May 16, 2024 at 12:57:42PM +0000, Hagar Hemdan wrote:
> > On Tue, May 14, 2024 at 08:42:21PM +0800, Kent Gibson wrote:
>
> Now I need to test your patch to see what it actually does.
>

Tested. Fails. It does what I thought it would - clamps the offset into
bounds BEFORE the call to gpio_device_get_desc().

The appropriate place for this fix is in gpio_device_get_desc(), after
the bounds check.

Cheers,
Kent.