]> git.baikalelectronics.ru Git - kernel.git/commit
autofs4: Do not potentially dereference NULL pointer returned by fget() in autofs_dev...
authorJesper Juhl <jj@chaosbits.net>
Thu, 24 Mar 2011 17:51:37 +0000 (01:51 +0800)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 24 Mar 2011 18:54:35 +0000 (14:54 -0400)
commit7ebebca7939706bfdd6bd226faa18ae5b98f1092
tree9350ad63804b66df6f94781335d509aa5ae8f557
parent731fdeecb624dc6dc0d3095e850bb9fa3a4827c4
autofs4: Do not potentially dereference NULL pointer returned by fget() in autofs_dev_ioctl_setpipefd()

In fs/autofs4/dev-ioctl.c::autofs_dev_ioctl_setpipefd() we call fget(),
which may return NULL, but we do not explicitly test for that NULL return
so we may end up dereferencing a NULL pointer - bad.

When I originally submitted this patch I had chosen EBUSY as the return
value to use if this happens. Ian Kent was kind enough to explain why that
would most likely be wrong and why EBADF should most likely be used
instead. This version of the patch uses EBADF.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Ian Kent <raven@themaw.net>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/autofs4/dev-ioctl.c