From ceb0be4dce6294559bc1dc78583bd10e49e0e7e1 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 10 May 2011 15:34:16 -0700 Subject: [PATCH] --- yaml --- r: 250807 b: refs/heads/master c: 7a627e3b9a2bd0f06945bbe64bcf403e788ecf6e h: refs/heads/master i: 250805: c1f19f33fed02ad8d4daf6773902f07e9b3c7153 250803: 1ea9588bec0d54921b48fe63b3156e858d2371f9 250799: 3c47e9e0f9d1a91048e914fdd4d8d931d9363563 v: v3 --- [refs] | 2 +- trunk/security/selinux/selinuxfs.c | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 009fc6352209..dcb6463b99fe 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 2875fa00830be62431f5ac22d8f85d57f9fa3033 +refs/heads/master: 7a627e3b9a2bd0f06945bbe64bcf403e788ecf6e diff --git a/trunk/security/selinux/selinuxfs.c b/trunk/security/selinux/selinuxfs.c index 973f5a4a6fce..fde4e9d64bfd 100644 --- a/trunk/security/selinux/selinuxfs.c +++ b/trunk/security/selinux/selinuxfs.c @@ -28,6 +28,7 @@ #include #include #include +#include /* selinuxfs pseudo filesystem for exporting the security policy API. Based on the proc code and the fs/nfsd/nfsctl.c code. */ @@ -1909,6 +1910,7 @@ static struct file_system_type sel_fs_type = { }; struct vfsmount *selinuxfs_mount; +static struct kobject *selinuxfs_kobj; static int __init init_sel_fs(void) { @@ -1916,9 +1918,16 @@ static int __init init_sel_fs(void) if (!selinux_enabled) return 0; + + selinuxfs_kobj = kobject_create_and_add("selinux", fs_kobj); + if (!selinuxfs_kobj) + return -ENOMEM; + err = register_filesystem(&sel_fs_type); - if (err) + if (err) { + kobject_put(selinuxfs_kobj); return err; + } selinuxfs_mount = kern_mount(&sel_fs_type); if (IS_ERR(selinuxfs_mount)) { @@ -1935,6 +1944,7 @@ __initcall(init_sel_fs); #ifdef CONFIG_SECURITY_SELINUX_DISABLE void exit_sel_fs(void) { + kobject_put(selinuxfs_kobj); unregister_filesystem(&sel_fs_type); } #endif