1. 17 12月, 2009 1 次提交
  2. 12 10月, 2009 1 次提交
  3. 24 9月, 2009 1 次提交
    • V
      fs: fix overflow in sys_mount() for in-kernel calls · eca6f534
      Vegard Nossum 提交于
      sys_mount() reads/copies a whole page for its "type" parameter.  When
      do_mount_root() passes a kernel address that points to an object which is
      smaller than a whole page, copy_mount_options() will happily go past this
      memory object, possibly dereferencing "wild" pointers that could be in any
      state (hence the kmemcheck warning, which shows that parts of the next
      page are not even allocated).
      
      (The likelihood of something going wrong here is pretty low -- first of
      all this only applies to kernel calls to sys_mount(), which are mostly
      found in the boot code.  Secondly, I guess if the page was not mapped,
      exact_copy_from_user() _would_ in fact handle it correctly because of its
      access_ok(), etc.  checks.)
      
      But it is much nicer to avoid the dubious reads altogether, by stopping as
      soon as we find a NUL byte.  Is there a good reason why we can't do
      something like this, using the already existing strndup_from_user()?
      
      [akpm@linux-foundation.org: make copy_mount_string() static]
      [AV: fix compat mount breakage, which involves undoing akpm's change above]
      Reported-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NVegard Nossum <vegard.nossum@gmail.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Pekka Enberg <penberg@cs.helsinki.fi>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: Nal <al@dizzy.pdmi.ras.ru>
      eca6f534
  4. 08 8月, 2009 1 次提交
  5. 09 7月, 2009 1 次提交
  6. 24 6月, 2009 2 次提交
  7. 23 6月, 2009 2 次提交
    • T
      VFS: Add VFS helper functions for setting up private namespaces · cf8d2c11
      Trond Myklebust 提交于
      The purpose of this patch is to improve the remote mount path lookup
      support for distributed filesystems such as the NFSv4 client.
      
      When given a mount command of the form "mount server:/foo/bar /mnt", the
      NFSv4 client is required to look up the filehandle for "server:/", and
      then look up each component of the remote mount path "foo/bar" in order
      to find the directory that is actually going to be mounted on /mnt.
      Following that remote mount path may involve following symlinks,
      crossing server-side mount points and even following referrals to
      filesystem volumes on other servers.
      
      Since the standard VFS path lookup code already supports walking paths
      that contain all these features (using in-kernel automounts for
      following referrals) we would like to be able to reuse that rather than
      duplicate the full path traversal functionality in the NFSv4 client code.
      
      This patch therefore defines a VFS helper function create_mnt_ns(), that
      sets up a temporary filesystem namespace and attaches a root filesystem to
      it. It exports the create_mnt_ns() and put_mnt_ns() function for use by
      filesystem modules.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      cf8d2c11
    • T
      VFS: Uninline the function put_mnt_ns() · 616511d0
      Trond Myklebust 提交于
      In order to allow modules to use it without having to export vfsmount_lock.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      616511d0
  8. 12 6月, 2009 10 次提交
  9. 09 5月, 2009 2 次提交
  10. 21 4月, 2009 1 次提交
  11. 20 4月, 2009 1 次提交
  12. 01 4月, 2009 3 次提交
  13. 28 3月, 2009 1 次提交
  14. 27 3月, 2009 2 次提交
  15. 18 2月, 2009 1 次提交
    • A
      Fix incomplete __mntput locking · 1a88b536
      Al Viro 提交于
      Getting this wrong caused
      
      	WARNING: at fs/namespace.c:636 mntput_no_expire+0xac/0xf2()
      
      due to optimistically checking cpu_writer->mnt outside the spinlock.
      
      Here's what we really want:
       * we know that nobody will set cpu_writer->mnt to mnt from now on
       * all changes to that sucker are done under cpu_writer->lock
       * we want the laziest equivalent of
      	spin_lock(&cpu_writer->lock);
      	if (likely(cpu_writer->mnt != mnt)) {
      		spin_unlock(&cpu_writer->lock);
      		continue;
      	}
      	/* do stuff */
        that would make sure we won't miss earlier setting of ->mnt done by
        another CPU.
      
      Anyway, for now we just move the spin_lock() earlier and move the test
      into the properly locked region.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      Reported-and-tested-by: NLi Zefan <lizf@cn.fujitsu.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      1a88b536
  16. 14 1月, 2009 2 次提交
  17. 01 1月, 2009 1 次提交
  18. 14 11月, 2008 1 次提交
  19. 13 11月, 2008 1 次提交
  20. 23 10月, 2008 3 次提交
  21. 01 8月, 2008 1 次提交
  22. 27 7月, 2008 1 次提交
    • A
      [PATCH] sanitize __user_walk_fd() et.al. · 2d8f3038
      Al Viro 提交于
      * do not pass nameidata; struct path is all the callers want.
      * switch to new helpers:
      	user_path_at(dfd, pathname, flags, &path)
      	user_path(pathname, &path)
      	user_lpath(pathname, &path)
      	user_path_dir(pathname, &path)  (fail if not a directory)
        The last 3 are trivial macro wrappers for the first one.
      * remove nameidata in callers.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      2d8f3038