Re: [patch] gpiolib: potential oops on failure path

Linus Walleij
2016-06-18T08:52:52Z

On Fri, Jun 17, 2016 at 11:15 AM, Dan Carpenter
<dan.carpenter@oracle.com> wrote:

> If anon_inode_getfd() fails then "i" is set to GPIOHANDLES_MAX. It
> means that we will read beyond the end of the array and dereference an
> invalid pointer.
>
> Fixes: d7c51b47ac11 ('gpio: userspace ABI for reading/writing GPIO lines')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Ouch, yeah that happens when you request max number of handles, thanks.

Patch applied.