linux-stable/fs/proc
Marcelo Henrique Cerri 75d02bceb2 proc: Avoid mixing integer types in mem_rw()
[ Upstream commit d238692b4b ]

Use size_t when capping the count argument received by mem_rw(). Since
count is size_t, using min_t(int, ...) can lead to a negative value
that will later be passed to access_remote_vm(), which can cause
unexpected behavior.

Since we are capping the value to at maximum PAGE_SIZE, the conversion
from size_t to int when passing it to access_remote_vm() as "len"
shouldn't be a problem.

Link: https://lkml.kernel.org/r/20210512125215.3348316-1-marcelo.cerri@canonical.com
Reviewed-by: David Disseldorp <ddiss@suse.de>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Souza Cascardo <cascardo@canonical.com>
Cc: Christian Brauner <christian.brauner@ubuntu.com>
Cc: Michel Lespinasse <walken@google.com>
Cc: Helge Deller <deller@gmx.de>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Lorenzo Stoakes <lstoakes@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-07-28 11:12:18 +02:00
..
array.c
base.c proc: Avoid mixing integer types in mem_rw() 2021-07-28 11:12:18 +02:00
cmdline.c
consoles.c
cpuinfo.c
devices.c
fd.c
fd.h
generic.c
inode.c proc: Use new_inode not new_inode_pseudo 2020-06-20 10:25:04 +02:00
internal.h
interrupts.c
Kconfig
kcore.c
kmsg.c
loadavg.c
Makefile
meminfo.c
namespaces.c
nommu.c
page.c
proc_net.c
proc_sysctl.c
proc_tty.c
root.c
self.c proc: don't allow async path resolution of /proc/self components 2020-12-02 08:34:41 +01:00
softirqs.c
stat.c
task_mmu.c
task_nommu.c
thread_self.c proc: Use new_inode not new_inode_pseudo 2020-06-20 10:25:04 +02:00
uptime.c
version.c
vmcore.c