diff options
author | Kay Sievers <kay@vrfy.org> | 2012-07-30 17:40:08 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-30 20:25:13 -0400 |
commit | cdf53441368cc02ee4aa8a8343a5dc25132836f0 (patch) | |
tree | 3867dc7e3a4477f7d2ed9ed5990b6d71f075c0d2 /kernel/printk.c | |
parent | 5353cf089bb32b69a7515be909c14bf05fe2e81e (diff) |
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>
Diffstat (limited to 'kernel/printk.c')
-rw-r--r-- | kernel/printk.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/printk.c b/kernel/printk.c index 50c96b5651b6..852269adad25 100644 --- a/kernel/printk.c +++ b/kernel/printk.c | |||
@@ -389,8 +389,10 @@ static ssize_t devkmsg_writev(struct kiocb *iocb, const struct iovec *iv, | |||
389 | 389 | ||
390 | line = buf; | 390 | line = buf; |
391 | for (i = 0; i < count; i++) { | 391 | for (i = 0; i < count; i++) { |
392 | if (copy_from_user(line, iv[i].iov_base, iv[i].iov_len)) | 392 | if (copy_from_user(line, iv[i].iov_base, iv[i].iov_len)) { |
393 | ret = -EFAULT; | ||
393 | goto out; | 394 | goto out; |
395 | } | ||
394 | line += iv[i].iov_len; | 396 | line += iv[i].iov_len; |
395 | } | 397 | } |
396 | 398 | ||