mbox series

[v2,0/2] gpio: cdev: label sanitization fixes

Message ID 20240404093328.21604-1-brgl@bgdev.pl
Headers show
Series gpio: cdev: label sanitization fixes | expand

Message

Bartosz Golaszewski April 4, 2024, 9:33 a.m. UTC
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

This series fixes a couple of bugs in the sanitization of labels
being passed to irq.

Patch 1 fixes the case where userspace provides empty labels.

Patch 2 fixes a missed path in the sanitization changes that can result
in memory corruption.

v1 -> v2:
- switched the order of the patches in order to avoid introducing buggy
  code in one just to fix it in the second

Bartosz Golaszewski (1):
  gpio: cdev: check for NULL labels when sanitizing them for irqs

Kent Gibson (1):
  gpio: cdev: fix missed label sanitizing in debounce_setup()

 drivers/gpio/gpiolib-cdev.c | 46 +++++++++++++++++++++++++------------
 1 file changed, 31 insertions(+), 15 deletions(-)

Comments

Bartosz Golaszewski April 4, 2024, 2:56 p.m. UTC | #1
On Thu, Apr 4, 2024 at 11:33 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
>
> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
>
> This series fixes a couple of bugs in the sanitization of labels
> being passed to irq.
>
> Patch 1 fixes the case where userspace provides empty labels.
>
> Patch 2 fixes a missed path in the sanitization changes that can result
> in memory corruption.
>
> v1 -> v2:
> - switched the order of the patches in order to avoid introducing buggy
>   code in one just to fix it in the second
>
> Bartosz Golaszewski (1):
>   gpio: cdev: check for NULL labels when sanitizing them for irqs
>
> Kent Gibson (1):
>   gpio: cdev: fix missed label sanitizing in debounce_setup()
>
>  drivers/gpio/gpiolib-cdev.c | 46 +++++++++++++++++++++++++------------
>  1 file changed, 31 insertions(+), 15 deletions(-)
>
> --
> 2.40.1
>

I'll go ahead and apply it as the culprit already got upstream and
into stable branches, so let's fix it ASAP. Tomorrow once autobuilders
confirm it's fine, I'll send it to Linus.

Bart