commit | b07687243d4a1eac564de3fca8cb0e5b1494c024 | [log] [tgz] |
---|---|---|
author | Konstantin Khlebnikov <[email protected]> | Thu Jul 11 21:00:07 2019 -0700 |
committer | Greg Kroah-Hartman <[email protected]> | Wed Jul 31 07:27:09 2019 +0200 |
tree | 60f7815c8c9dfe210354ecd8fc9a611df69ff7d0 | |
parent | 4acb04ef5e42300020feb466d784164c35181772 [diff] |
mm: use down_read_killable for locking mmap_sem in access_remote_vm [ Upstream commit 1e426fe28261b03f297992e89da3320b42816f4e ] This function is used by ptrace and proc files like /proc/pid/cmdline and /proc/pid/environ. Access_remote_vm never returns error codes, all errors are ignored and only size of successfully read data is returned. So, if current task was killed we'll simply return 0 (bytes read). Mmap_sem could be locked for a long time or forever if something goes wrong. Using a killable lock permits cleanup of stuck tasks and simplifies investigation. Link: http://lkml.kernel.org/r/156007494202.3335.16782303099589302087.stgit@buzz Signed-off-by: Konstantin Khlebnikov <[email protected]> Reviewed-by: Michal Koutný <[email protected]> Acked-by: Oleg Nesterov <[email protected]> Acked-by: Michal Hocko <[email protected]> Cc: Alexey Dobriyan <[email protected]> Cc: Matthew Wilcox <[email protected]> Cc: Cyrill Gorcunov <[email protected]> Cc: Kirill Tkhai <[email protected]> Cc: Al Viro <[email protected]> Cc: Roman Gushchin <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]> Signed-off-by: Sasha Levin <[email protected]>