Skip to content

Commit

Permalink
[PATCH] /fs/proc/: 'larger than buffer size' memory accessed by clear…
Browse files Browse the repository at this point in the history
…_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 <abj@novell.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Adam B. Jerome authored and Linus Torvalds committed Jul 12, 2006
1 parent 232ba9d commit 0635170
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/proc/kcore.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 0635170

Please sign in to comment.