From 0635170b544b01b46a81b4ac5cff5020ab59d1fc Mon Sep 17 00:00:00 2001 From: "Adam B. Jerome" Date: Wed, 12 Jul 2006 09:03:07 -0700 Subject: [PATCH] /fs/proc/: 'larger than buffer size' memory accessed by clear_user() Address a potential 'larger than buffer size' memory access by clear_user(). Without this patch, this call to clear_user() can attempt to clear too many (tsz) bytes resulting in a wrong (-EFAULT) return code by read_kcore(). Signed-off-by: Adam B. Jerome Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- fs/proc/kcore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs/proc') diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c index 8d6d85d7400..6a984f64edd 100644 --- a/fs/proc/kcore.c +++ b/fs/proc/kcore.c @@ -382,7 +382,7 @@ read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos) */ if (n) { if (clear_user(buffer + tsz - n, - tsz - n)) + n)) return -EFAULT; } } else { -- cgit v1.2.3