diff options
author | Tejun Heo <tj@kernel.org> | 2013-11-23 17:40:02 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-12-04 07:34:45 -0800 |
commit | 2322392b020badfe49730f1529b9c1a15248c387 (patch) | |
tree | da17c0d183045351ae25f8173f2c0cfd7c7b8a55 /fs/kernfs/symlink.c | |
parent | 9a8049affd55a2c857a89faece27b878416fbf91 (diff) | |
download | linux-2322392b020badfe49730f1529b9c1a15248c387.tar.bz2 |
kernfs: implement "trusted.*" xattr support
kernfs inherited "security.*" xattr support from sysfs. This patch
extends xattr support to "trusted.*" using simple_xattr_*(). As
trusted xattrs are restricted to CAP_SYS_ADMIN, simple_xattr_*() which
uses kernel memory for storage shouldn't be problematic.
Note that the existing "security.*" support doesn't implement
get/remove/list and the this patch only implements those ops for
"trusted.*". We probably want to extend those ops to include support
for "security.*".
This patch will allow using kernfs from cgroup which requires
"trusted.*" xattr support.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: David P. Quigley <dpquigl@tycho.nsa.gov>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/kernfs/symlink.c')
-rw-r--r-- | fs/kernfs/symlink.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/kernfs/symlink.c b/fs/kernfs/symlink.c index 12569a738837..adf28755b0ee 100644 --- a/fs/kernfs/symlink.c +++ b/fs/kernfs/symlink.c @@ -140,6 +140,9 @@ static void sysfs_put_link(struct dentry *dentry, struct nameidata *nd, const struct inode_operations sysfs_symlink_inode_operations = { .setxattr = sysfs_setxattr, + .removexattr = sysfs_removexattr, + .getxattr = sysfs_getxattr, + .listxattr = sysfs_listxattr, .readlink = generic_readlink, .follow_link = sysfs_follow_link, .put_link = sysfs_put_link, |