Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/fs/proc/base.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff -puN fs/proc/base.c~seccomp-tidy fs/proc/base.c
--- 25/fs/proc/base.c~seccomp-tidy	2005-02-17 17:59:30.000000000 -0800
+++ 25-akpm/fs/proc/base.c	2005-02-17 18:02:49.000000000 -0800
@@ -822,7 +822,7 @@ static struct file_operations proc_login
 #endif
 
 #ifdef CONFIG_SECCOMP
-static ssize_t seccomp_read(struct file *file, char *buf,
+static ssize_t seccomp_read(struct file *file, char __user *buf,
 			    size_t count, loff_t *ppos)
 {
 	struct task_struct *tsk = proc_task(file->f_dentry->d_inode);
@@ -842,7 +842,7 @@ static ssize_t seccomp_read(struct file 
 	return count;
 }
 
-static ssize_t seccomp_write(struct file *file, const char *buf,
+static ssize_t seccomp_write(struct file *file, const char __user *buf,
 			     size_t count, loff_t *ppos)
 {
 	struct task_struct *tsk = proc_task(file->f_dentry->d_inode);
@@ -853,9 +853,8 @@ static ssize_t seccomp_write(struct file
 	if (unlikely(tsk->seccomp.mode))
 		return -EPERM;
 
-	memset(__buf, 0, 20);
-	if (count > 19)
-		count = 19;
+	memset(__buf, 0, sizeof(__buf));
+	count = min(count, sizeof(__buf) - 1);
 	if (copy_from_user(__buf, buf, count))
 		return -EFAULT;
 	seccomp_mode = simple_strtoul(__buf, &end, 0);
_