Re: [PATCH v4] gpio: prevent potential speculation leaks in gpio_device_get_desc()
From: Bartosz Golaszewski
Date: Mon May 27 2024 - 11:11:51 EST
From: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>
On Thu, 23 May 2024 08:53:32 +0000, Hagar Hemdan wrote:
> Userspace may trigger a speculative read of an address outside the gpio
> descriptor array.
> Users can do that by calling gpio_ioctl() with an offset out of range.
> Offset is copied from user and then used as an array index to get
> the gpio descriptor without sanitization in gpio_device_get_desc().
>
> This change ensures that the offset is sanitized by using
> array_index_nospec() to mitigate any possibility of speculative
> information leaks.
>
> [...]
Applied, thanks!
[1/1] gpio: prevent potential speculation leaks in gpio_device_get_desc()
commit: d795848ecce24a75dfd46481aee066ae6fe39775
Best regards,
--
Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>