diff options
author | Kees Cook <keescook@chromium.org> | 2014-05-21 15:23:46 -0700 |
---|---|---|
committer | Daniel Rosenberg <drosen@google.com> | 2015-01-12 16:49:26 -0800 |
commit | d221244a7b63df4cf6d9d7c0643d87f3785739e3 (patch) | |
tree | 8bdd83cf6c835bfaa2101febcef3efe97d8c88c7 /fs | |
parent | 84ec5f6424fe726e7c0feb51d668d6419c01196f (diff) |
sched: move no_new_privs into new atomic flags
Since seccomp transitions between threads requires updates to the
no_new_privs flag to be atomic, the flag must be part of an atomic flag
set. This moves the nnp flag into a separate task field, and introduces
accessors.
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Reviewed-by: Andy Lutomirski <luto@amacapital.net>
Conflicts:
kernel/sys.c
Diffstat (limited to 'fs')
-rw-r--r-- | fs/exec.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/exec.c b/fs/exec.c index 3d78fccdd723..e2dffcae5ba2 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -1245,7 +1245,7 @@ static void check_unsafe_exec(struct linux_binprm *bprm) * This isn't strictly necessary, but it makes it harder for LSMs to * mess up. */ - if (current->no_new_privs) + if (task_no_new_privs(current)) bprm->unsafe |= LSM_UNSAFE_NO_NEW_PRIVS; t = p; @@ -1283,7 +1283,7 @@ int prepare_binprm(struct linux_binprm *bprm) bprm->cred->egid = current_egid(); if (!(bprm->file->f_path.mnt->mnt_flags & MNT_NOSUID) && - !current->no_new_privs && + !task_no_new_privs(current) && kuid_has_mapping(bprm->cred->user_ns, inode->i_uid) && kgid_has_mapping(bprm->cred->user_ns, inode->i_gid)) { /* Set-uid? */ |