]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
Merge branch 'overlayfs-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszer...
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 27 May 2016 23:44:39 +0000 (16:44 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 27 May 2016 23:44:39 +0000 (16:44 -0700)
Pull overlayfs update from Miklos Szeredi:
 "The meat of this is a change to use the mounter's credentials for
  operations that require elevated privileges (such as whiteout
  creation).  This fixes behavior under user namespaces as well as being
  a nice cleanup"

* 'overlayfs-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs:
  ovl: Do d_type check only if work dir creation was successful
  ovl: update documentation
  ovl: override creds with the ones from the superblock mounter

1  2 
fs/overlayfs/overlayfs.h
fs/overlayfs/readdir.c
fs/overlayfs/super.c

Simple merge
index da186ee4f846820703fa1a2fffb290c876991f1e,e9206bc8598f3f31d7f1f8752505fb32b359b889..d11ae826bcbc94215abc441a4c1d53434691e5c4
@@@ -206,21 -207,10 +207,12 @@@ static int ovl_check_whiteouts(struct d
        struct ovl_cache_entry *p;
        struct dentry *dentry;
        const struct cred *old_cred;
-       struct cred *override_cred;
-       override_cred = prepare_creds();
-       if (!override_cred)
-               return -ENOMEM;
  
-       /*
-        * CAP_DAC_OVERRIDE for lookup
-        */
-       cap_raise(override_cred->cap_effective, CAP_DAC_OVERRIDE);
-       old_cred = override_creds(override_cred);
+       old_cred = ovl_override_creds(rdd->dentry->d_sb);
  
 -      err = mutex_lock_killable(&dir->d_inode->i_mutex);
 +      inode_lock(dir->d_inode);
 +      err = 0;
 +      // XXX: err = mutex_lock_killable(&dir->d_inode->i_mutex);
        if (!err) {
                while (rdd->first_maybe_whiteout) {
                        p = rdd->first_maybe_whiteout;
Simple merge