]> git.baikalelectronics.ru Git - kernel.git/commit
gpio: GPIO_GET_LINEEVENT_IOCTL: Validate line offset
authorLars-Peter Clausen <lars@metafoo.de>
Tue, 18 Oct 2016 14:54:03 +0000 (16:54 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Fri, 21 Oct 2016 12:41:38 +0000 (14:41 +0200)
commit3dffbb465c51cb8ebc689fe459d9568b75e8e3ea
tree3033c7c4ba27e0a24c1384809decb1ea97653677
parenta38179ad0fbacacc4f48052c47b128bfac1d42c9
gpio: GPIO_GET_LINEEVENT_IOCTL: Validate line offset

The line offset that is used as an index into the descs array is provided
by userspace and might go beyond the bounds of the array. If that happens
undefined behavior will occur.

Make sure that the offset is within the bounds of the desc array and reject
any requests that specify a value outside of it.

Cc: stable@vger.kernel.org
Fixes: ebf3d31cce6a ("gpio: userspace ABI for reading GPIO line events")
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpiolib.c