mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
pagemap: require aligned-length, non-null reads of /proc/pid/pagemap
The intention of commit aae8679b0e
("pagemap: fix bug in add_to_pagemap, require aligned-length reads of
/proc/pid/pagemap") was to force reads of /proc/pid/pagemap to be a
multiple of 8 bytes, but now it allows to read 0 bytes, which actually
puts some data to user's buffer. According to POSIX, if count is zero,
read() should return zero and has no other results.
Signed-off-by: Vitaly Mayatskikh <[email protected]>
Cc: Thomas Tuttle <[email protected]>
Acked-by: Matt Mackall <[email protected]>
Cc: Alexey Dobriyan <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
b827e496c8
commit
0816178638
1 changed files with 4 additions and 0 deletions
|
|
@ -665,6 +665,10 @@ static ssize_t pagemap_read(struct file *file, char __user *buf,
|
|||
goto out_task;
|
||||
|
||||
ret = 0;
|
||||
|
||||
if (!count)
|
||||
goto out_task;
|
||||
|
||||
mm = get_task_mm(task);
|
||||
if (!mm)
|
||||
goto out_task;
|
||||
|
|
|
|||
Loading…
Reference in a new issue