Commit 0635170b authored by Adam B. Jerome's avatar Adam B. Jerome Committed by Linus Torvalds

[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
Signed-off-by: default avatarAdam B. Jerome <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 232ba9db
......@@ -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))
return -EFAULT;
} else {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment