Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 7 Sep 2013 21:35:32 +0000 (14:35 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 7 Sep 2013 21:35:32 +0000 (14:35 -0700)
Pull namespace changes from Eric Biederman:
 "This is an assorted mishmash of small cleanups, enhancements and bug
  fixes.

  The major theme is user namespace mount restrictions.  nsown_capable
  is killed as it encourages not thinking about details that need to be
  considered.  A very hard to hit pid namespace exiting bug was finally
  tracked and fixed.  A couple of cleanups to the basic namespace
  infrastructure.

  Finally there is an enhancement that makes per user namespace
  capabilities usable as capabilities, and an enhancement that allows
  the per userns root to nice other processes in the user namespace"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace:
  userns:  Kill nsown_capable it makes the wrong thing easy
  capabilities: allow nice if we are privileged
  pidns: Don't have unshare(CLONE_NEWPID) imply CLONE_THREAD
  userns: Allow PR_CAPBSET_DROP in a user namespace.
  namespaces: Simplify copy_namespaces so it is clear what is going on.
  pidns: Fix hang in zap_pid_ns_processes by sending a potentially extra wakeup
  sysfs: Restrict mounting sysfs
  userns: Better restrictions on when proc and sysfs can be mounted
  vfs: Don't copy mount bind mounts of /proc/<pid>/ns/mnt between namespaces
  kernel/nsproxy.c: Improving a snippet of code.
  proc: Restrict mounting the proc filesystem
  vfs: Lock in place mounts from more privileged users

13 files changed:
1  2 
fs/namespace.c
fs/open.c
fs/proc/root.c
fs/sysfs/mount.c
include/linux/fs.h
include/linux/user_namespace.h
kernel/fork.c
kernel/nsproxy.c
kernel/pid_namespace.c
kernel/user_namespace.c
lib/kobject.c
net/core/net-sysfs.c
net/core/scm.c

diff --cc fs/namespace.c
Simple merge
diff --cc fs/open.c
Simple merge
diff --cc fs/proc/root.c
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc kernel/fork.c
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc lib/kobject.c
Simple merge
Simple merge
diff --cc net/core/scm.c
index b4da80b1cc07d28eafec50a6185d6d2a2ece61af,c346f58d97c28cc43bda5dbdd836959585f9bee3..b442e7e25e601b19a8237d1a90efbaa1d572fc19
@@@ -54,11 -54,11 +54,11 @@@ static __inline__ int scm_check_creds(s
                return -EINVAL;
  
        if ((creds->pid == task_tgid_vnr(current) ||
 -           ns_capable(current->nsproxy->pid_ns->user_ns, CAP_SYS_ADMIN)) &&
 +           ns_capable(task_active_pid_ns(current)->user_ns, CAP_SYS_ADMIN)) &&
            ((uid_eq(uid, cred->uid)   || uid_eq(uid, cred->euid) ||
-             uid_eq(uid, cred->suid)) || nsown_capable(CAP_SETUID)) &&
+             uid_eq(uid, cred->suid)) || ns_capable(cred->user_ns, CAP_SETUID)) &&
            ((gid_eq(gid, cred->gid)   || gid_eq(gid, cred->egid) ||
-             gid_eq(gid, cred->sgid)) || nsown_capable(CAP_SETGID))) {
+             gid_eq(gid, cred->sgid)) || ns_capable(cred->user_ns, CAP_SETGID))) {
               return 0;
        }
        return -EPERM;