linux/fs/nfsd
Linus Torvalds 644473e9c6 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace
Pull user namespace enhancements from Eric Biederman:
 "This is a course correction for the user namespace, so that we can
  reach an inexpensive, maintainable, and reasonably complete
  implementation.

  Highlights:
   - Config guards make it impossible to enable the user namespace and
     code that has not been converted to be user namespace safe.

   - Use of the new kuid_t type ensures the if you somehow get past the
     config guards the kernel will encounter type errors if you enable
     user namespaces and attempt to compile in code whose permission
     checks have not been updated to be user namespace safe.

   - All uids from child user namespaces are mapped into the initial
     user namespace before they are processed.  Removing the need to add
     an additional check to see if the user namespace of the compared
     uids remains the same.

   - With the user namespaces compiled out the performance is as good or
     better than it is today.

   - For most operations absolutely nothing changes performance or
     operationally with the user namespace enabled.

   - The worst case performance I could come up with was timing 1
     billion cache cold stat operations with the user namespace code
     enabled.  This went from 156s to 164s on my laptop (or 156ns to
     164ns per stat operation).

   - (uid_t)-1 and (gid_t)-1 are reserved as an internal error value.
     Most uid/gid setting system calls treat these value specially
     anyway so attempting to use -1 as a uid would likely cause
     entertaining failures in userspace.

   - If setuid is called with a uid that can not be mapped setuid fails.
     I have looked at sendmail, login, ssh and every other program I
     could think of that would call setuid and they all check for and
     handle the case where setuid fails.

   - If stat or a similar system call is called from a context in which
     we can not map a uid we lie and return overflowuid.  The LFS
     experience suggests not lying and returning an error code might be
     better, but the historical precedent with uids is different and I
     can not think of anything that would break by lying about a uid we
     can't map.

   - Capabilities are localized to the current user namespace making it
     safe to give the initial user in a user namespace all capabilities.

  My git tree covers all of the modifications needed to convert the core
  kernel and enough changes to make a system bootable to runlevel 1."

Fix up trivial conflicts due to nearby independent changes in fs/stat.c

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: (46 commits)
  userns:  Silence silly gcc warning.
  cred: use correct cred accessor with regards to rcu read lock
  userns: Convert the move_pages, and migrate_pages permission checks to use uid_eq
  userns: Convert cgroup permission checks to use uid_eq
  userns: Convert tmpfs to use kuid and kgid where appropriate
  userns: Convert sysfs to use kgid/kuid where appropriate
  userns: Convert sysctl permission checks to use kuid and kgids.
  userns: Convert proc to use kuid/kgid where appropriate
  userns: Convert ext4 to user kuid/kgid where appropriate
  userns: Convert ext3 to use kuid/kgid where appropriate
  userns: Convert ext2 to use kuid/kgid where appropriate.
  userns: Convert devpts to use kuid/kgid where appropriate
  userns: Convert binary formats to use kuid/kgid where appropriate
  userns: Add negative depends on entries to avoid building code that is userns unsafe
  userns: signal remove unnecessary map_cred_ns
  userns: Teach inode_capable to understand inodes whose uids map to other namespaces.
  userns: Fail exec for suid and sgid binaries with ids outside our user namespace.
  userns: Convert stat to return values mapped from kuids and kgids
  userns: Convert user specfied uids and gids in chown into kuids and kgid
  userns: Use uid_eq gid_eq helpers when comparing kuids and kgids in the vfs
  ...
