]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
gpio: cdev: fix missed label sanitizing in debounce_setup()
authorKent Gibson <warthog618@gmail.com>
Thu, 4 Apr 2024 09:33:28 +0000 (11:33 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Apr 2024 14:38:15 +0000 (16:38 +0200)
commitdbba73560e71d4a89eaebbb806744e5b51fc02c0
tree57fb5b2c7ecc51385b8135693a579f86e8b8a807
parent78d014644630fbaf4a35f15b7f49080205973e2d
gpio: cdev: fix missed label sanitizing in debounce_setup()

commit 83092341e15d0dfee1caa8dc502f66c815ccd78a upstream.

When adding sanitization of the label, the path through
edge_detector_setup() that leads to debounce_setup() was overlooked.
A request taking this path does not allocate a new label and the
request label is freed twice when the request is released, resulting
in memory corruption.

Add label sanitization to debounce_setup().

Cc: stable@vger.kernel.org
Fixes: b34490879baa ("gpio: cdev: sanitize the label before requesting the interrupt")
Signed-off-by: Kent Gibson <warthog618@gmail.com>
[Bartosz: rebased on top of the fix for empty GPIO labels]
Co-developed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpio/gpiolib-cdev.c