aha/fs/sysfs
David P. Quigley ddd29ec659 sysfs: Add labeling support for sysfs
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: David P. Quigley <dpquigl@tycho.nsa.gov>
Signed-off-by: Stephen D. Smalley <sds@tycho.nsa.gov>
Signed-off-by: James Morris <jmorris@namei.org>
2009-09-10 10:11:29 +10:00
..
bin.c Free the memory allocated by memdup_user() in fs/sysfs/bin.c 2009-07-08 09:34:07 -07:00
dir.c sysfs: Add labeling support for sysfs 2009-09-10 10:11:29 +10:00
file.c sysfs: file.c: use create_singlethread_workqueue() 2009-05-28 14:24:07 -07:00
group.c
inode.c sysfs: Add labeling support for sysfs 2009-09-10 10:11:29 +10:00
Kconfig fs/Kconfig: move sysfs out 2009-01-22 13:15:56 +03:00
Makefile
mount.c sysfs: reference sysfs_dirent from sysfs inodes 2009-03-24 16:38:25 -07:00
symlink.c sysfs: Add labeling support for sysfs 2009-09-10 10:11:29 +10:00
sysfs.h sysfs: Add labeling support for sysfs 2009-09-10 10:11:29 +10:00