diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-06-26 15:35:24 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-06-26 15:35:24 -0400 |
commit | 6fda135c908d0f38a0167adcbd71094572e3059b (patch) | |
tree | c0583c05c9706e15535ba851076c3aeee02ed0d4 /kernel | |
parent | 4661e3568a7d14a93d4e428d246cdb86f4bac6e7 (diff) |
Revert "printk: return -EINVAL if the message len is bigger than the buf size"
This reverts commit b56a39ac263e5b8cafedd551a49c2105e68b98c2.
A better patch from Jan will follow this to resolve the issue.
Acked-by: Kay Sievers <kay@vrfy.org>
Cc: Fengguang Wu <wfg@linux.intel.com>
Cc: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Cc: Jan Beulich <JBeulich@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/printk.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/kernel/printk.c b/kernel/printk.c index d6a1412f6b09..ff05361962e1 100644 --- a/kernel/printk.c +++ b/kernel/printk.c | |||
@@ -880,9 +880,7 @@ static int syslog_print(char __user *buf, int size) | |||
880 | syslog_seq++; | 880 | syslog_seq++; |
881 | raw_spin_unlock_irq(&logbuf_lock); | 881 | raw_spin_unlock_irq(&logbuf_lock); |
882 | 882 | ||
883 | if (len > size) | 883 | if (len > 0 && copy_to_user(buf, text, len)) |
884 | len = -EINVAL; | ||
885 | else if (len > 0 && copy_to_user(buf, text, len)) | ||
886 | len = -EFAULT; | 884 | len = -EFAULT; |
887 | 885 | ||
888 | kfree(text); | 886 | kfree(text); |