Commit 704bb813 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security

Pull security layer fixes from James Morris:
 "The keys patch fixes a bug which is breaking kerberos, and the seccomp
  fix addresses a no_new_privs bypass"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
  KEYS: Only apply KEY_FLAG_KEEP to a key if a parent keyring has it set
  seccomp: always propagate NO_NEW_PRIVS on tsync
parents 26cd8367 1c1ecf17
...@@ -316,13 +316,7 @@ static inline void seccomp_sync_threads(void) ...@@ -316,13 +316,7 @@ 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);
/*
* Opt the other thread into seccomp if needed.
* As threads are considered to be trust-realm
* equivalent (see ptrace_may_access), it is safe to
* allow one thread to transition the other.
*/
if (thread->seccomp.mode == SECCOMP_MODE_DISABLED) {
/* /*
* Don't let an unprivileged task work around * Don't let an unprivileged task work around
* the no_new_privs restriction by creating * the no_new_privs restriction by creating
...@@ -332,9 +326,15 @@ static inline void seccomp_sync_threads(void) ...@@ -332,9 +326,15 @@ static inline void seccomp_sync_threads(void)
if (task_no_new_privs(caller)) if (task_no_new_privs(caller))
task_set_no_new_privs(thread); task_set_no_new_privs(thread);
/*
* Opt the other thread into seccomp if needed.
* As threads are considered to be trust-realm
* equivalent (see ptrace_may_access), it is safe to
* allow one thread to transition the other.
*/
if (thread->seccomp.mode == SECCOMP_MODE_DISABLED)
seccomp_assign_mode(thread, SECCOMP_MODE_FILTER); seccomp_assign_mode(thread, SECCOMP_MODE_FILTER);
} }
}
} }
/** /**
......
...@@ -430,6 +430,7 @@ static int __key_instantiate_and_link(struct key *key, ...@@ -430,6 +430,7 @@ static int __key_instantiate_and_link(struct key *key,
/* and link it into the destination keyring */ /* and link it into the destination keyring */
if (keyring) { if (keyring) {
if (test_bit(KEY_FLAG_KEEP, &keyring->flags))
set_bit(KEY_FLAG_KEEP, &key->flags); set_bit(KEY_FLAG_KEEP, &key->flags);
__key_link(key, _edit); __key_link(key, _edit);
......
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