1. 17 May, 2016 1 commit
    • Al Viro's avatar
      Merge branch 'ovl-fixes' into for-linus · 0e0162bb
      Al Viro authored
      Backmerge to resolve a conflict in ovl_lookup_real();
      "ovl_lookup_real(): use lookup_one_len_unlocked()" instead,
      but it was too late in the cycle to rebase.
      0e0162bb
  2. 13 May, 2016 3 commits
  3. 12 May, 2016 4 commits
  4. 11 May, 2016 4 commits
    • Miklos Szeredi's avatar
      ovl: ignore permissions on underlying lookup · 38b78a5f
      Miklos Szeredi authored
      Generally permission checking is not necessary when overlayfs looks up a
      dentry on one of the underlying layers, since search permission on base
      directory was already checked in ovl_permission().
      
      More specifically using lookup_one_len() causes a problem when the lower
      directory lacks search permission for a specific user while the upper
      directory does have search permission.  Since lookups are cached, this
      causes inconsistency in behavior: success depends on who did the first
      lookup.
      
      So instead use lookup_hash() which doesn't do the permission check.
      Reported-by: default avatarIgnacy Gawędzki <ignacy.gawedzki@green-communications.fr>
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
      38b78a5f
    • Miklos Szeredi's avatar
      vfs: add lookup_hash() helper · 3c9fe8cd
      Miklos Szeredi authored
      Overlayfs needs lookup without inode_permission() and already has the name
      hash (in form of dentry->d_name on overlayfs dentry).  It also doesn't
      support filesystems with d_op->d_hash() so basically it only needs
      the actual hashed lookup from lookup_one_len_unlocked()
      
      So add a new helper that does unlocked lookup of a hashed name.
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
      3c9fe8cd
    • Miklos Szeredi's avatar
      vfs: rename: check backing inode being equal · 9409e22a
      Miklos Szeredi authored
      If a file is renamed to a hardlink of itself POSIX specifies that rename(2)
      should do nothing and return success.
      
      This condition is checked in vfs_rename().  However it won't detect hard
      links on overlayfs where these are given separate inodes on the overlayfs
      layer.
      
      Overlayfs itself detects this condition and returns success without doing
      anything, but then vfs_rename() will proceed as if this was a successful
      rename (detach_mounts(), d_move()).
      
      The correct thing to do is to detect this condition before even calling
      into overlayfs.  This patch does this by calling vfs_select_inode() to get
      the underlying inodes.
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
      Cc: <stable@vger.kernel.org> # v4.2+
      9409e22a
    • Miklos Szeredi's avatar
      vfs: add vfs_select_inode() helper · 54d5ca87
      Miklos Szeredi authored
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
      Cc: <stable@vger.kernel.org> # v4.2+
      54d5ca87
  5. 10 May, 2016 4 commits
  6. 09 May, 2016 14 commits
  7. 08 May, 2016 2 commits
    • Linus Torvalds's avatar
      Linux 4.6-rc7 · 44549e8f
      Linus Torvalds authored
      44549e8f
    • Al Viro's avatar
      get_rock_ridge_filename(): handle malformed NM entries · 99d82582
      Al Viro authored
      Payloads of NM entries are not supposed to contain NUL.  When we run
      into such, only the part prior to the first NUL goes into the
      concatenation (i.e. the directory entry name being encoded by a bunch
      of NM entries).  We do stop when the amount collected so far + the
      claimed amount in the current NM entry exceed 254.  So far, so good,
      but what we return as the total length is the sum of *claimed*
      sizes, not the actual amount collected.  And that can grow pretty
      large - not unlimited, since you'd need to put CE entries in
      between to be able to get more than the maximum that could be
      contained in one isofs directory entry / continuation chunk and
      we are stop once we'd encountered 32 CEs, but you can get about 8Kb
      easily.  And that's what will be passed to readdir callback as the
      name length.  8Kb __copy_to_user() from a buffer allocated by
      __get_free_page()
      
      Cc: stable@vger.kernel.org # 0.98pl6+ (yes, really)
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      99d82582
  8. 07 May, 2016 7 commits
  9. 06 May, 2016 1 commit