1. 07 7月, 2015 31 次提交
  2. 05 7月, 2015 3 次提交
  3. 04 7月, 2015 1 次提交
  4. 01 7月, 2015 5 次提交
    • E
      vfs: Remove incorrect debugging WARN in prepend_path · 93e3bce6
      Eric W. Biederman 提交于
      The warning message in prepend_path is unclear and outdated.  It was
      added as a warning that the mechanism for generating names of pseudo
      files had been removed from prepend_path and d_dname should be used
      instead.  Unfortunately the warning reads like a general warning,
      making it unclear what to do with it.
      
      Remove the warning.  The transition it was added to warn about is long
      over, and I added code several years ago which in rare cases causes
      the warning to fire on legitimate code, and the warning is now firing
      and scaring people for no good reason.
      
      Cc: stable@vger.kernel.org
      Reported-by: NIvan Delalande <colona@arista.com>
      Reported-by: NOmar Sandoval <osandov@osandov.com>
      Fixes: f48cfddc ("vfs: In d_path don't call d_dname on a mount point")
      Signed-off-by: N"Eric W. Biederman" <ebiederm@xmission.com>
      93e3bce6
    • E
      mnt: Update fs_fully_visible to test for permanently empty directories · 7236c85e
      Eric W. Biederman 提交于
      fs_fully_visible attempts to make fresh mounts of proc and sysfs give
      the mounter no more access to proc and sysfs than if they could have
      by creating a bind mount.  One aspect of proc and sysfs that makes
      this particularly tricky is that there are other filesystems that
      typically mount on top of proc and sysfs.  As those filesystems are
      mounted on empty directories in practice it is safe to ignore them.
      However testing to ensure filesystems are mounted on empty directories
      has not been something the in kernel data structures have supported so
      the current test for an empty directory which checks to see
      if nlink <= 2 is a bit lacking.
      
      proc and sysfs have recently been modified to use the new empty_dir
      infrastructure to create all of their dedicated mount points.  Instead
      of testing for S_ISDIR(inode->i_mode) && i_nlink <= 2 to see if a
      directory is empty, test for is_empty_dir_inode(inode).  That small
      change guaranteess mounts found on proc and sysfs really are safe to
      ignore, because the directories are not only empty but nothing can
      ever be added to them.  This guarantees there is nothing to worry
      about when mounting proc and sysfs.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: N"Eric W. Biederman" <ebiederm@xmission.com>
      7236c85e
    • E
      sysfs: Create mountpoints with sysfs_create_mount_point · f9bb4882
      Eric W. Biederman 提交于
      This allows for better documentation in the code and
      it allows for a simpler and fully correct version of
      fs_fully_visible to be written.
      
      The mount points converted and their filesystems are:
      /sys/hypervisor/s390/       s390_hypfs
      /sys/kernel/config/         configfs
      /sys/kernel/debug/          debugfs
      /sys/firmware/efi/efivars/  efivarfs
      /sys/fs/fuse/connections/   fusectl
      /sys/fs/pstore/             pstore
      /sys/kernel/tracing/        tracefs
      /sys/fs/cgroup/             cgroup
      /sys/kernel/security/       securityfs
      /sys/fs/selinux/            selinuxfs
      /sys/fs/smackfs/            smackfs
      
      Cc: stable@vger.kernel.org
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: N"Eric W. Biederman" <ebiederm@xmission.com>
      f9bb4882
    • E
      sysfs: Add support for permanently empty directories to serve as mount points. · 87d2846f
      Eric W. Biederman 提交于
      Add two functions sysfs_create_mount_point and
      sysfs_remove_mount_point that hang a permanently empty directory off
      of a kobject or remove a permanently emptpy directory hanging from a
      kobject.  Export these new functions so modular filesystems can use
      them.
      
      Cc: stable@vger.kernel.org
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: N"Eric W. Biederman" <ebiederm@xmission.com>
      87d2846f
    • E
      kernfs: Add support for always empty directories. · ea015218
      Eric W. Biederman 提交于
      Add a new function kernfs_create_empty_dir that can be used to create
      directory that can not be modified.
      
      Update the code to use make_empty_dir_inode when reporting a
      permanently empty directory to the vfs.
      
      Update the code to not allow adding to permanently empty directories.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: N"Eric W. Biederman" <ebiederm@xmission.com>
      ea015218