1. 17 2月, 2010 1 次提交
  2. 12 12月, 2009 7 次提交
  3. 11 9月, 2009 1 次提交
  4. 10 9月, 2009 1 次提交
    • D
      sysfs: Add labeling support for sysfs · ddd29ec6
      David P. Quigley 提交于
      This patch adds a setxattr handler to the file, directory, and symlink
      inode_operations structures for sysfs. The patch uses hooks introduced in the
      previous patch to handle the getting and setting of security information for
      the sysfs inodes. As was suggested by Eric Biederman the struct iattr in the
      sysfs_dirent structure has been replaced by a structure which contains the
      iattr, secdata and secdata length to allow the changes to persist in the event
      that the inode representing the sysfs_dirent is evicted. Because sysfs only
      stores this information when a change is made all the optional data is moved
      into one dynamically allocated field.
      
      This patch addresses an issue where SELinux was denying virtd access to the PCI
      configuration entries in sysfs. The lack of setxattr handlers for sysfs
      required that a single label be assigned to all entries in sysfs. Granting virtd
      access to every entry in sysfs is not an acceptable solution so fine grained
      labeling of sysfs is required such that individual entries can be labeled
      appropriately.
      
      [sds:  Fixed compile-time warnings, coding style, and setting of inode security init flags.]
      Signed-off-by: NDavid P. Quigley <dpquigl@tycho.nsa.gov>
      Signed-off-by: NStephen D. Smalley <sds@tycho.nsa.gov>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      ddd29ec6
  5. 25 3月, 2009 1 次提交
  6. 06 1月, 2009 1 次提交
  7. 01 5月, 2008 1 次提交
    • B
      sysfs: Disallow truncation of files in sysfs · 40a2159a
      Ben Hutchings 提交于
      sysfs allows attribute files to be truncated, e.g. using ftruncate(), with the
      expected effect on their inode.   For most attributes, this doesn't change the
      "real" size of the file i.e. how much can be read from it.  However, the
      parameter validation for reading and writing binary attribute files is based
      on the inode size and not the size specified in the file's bin_attribute, so it
      can be broken by this. For example, if we try using dd to write to such a file:
      
      # pwd
      /sys/bus/pci/devices/0000:08:00.0
      # ls -l config
      -rw-r--r--  1 root root 4096 Feb  1 17:35 config
      # dd if=/dev/zero of=config bs=4 count=1
      1+0 records in
      1+0 records out
      # ls -l config
      -rw-r--r--  1 root root 0 Feb  1 17:50 config
      # dd if=/dev/zero of=config bs=4 count=1 seek=128
      dd: writing `config': No space left on device
      1+0 records in
      0+0 records out
      
      Also, after truncation to 0, parameter validation for read and write is
      disabled.  Most bin_attribute read and write methods also validate the size and
      offset, but for some this will allow out-of-range access.  This may be a
      security issue, though access to such files is often limited to root.  In any
      case, the validation should remain for safety's sake!)
      
      This was previously reported in Bugzilla as bug 9867.
      
      sysfs should ignore size changes or else refuse them (by returning -EINVAL).
      This patch makes it ignore them.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      40a2159a
  8. 30 4月, 2008 1 次提交
  9. 17 10月, 2007 2 次提交
  10. 13 10月, 2007 10 次提交
  11. 19 7月, 2007 1 次提交
  12. 12 7月, 2007 13 次提交