summaryrefslogtreecommitdiff
path: root/kernel/printk.c
diff options
context:
space:
mode:
authorJesper Juhl <juhl-lkml@dif.dk>2005-03-13 00:29:18 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-03-13 00:29:18 -0800
commit4b8e07293b3fc84fb254214b5e6c2fd71f20ea37 (patch)
treec1fa456f7220837114ade2a4a4249607127f7ad0 /kernel/printk.c
parent6ca2ea5b7c876bf79f72365072bb557a35107587 (diff)
[PATCH] verify_area cleanup : i386 and misc.
This patch converts verify_area to access_ok in arch/i386, fs/, kernel/ and a few other bits that didn't fit in the other patches or that I actually was able to test on my hardware - this is by far the best tested of all the patches. Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/printk.c')
-rw-r--r--kernel/printk.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/kernel/printk.c b/kernel/printk.c
index f5dc23584ff7..e5a2222f477e 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -269,9 +269,10 @@ int do_syslog(int type, char __user * buf, int len)
error = 0;
if (!len)
goto out;
- error = verify_area(VERIFY_WRITE,buf,len);
- if (error)
+ if (!access_ok(VERIFY_WRITE, buf, len)) {
+ error = -EFAULT;
goto out;
+ }
error = wait_event_interruptible(log_wait, (log_start - log_end));
if (error)
goto out;
@@ -301,9 +302,10 @@ int do_syslog(int type, char __user * buf, int len)
error = 0;
if (!len)
goto out;
- error = verify_area(VERIFY_WRITE,buf,len);
- if (error)
+ if (!access_ok(VERIFY_WRITE, buf, len)) {
+ error = -EFAULT;
goto out;
+ }
count = len;
if (count > log_buf_len)
count = log_buf_len;