Commit 1c1ecf17 authored by James Morris's avatar James Morris

Merge tag 'seccomp-4.5-rc2' of...

Merge tag 'seccomp-4.5-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux into for-linus
parents eee04502 103502a3
...@@ -316,24 +316,24 @@ static inline void seccomp_sync_threads(void) ...@@ -316,24 +316,24 @@ static inline void seccomp_sync_threads(void)
put_seccomp_filter(thread); put_seccomp_filter(thread);
smp_store_release(&thread->seccomp.filter, smp_store_release(&thread->seccomp.filter,
caller->seccomp.filter); caller->seccomp.filter);
/*
* Don't let an unprivileged task work around
* the no_new_privs restriction by creating
* a thread that sets it up, enters seccomp,
* then dies.
*/
if (task_no_new_privs(caller))
task_set_no_new_privs(thread);
/* /*
* Opt the other thread into seccomp if needed. * Opt the other thread into seccomp if needed.
* As threads are considered to be trust-realm * As threads are considered to be trust-realm
* equivalent (see ptrace_may_access), it is safe to * equivalent (see ptrace_may_access), it is safe to
* allow one thread to transition the other. * allow one thread to transition the other.
*/ */
if (thread->seccomp.mode == SECCOMP_MODE_DISABLED) { if (thread->seccomp.mode == SECCOMP_MODE_DISABLED)
/*
* Don't let an unprivileged task work around
* the no_new_privs restriction by creating
* a thread that sets it up, enters seccomp,
* then dies.
*/
if (task_no_new_privs(caller))
task_set_no_new_privs(thread);
seccomp_assign_mode(thread, SECCOMP_MODE_FILTER); seccomp_assign_mode(thread, SECCOMP_MODE_FILTER);
}
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment