]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
reset: gpio: suppress bind attributes in sysfs
authorBartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Thu, 4 Dec 2025 09:44:12 +0000 (10:44 +0100)
committerPhilipp Zabel <p.zabel@pengutronix.de>
Mon, 19 Jan 2026 11:16:41 +0000 (12:16 +0100)
This is a special device that's created dynamically and is supposed to
stay in memory forever. We also currently don't have a devlink between
it and the actual reset consumer. Suppress sysfs bind attributes so that
user-space can't unbind the device because - as of now - it will cause a
use-after-free splat from any user that puts the reset control handle.

Fixes: cee544a40e44 ("reset: gpio: Add GPIO-based reset controller")
Cc: stable@vger.kernel.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
drivers/reset/reset-gpio.c

index e5512b3b596b5290af20e5fdd99a38f81e670d2b..626c4c639c15592a7d9675d053d17b19a62a5b0f 100644 (file)
@@ -111,6 +111,7 @@ static struct auxiliary_driver reset_gpio_driver = {
        .id_table       = reset_gpio_ids,
        .driver = {
                .name = "reset-gpio",
+               .suppress_bind_attrs = true,
        },
 };
 module_auxiliary_driver(reset_gpio_driver);