1. 16 12月, 2016 13 次提交
  2. 29 11月, 2016 1 次提交
    • M
      ovl: fix d_real() for stacked fs · c4fcfc16
      Miklos Szeredi 提交于
      Handling of recursion in d_real() is completely broken.  Recursion is only
      done in the 'inode != NULL' case.  But when opening the file we have
      'inode == NULL' hence d_real() will return an overlay dentry.  This won't
      work since overlayfs doesn't define its own file operations, so all file
      ops will fail.
      
      Fix by doing the recursion first and the check against the inode second.
      
      Bash script to reproduce the issue written by Quentin:
      
       - 8< - - - - - 8< - - - - - 8< - - - - - 8< - - - -
      tmpdir=$(mktemp -d)
      pushd ${tmpdir}
      
      mkdir -p {upper,lower,work}
      echo -n 'rocks' > lower/ksplice
      mount -t overlay level_zero upper -o lowerdir=lower,upperdir=upper,workdir=work
      cat upper/ksplice
      
      tmpdir2=$(mktemp -d)
      pushd ${tmpdir2}
      
      mkdir -p {upper,work}
      mount -t overlay level_one upper -o lowerdir=${tmpdir}/upper,upperdir=upper,workdir=work
      ls -l upper/ksplice
      cat upper/ksplice
       - 8< - - - - - 8< - - - - - 8< - - - - - 8< - - - - 
      Reported-by: NQuentin Casasnovas <quentin.casasnovas@oracle.com>
      Signed-off-by: NMiklos Szeredi <mszeredi@redhat.com>
      Fixes: 2d902671 ("vfs: merge .d_select_inode() into .d_real()")
      Cc: <stable@vger.kernel.org> # v4.8+
      c4fcfc16
  3. 31 10月, 2016 3 次提交
  4. 15 10月, 2016 1 次提交
  5. 14 10月, 2016 3 次提交
  6. 08 10月, 2016 2 次提交
  7. 27 9月, 2016 1 次提交
  8. 22 9月, 2016 1 次提交
  9. 21 9月, 2016 1 次提交
  10. 19 9月, 2016 1 次提交
    • V
      ovl: during copy up, switch to mounter's creds early · 8eac98b8
      Vivek Goyal 提交于
      Now, we have the notion that copy up of a file is done with the creds
      of mounter of overlay filesystem (as opposed to task). Right now before
      we switch creds, we do some vfs_getattr() operations in the context of
      task and that itself can fail. We should do that getattr() using the
      creds of mounter instead.
      
      So this patch switches to mounter's creds early during copy up process so
      that even vfs_getattr() is done with mounter's creds.
      
      Do not call revert_creds() unless we have already called
      ovl_override_creds(). [Reported by Arnd Bergmann]
      Signed-off-by: NVivek Goyal <vgoyal@redhat.com>
      Signed-off-by: NMiklos Szeredi <mszeredi@redhat.com>
      8eac98b8
  11. 16 9月, 2016 3 次提交
    • M
      ovl: lookup: do getxattr with mounter's permission · 2b6bc7f4
      Miklos Szeredi 提交于
      The getxattr() in ovl_is_opaquedir() was missed when converting all
      operations on underlying fs to be done under mounter's permission.
      
      This patch fixes this by moving the ovl_override_creds()/revert_creds() out
      from ovl_lookup_real() to ovl_lookup().
      
      Also convert to using vfs_getxattr() instead of directly calling
      i_op->getxattr().
      Signed-off-by: NMiklos Szeredi <mszeredi@redhat.com>
      2b6bc7f4
    • M
      ovl: copy_up_xattr(): use strnlen · 8b326c61
      Miklos Szeredi 提交于
      Be defensive about what underlying fs provides us in the returned xattr
      list buffer.  strlen() may overrun the buffer, so use strnlen() and WARN if
      the contents are not properly null terminated.
      Signed-off-by: NMiklos Szeredi <mszeredi@redhat.com>
      Cc: <stable@vger.kernel.org>
      8b326c61
    • M
      locks: fix file locking on overlayfs · c568d683
      Miklos Szeredi 提交于
      This patch allows flock, posix locks, ofd locks and leases to work
      correctly on overlayfs.
      
      Instead of using the underlying inode for storing lock context use the
      overlay inode.  This allows locks to be persistent across copy-up.
      
      This is done by introducing locks_inode() helper and using it instead of
      file_inode() to get the inode in locking code.  For non-overlayfs the two
      are equivalent, except for an extra pointer dereference in locks_inode().
      
      Since lock operations are in "struct file_operations" we must also make
      sure not to call underlying filesystem's lock operations.  Introcude a
      super block flag MS_NOREMOTELOCK to this effect.
      Signed-off-by: NMiklos Szeredi <mszeredi@redhat.com>
      Acked-by: NJeff Layton <jlayton@poochiereds.net>
      Cc: "J. Bruce Fields" <bfields@fieldses.org>
      c568d683
  12. 05 9月, 2016 1 次提交
  13. 01 9月, 2016 9 次提交