kernel-ark/drivers/staging
Linus Torvalds a867d7349e Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace
Pull userns vfs updates from Eric Biederman:
 "This tree contains some very long awaited work on generalizing the
  user namespace support for mounting filesystems to include filesystems
  with a backing store.  The real world target is fuse but the goal is
  to update the vfs to allow any filesystem to be supported.  This
  patchset is based on a lot of code review and testing to approach that
  goal.

  While looking at what is needed to support the fuse filesystem it
  became clear that there were things like xattrs for security modules
  that needed special treatment.  That the resolution of those concerns
  would not be fuse specific.  That sorting out these general issues
  made most sense at the generic level, where the right people could be
  drawn into the conversation, and the issues could be solved for
  everyone.

  At a high level what this patchset does a couple of simple things:

   - Add a user namespace owner (s_user_ns) to struct super_block.

   - Teach the vfs to handle filesystem uids and gids not mapping into
     to kuids and kgids and being reported as INVALID_UID and
     INVALID_GID in vfs data structures.

  By assigning a user namespace owner filesystems that are mounted with
  only user namespace privilege can be detected.  This allows security
  modules and the like to know which mounts may not be trusted.  This
  also allows the set of uids and gids that are communicated to the
  filesystem to be capped at the set of kuids and kgids that are in the
  owning user namespace of the filesystem.

  One of the crazier corner casees this handles is the case of inodes
  whose i_uid or i_gid are not mapped into the vfs.  Most of the code
  simply doesn't care but it is easy to confuse the inode writeback path
  so no operation that could cause an inode write-back is permitted for
  such inodes (aka only reads are allowed).

  This set of changes starts out by cleaning up the code paths involved
  in user namespace permirted mounts.  Then when things are clean enough
  adds code that cleanly sets s_user_ns.  Then additional restrictions
  are added that are possible now that the filesystem superblock
  contains owner information.

  These changes should not affect anyone in practice, but there are some
  parts of these restrictions that are changes in behavior.

   - Andy's restriction on suid executables that does not honor the
     suid bit when the path is from another mount namespace (think
     /proc/[pid]/fd/) or when the filesystem was mounted by a less
     privileged user.

   - The replacement of the user namespace implicit setting of MNT_NODEV
     with implicitly setting SB_I_NODEV on the filesystem superblock
     instead.

     Using SB_I_NODEV is a stronger form that happens to make this state
     user invisible.  The user visibility can be managed but it caused
     problems when it was introduced from applications reasonably
     expecting mount flags to be what they were set to.

  There is a little bit of work remaining before it is safe to support
  mounting filesystems with backing store in user namespaces, beyond
  what is in this set of changes.

   - Verifying the mounter has permission to read/write the block device
     during mount.

   - Teaching the integrity modules IMA and EVM to handle filesystems
     mounted with only user namespace root and to reduce trust in their
     security xattrs accordingly.

   - Capturing the mounters credentials and using that for permission
     checks in d_automount and the like.  (Given that overlayfs already
     does this, and we need the work in d_automount it make sense to
     generalize this case).

  Furthermore there are a few changes that are on the wishlist:

   - Get all filesystems supporting posix acls using the generic posix
     acls so that posix_acl_fix_xattr_from_user and
     posix_acl_fix_xattr_to_user may be removed.  [Maintainability]

   - Reducing the permission checks in places such as remount to allow
     the superblock owner to perform them.

   - Allowing the superblock owner to chown files with unmapped uids and
     gids to something that is mapped so the files may be treated
     normally.

  I am not considering even obvious relaxations of permission checks
  until it is clear there are no more corner cases that need to be
  locked down and handled generically.

  Many thanks to Seth Forshee who kept this code alive, and putting up
  with me rewriting substantial portions of what he did to handle more
  corner cases, and for his diligent testing and reviewing of my
  changes"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: (30 commits)
  fs: Call d_automount with the filesystems creds
  fs: Update i_[ug]id_(read|write) to translate relative to s_user_ns
  evm: Translate user/group ids relative to s_user_ns when computing HMAC
  dquot: For now explicitly don't support filesystems outside of init_user_ns
  quota: Handle quota data stored in s_user_ns in quota_setxquota
  quota: Ensure qids map to the filesystem
  vfs: Don't create inodes with a uid or gid unknown to the vfs
  vfs: Don't modify inodes with a uid or gid unknown to the vfs
  cred: Reject inodes with invalid ids in set_create_file_as()
  fs: Check for invalid i_uid in may_follow_link()
  vfs: Verify acls are valid within superblock's s_user_ns.
  userns: Handle -1 in k[ug]id_has_mapping when !CONFIG_USER_NS
  fs: Refuse uid/gid changes which don't map into s_user_ns
  selinux: Add support for unprivileged mounts from user namespaces
  Smack: Handle labels consistently in untrusted mounts
  Smack: Add support for unprivileged mounts from user namespaces
  fs: Treat foreign mounts as nosuid
  fs: Limit file caps to the user namespace of the super block
  userns: Remove the now unnecessary FS_USERNS_DEV_MOUNT flag
  userns: Remove implicit MNT_NODEV fragility.
  ...
