On Mon, Feb 10, 2025 at 11:52 AM Bartosz Golaszewski brgl@bgdev.pl wrote:
We've had instances of drivers returning invalid values from gpio_chip calbacks. In several cases these return values would be propagated to user-space and confuse programs that only expect 0 or negative errnos from ioctl()s. Let's sanitize the return values of callbacks and make sure we don't allow anyone see invalid ones.
The first patch checks the return values of get_direction() in kernel where needed and is a backportable fix.
Signed-off-by: Bartosz Golaszewski bartosz.golaszewski@linaro.org
This seems reasonable. Reviewed-by: Linus Walleij linus.walleij@linaro.org
Yours, Linus Walleij