]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
gpio: cdev: sanitize the label before requesting the interrupt
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Mon, 25 Mar 2024 09:02:42 +0000 (10:02 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Apr 2024 14:35:47 +0000 (16:35 +0200)
commit21bc9b158983992b0709222c60f4bc749919a93d
tree9a1b17f9247d587941baa6daf6ae057ebbd36618
parenta2671601fa020a124fe9c7d181bf9c9faf17011a
gpio: cdev: sanitize the label before requesting the interrupt

commit b34490879baa847d16fc529c8ea6e6d34f004b38 upstream.

When an interrupt is requested, a procfs directory is created under
"/proc/irq/<irqnum>/<label>" where <label> is the string passed to one of
the request_irq() variants.

What follows is that the string must not contain the "/" character or
the procfs mkdir operation will fail. We don't have such constraints for
GPIO consumer labels which are used verbatim as interrupt labels for
GPIO irqs. We must therefore sanitize the consumer string before
requesting the interrupt.

Let's replace all "/" with ":".

Cc: stable@vger.kernel.org
Reported-by: Stefan Wahren <wahrenst@gmx.net>
Closes: https://lore.kernel.org/linux-gpio/39fe95cb-aa83-4b8b-8cab-63947a726754@gmx.net/
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Kent Gibson <warthog618@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpio/gpiolib-cdev.c