]> 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:36:02 +0000 (16:36 +0200)
commit2f0262ac3a8cd27811e88790f0aadae866047aea
tree08e5215f93f8deb94ee9de04e24c9250926e93ca
parentd9f0804ab0b888e809ead50f0ae5da0b4cfc07b1
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