mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 20:48:49 +08:00
kmsg: /dev/kmsg - properly return possible copy_from_user() failure
Reported-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Kay Sievers <kay@vrfy.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
5353cf089b
commit
cdf5344136
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user