linux-stable/include/linux/gpio
Muchun Song 18534df419 gpiolib: Fix possible use after free on label
gpiod_request_commit() copies the pointer to the label passed as
an argument only to be used later. But there's a chance the caller
could immediately free the passed string(e.g., local variable).
This could trigger a use after free when we use gpio label(e.g.,
gpiochip_unlock_as_irq(), gpiochip_is_requested()).

To be on the safe side: duplicate the string with kstrdup_const()
so that if an unaware user passes an address to a stack-allocated
buffer, we won't get the arbitrary label.

Also fix gpiod_set_consumer_name().

Signed-off-by: Muchun Song <smuchun@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2018-11-05 08:54:42 +01:00
..
aspeed.h gpio: aspeed: Add interfaces for co-processor to grab GPIOs 2018-07-02 16:10:15 +02:00
consumer.h gpiolib: Fix possible use after free on label 2018-11-05 08:54:42 +01:00
driver.h gpio: drop devm_gpiochip_remove() 2018-11-05 08:54:42 +01:00
gpio-reg.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
machine.h gpiolib: add hogs support for machine code 2018-05-16 14:35:24 +02:00