提交 1c9fec47 编写于 作者: K Kees Cook 提交者: Linus Torvalds

waitid(): Avoid unbalanced user_access_end() on access_ok() error

As pointed out by Linus and David, the earlier waitid() fix resulted in
a (currently harmless) unbalanced user_access_end() call.  This fixes it
to just directly return EFAULT on access_ok() failure.

Fixes: 96ca579a ("waitid(): Add missing access_ok() checks")
Acked-by: NDavid Daney <david.daney@cavium.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: NKees Cook <keescook@chromium.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 9a27ded2
......@@ -1611,7 +1611,7 @@ SYSCALL_DEFINE5(waitid, int, which, pid_t, upid, struct siginfo __user *,
return err;
if (!access_ok(VERIFY_WRITE, infop, sizeof(*infop)))
goto Efault;
return -EFAULT;
user_access_begin();
unsafe_put_user(signo, &infop->si_signo, Efault);
......@@ -1739,7 +1739,7 @@ COMPAT_SYSCALL_DEFINE5(waitid,
return err;
if (!access_ok(VERIFY_WRITE, infop, sizeof(*infop)))
goto Efault;
return -EFAULT;
user_access_begin();
unsafe_put_user(signo, &infop->si_signo, Efault);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册