summaryrefslogtreecommitdiff
path: root/security/smack/smackfs.c
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2008-04-04 16:00:03 +1100
committerStephen Rothwell <sfr@canb.auug.org.au>2008-04-04 16:00:03 +1100
commit4c1b5fa0d34e0e6a6a5ba54961ea11bb726db69c (patch)
treeaa3e017308006b0ea7279899b05360545ce7817e /security/smack/smackfs.c
parent5882932ffb7027085f2b1056c358555092be47ab (diff)
parent0dfd10916e08263ac371894e5633c93009475e88 (diff)
Merge commit 'security-testing/next'
Diffstat (limited to 'security/smack/smackfs.c')
-rw-r--r--security/smack/smackfs.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/security/smack/smackfs.c b/security/smack/smackfs.c
index cfae8afcc262..6ba283783b70 100644
--- a/security/smack/smackfs.c
+++ b/security/smack/smackfs.c
@@ -965,12 +965,21 @@ static struct vfsmount *smackfs_mount;
*
* register the smackfs
*
- * Returns 0 unless the registration fails.
+ * Do not register smackfs if Smack wasn't enabled
+ * on boot. We can not put this method normally under the
+ * smack_init() code path since the security subsystem get
+ * initialized before the vfs caches.
+ *
+ * Returns true if we were not chosen on boot or if
+ * we were chosen and filesystem registration succeeded.
*/
static int __init init_smk_fs(void)
{
int err;
+ if (!security_module_enable(&smack_ops))
+ return 0;
+
err = register_filesystem(&smk_fs_type);
if (!err) {
smackfs_mount = kern_mount(&smk_fs_type);