Unify migrate_pages and move_pages access checks
authorOtto Ebeling <[email protected]>
Thu, 16 Nov 2017 01:38:14 +0000 (17:38 -0800)
committerLinus Torvalds <[email protected]>
Thu, 16 Nov 2017 02:21:06 +0000 (18:21 -0800)
commit313674661925ee265f16570c893ea13cb9e00b82
tree9b2a8326083499609054ebe315541eda8ea7e931
parent7f0b5fb953e750a7410cc96c67a656d79db48bcb
Unify migrate_pages and move_pages access checks

Commit 197e7e521384 ("Sanitize 'move_pages()' permission checks") fixed
a security issue I reported in the move_pages syscall, and made it so
that you can't act on set-uid processes unless you have the
CAP_SYS_PTRACE capability.

Unify the access check logic of migrate_pages to match the new behavior
of move_pages.  We discussed this a bit in the security@ list and
thought it'd be good for consistency even though there's no evident
security impact.  The NUMA node access checks are left intact and
require CAP_SYS_NICE as before.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Otto Ebeling <[email protected]>
Acked-by: Michal Hocko <[email protected]>
Cc: Eric W. Biederman <[email protected]>
Cc: Willy Tarreau <[email protected]>
Cc: Kees Cook <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/mempolicy.c