2012-05-23 17:42:39 -07:00
..
acl.h nfsd4: remove outdated pathname-comments 2011-01-04 18:22:10 -05:00
auth.c userns: Convert group_info values from gid_t to kgid_t. 2012-05-03 03:27:21 -07:00
auth.h nfsd: minor fs/nfsd/auth.h cleanup 2008-02-01 16:42:05 -05:00
cache.h nfsd: turn on reply cache for NFSv4 2011-07-18 09:39:01 -04:00
current_stateid.h nfsd41: use current stateid by value 2012-02-15 11:20:45 -05:00
export.c nfsd: remove some unneeded checks 2012-02-03 14:26:42 -05:00
fault_inject.c debugfs-related mode_t whack-a-mole 2012-03-20 21:29:53 -04:00
fault_inject.h NFSD: Added fault injection 2011-11-07 21:10:47 -05:00
idmap.h nfsd4: return nfs errno from name_to_id functions 2011-01-04 18:22:11 -05:00
Kconfig NFSD: Added fault injection 2011-11-07 21:10:47 -05:00
lockd.c nfsd: Remove deprecated nfsctl system call and related code. 2011-07-15 18:58:42 -04:00
Makefile NFSD: Added fault injection 2011-11-07 21:10:47 -05:00
netns.h nfsd: only register cld pipe notifier when CONFIG_NFSD_V4 is enabled 2012-03-29 08:01:07 -04:00
nfs2acl.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
nfs3acl.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
nfs3proc.c nfsd41: make sure nfs server process OPEN with EXCLUSIVE4_1 correctly 2011-04-29 20:47:52 -04:00
nfs3xdr.c nfsd: fix compose_entry_fh() failure exits 2012-04-13 10:12:02 -04:00
nfs4acl.c fs: add export.h to files using EXPORT_SYMBOL/THIS_MODULE macros 2011-10-31 19:30:31 -04:00
nfs4callback.c nfsd4: use auth_unix unconditionally on backchannel 2012-03-28 19:14:36 -04:00
nfs4idmap.c nfsd4: memory corruption in numeric_name_to_id() 2012-03-28 10:10:23 -04:00
nfs4proc.c Merge branch 'for-3.4' of git://linux-nfs.org/~bfields/linux 2012-04-19 14:54:52 -07:00
nfs4recover.c nfsd: fix nfs4recover.c printk format warning 2012-04-30 12:28:48 -07:00
nfs4state.c nfsd: fix error values returned by nfsd4_lockt() when nfsd_open() fails 2012-04-13 10:12:01 -04:00
nfs4xdr.c nfsd: fix error value on allocation failure in nfsd4_decode_test_stateid() 2012-04-13 10:12:01 -04:00
nfscache.c nfsd: turn on reply cache for NFSv4 2011-07-18 09:39:01 -04:00
nfsctl.c nfsd: only register cld pipe notifier when CONFIG_NFSD_V4 is enabled 2012-03-29 08:01:07 -04:00
nfsd.h nfsd: only register cld pipe notifier when CONFIG_NFSD_V4 is enabled 2012-03-29 08:01:07 -04:00
nfsfh.c fs: propagate umode_t, misc bits 2012-01-03 22:55:10 -05:00
nfsfh.h fs: propagate umode_t, misc bits 2012-01-03 22:55:10 -05:00
nfsproc.c nfsd4: return nfs errno from name_to_id functions 2011-01-04 18:22:11 -05:00
nfssvc.c Merge nfs containerization work from Trond's tree 2012-03-26 11:48:54 -04:00
nfsxdr.c Fix common misspellings 2011-03-31 11:26:23 -03:00
state.h nfsd: add nfsd4_client_tracking_ops struct and a way to set it 2012-03-26 11:49:47 -04:00
stats.c SUNRPC: register service stats /proc entries in passed network namespace context 2012-01-31 19:28:18 -05:00
vfs.c nfsd: don't fail unchecked creates of non-special files 2012-04-11 17:49:52 -04:00
vfs.h nfsd: vfs_llseek() with 32 or 64 bit offsets (hashes) 2012-03-18 22:44:50 -04:00
xdr3.h nfsd: remove pointless paths in file headers 2009-12-15 15:01:47 -05:00
xdr4.h NFSD: Fix nfs4_verifier memory alignment 2012-03-20 15:36:15 -04:00
xdr.h nfsd: remove pointless paths in file headers 2009-12-15 15:01:47 -05:00