2016-07-29 15:54:19 -07:00
..
android mm: move most file-based accounting to the node 2016-07-28 16:07:41 -07:00
board
clocking-wizard
comedi staging: comedi: avoid using timeval 2016-06-17 21:14:34 -07:00
dgnc Staging and IIO driver update for 4.7-rc1 2016-05-20 22:20:48 -07:00
emxx_udc Staging: emxx_udc: emxx_udc: fixed coding style issue 2016-05-09 14:25:52 +02:00
fbtft
fsl-mc staging: fsl-mc: convert mc command build/parse to use C structs 2016-06-26 17:14:03 -07:00
fwserial Staging and IIO driver update for 4.7-rc1 2016-05-20 22:20:48 -07:00
gdm724x staging/gdm724x: fix "alignment should match open parenthesis" issues 2016-05-09 14:25:52 +02:00
goldfish
gs_fpgaboot
i4l
iio Third set of IIO new device support, features and cleanups for the 4.8 cycle. 2016-07-14 12:05:29 +09:00
ks7010 staging: ks7010: remove bogus NULL checks 2016-06-18 19:47:00 -07:00
lustre Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace 2016-07-29 15:54:19 -07:00
media [media] cec: always check all_device_types and features 2016-07-19 13:27:46 -03:00
most
mt29f_spinand
netlogic
nvec
octeon
octeon-usb
olpc_dcon
rtl8188eu Revert "Staging: rtl8188eu: rtw_efuse: Use sizeof type *pointer instead of sizeof type." 2016-06-17 11:21:45 -07:00
rtl8192e
rtl8192u rtl8192u: Remove unused semaphore rf_sem 2016-06-18 19:50:48 -07:00
rtl8712
rtl8723au nl80211: support beacon report scanning 2016-07-06 14:51:31 +02:00
rts5208
skein
slicoss
sm750fb
speakup Staging and IIO driver update for 4.7-rc1 2016-05-20 22:20:48 -07:00
unisys staging: unisys: visornic: change return statements 2016-06-07 22:58:16 -07:00
vme Staging and IIO driver update for 4.7-rc1 2016-05-20 22:20:48 -07:00
vt6655 Staging and IIO driver update for 4.7-rc1 2016-05-20 22:20:48 -07:00
vt6656 Staging and IIO driver update for 4.7-rc1 2016-05-20 22:20:48 -07:00
wilc1000 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2016-07-27 12:03:20 -07:00
wlan-ng nl80211: support beacon report scanning 2016-07-06 14:51:31 +02:00
xgifb
Kconfig staging: ks7010: add driver from Nanonote extra-repository 2016-06-07 22:42:53 -07:00
Makefile staging: ks7010: add driver from Nanonote extra-repository 2016-06-07 22:42:53 -07:00