Re: [PATCH 1/2] gpiolib: don't allow userspace to set values of input lines

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jul 16, 2018 at 10:34 AM Bartosz Golaszewski <brgl@xxxxxxxx> wrote:

> User space can currently both read and set values of input lines using
> the character device. This was not allowed by the old sysfs interface
> nor is it a correct behavior.
>
> Check the first descriptor in the set for the OUT flag when asked to
> set values and return -EPERM if the line is input.
>
> Signed-off-by: Bartosz Golaszewski <brgl@xxxxxxxx>

Patch applied! Thanks for fixing this.

>         } else if (cmd == GPIOHANDLE_SET_LINE_VALUES_IOCTL) {
> -               /* TODO: check if descriptors are really output */

I wonder what kind of lazy coder leaves this kind of garbage
behind for others to fix up...

d7c51b47ac11e (Linus Walleij           2016-04-26 10:35:29 +0200  451)
 } else if (cmd == GPIOHANDLE_SET_LINE_VALUES_IOCTL) {
d7c51b47ac11e (Linus Walleij           2016-04-26 10:35:29 +0200  452)
         /* TODO: check if descriptors are really output */
d7c51b47ac11e (Linus Walleij           2016-04-26 10:35:29 +0200  453)
         if (copy_from_user(&ghd, ip, sizeof(ghd)))

Oh that guy.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux