1. 10 4月, 2013 34 次提交
  2. 27 3月, 2013 1 次提交
    • A
      Nest rename_lock inside vfsmount_lock · 7ea600b5
      Al Viro 提交于
      ... lest we get livelocks between path_is_under() and d_path() and friends.
      
      The thing is, wrt fairness lglocks are more similar to rwsems than to rwlocks;
      it is possible to have thread B spin on attempt to take lock shared while thread
      A is already holding it shared, if B is on lower-numbered CPU than A and there's
      a thread C spinning on attempt to take the same lock exclusive.
      
      As the result, we need consistent ordering between vfsmount_lock (lglock) and
      rename_lock (seq_lock), even though everything that takes both is going to take
      vfsmount_lock only shared.
      Spotted-by: NBrad Spengler <spender@grsecurity.net>
      Cc: stable@vger.kernel.org
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      7ea600b5
  3. 23 3月, 2013 2 次提交
    • K
      nfsd: fix bad offset use · e49dbbf3
      Kent Overstreet 提交于
      vfs_writev() updates the offset argument - but the code then passes the
      offset to vfs_fsync_range(). Since offset now points to the offset after
      what was just written, this is probably not what was intended
      
      Introduced by face1502 "nfsd: use
      vfs_fsync_range(), not O_SYNC, for stable writes".
      Signed-off-by: NKent Overstreet <koverstreet@google.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Cc: stable@vger.kernel.org
      Reviewed-by: NZach Brown <zab@redhat.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      e49dbbf3
    • L
      vfs,proc: guarantee unique inodes in /proc · 51f0885e
      Linus Torvalds 提交于
      Dave Jones found another /proc issue with his Trinity tool: thanks to
      the namespace model, we can have multiple /proc dentries that point to
      the same inode, aliasing directories in /proc/<pid>/net/ for example.
      
      This ends up being a total disaster, because it acts like hardlinked
      directories, and causes locking problems.  We rely on the topological
      sort of the inodes pointed to by dentries, and if we have aliased
      directories, that odering becomes unreliable.
      
      In short: don't do this.  Multiple dentries with the same (directory)
      inode is just a bad idea, and the namespace code should never have
      exposed things this way.  But we're kind of stuck with it.
      
      This solves things by just always allocating a new inode during /proc
      dentry lookup, instead of using "iget_locked()" to look up existing
      inodes by superblock and number.  That actually simplies the code a bit,
      at the cost of potentially doing more inode [de]allocations.
      
      That said, the inode lookup wasn't free either (and did a lot of locking
      of inodes), so it is probably not that noticeable.  We could easily keep
      the old lookup model for non-directory entries, but rather than try to
      be excessively clever this just implements the minimal and simplest
      workaround for the problem.
      Reported-and-tested-by: NDave Jones <davej@redhat.com>
      Analyzed-by: NAl Viro <viro@zeniv.linux.org.uk>
      Cc: stable@vger.kernel.org
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      51f0885e
  4. 22 3月, 2013 2 次提交
    • J
      cifs: ignore everything in SPNEGO blob after mechTypes · f853c616
      Jeff Layton 提交于
      We've had several reports of people attempting to mount Windows 8 shares
      and getting failures with a return code of -EINVAL. The default sec=
      mode changed recently to sec=ntlmssp. With that, we expect and parse a
      SPNEGO blob from the server in the NEGOTIATE reply.
      
      The current decode_negTokenInit function first parses all of the
      mechTypes and then tries to parse the rest of the negTokenInit reply.
      The parser however currently expects a mechListMIC or nothing to follow the
      mechTypes, but Windows 8 puts a mechToken field there instead to carry
      some info for the new NegoEx stuff.
      
      In practice, we don't do anything with the fields after the mechTypes
      anyway so I don't see any real benefit in continuing to parse them.
      This patch just has the kernel ignore the fields after the mechTypes.
      We'll probably need to reinstate some of this if we ever want to support
      NegoEx.
      Reported-by: NJason Burgess <jason@jacknife2.dns2go.com>
      Reported-by: NYan Li <elliot.li.tech@gmail.com>
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      f853c616
    • A
      Don't bother with redoing rw_verify_area() from default_file_splice_from() · 06ae43f3
      Al Viro 提交于
      default_file_splice_from() ends up calling vfs_write() (via very convoluted
      callchain).  It's an overkill, since we already have done rw_verify_area()
      in the caller by the time we call vfs_write() we are under set_fs(KERNEL_DS),
      so access_ok() is also pointless.  Add a new helper (__kernel_write()),
      use it instead of kernel_write() in there.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      06ae43f3
  5. 21 3月, 2013 1 次提交