exec: Consolidate dumpability logic
authorKees Cook <keescook@chromium.org>
Tue, 18 Jul 2017 22:25:34 +0000 (15:25 -0700)
committerKees Cook <keescook@chromium.org>
Tue, 1 Aug 2017 19:03:13 +0000 (12:03 -0700)
commit473d89639db0aaa0799616b397584ba4f58cd8e1
tree5e9000d933802bf54a139f0b6825f8b5971627dd
parent35b372b76f7153142cd4838ef1e1e094d115f46f
exec: Consolidate dumpability logic

Since it's already valid to set dumpability in the early part of
setup_new_exec(), we can consolidate the logic into a single place.
The BINPRM_FLAGS_ENFORCE_NONDUMP is set during would_dump() calls
before setup_new_exec(), so its test is safe to move as well.

Signed-off-by: Kees Cook <keescook@chromium.org>
Acked-by: Serge Hallyn <serge@hallyn.com>
Reviewed-by: James Morris <james.l.morris@oracle.com>
fs/exec.c