提交 cdf53441 编写于 作者: K Kay Sievers 提交者: Linus Torvalds

kmsg: /dev/kmsg - properly return possible copy_from_user() failure

Reported-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NKay Sievers <kay@vrfy.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 5353cf08
......@@ -389,8 +389,10 @@ static ssize_t devkmsg_writev(struct kiocb *iocb, const struct iovec *iv,
line = buf;
for (i = 0; i < count; i++) {
if (copy_from_user(line, iv[i].iov_base, iv[i].iov_len))
if (copy_from_user(line, iv[i].iov_base, iv[i].iov_len)) {
ret = -EFAULT;
goto out;
}
line += iv[i].iov_len;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册