From 8756fc6a502c7da19a2220f94cded32d75279504 Mon Sep 17 00:00:00 2001 From: Casey Schaufler Date: Thu, 1 Nov 2012 18:14:32 -0700 Subject: [PATCH] --- yaml --- r: 344837 b: refs/heads/master c: e93072374112db9dc86635934ee761249be28370 h: refs/heads/master i: 344835: 92ba23be647c11acc110030d941f17bcb0f67304 v: v3 --- [refs] | 2 +- trunk/security/smack/smackfs.c | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 0e8ece58fd22..3a0d1d35b3a9 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 111fe8bd65e473d5fc6a0478cf1e2c8c6a77489a +refs/heads/master: e93072374112db9dc86635934ee761249be28370 diff --git a/trunk/security/smack/smackfs.c b/trunk/security/smack/smackfs.c index 99929a50093a..76a5dca46404 100644 --- a/trunk/security/smack/smackfs.c +++ b/trunk/security/smack/smackfs.c @@ -2063,6 +2063,19 @@ static const struct file_operations smk_revoke_subj_ops = { .llseek = generic_file_llseek, }; +static struct kset *smackfs_kset; +/** + * smk_init_sysfs - initialize /sys/fs/smackfs + * + */ +static int smk_init_sysfs(void) +{ + smackfs_kset = kset_create_and_add("smackfs", NULL, fs_kobj); + if (!smackfs_kset) + return -ENOMEM; + return 0; +} + /** * smk_fill_super - fill the /smackfs superblock * @sb: the empty superblock @@ -2183,6 +2196,10 @@ static int __init init_smk_fs(void) if (!security_module_enable(&smack_ops)) return 0; + err = smk_init_sysfs(); + if (err) + printk(KERN_ERR "smackfs: sysfs mountpoint problem.\n"); + err = register_filesystem(&smk_fs_type); if (!err) { smackfs_mount = kern_mount(&smk_fs_type);