[systemd-devel] [PATCH] SELINUX: add /sys/fs/selinux mount point to put selinuxfs
Eric Paris
eparis at parisplace.org
Wed May 11 09:35:24 PDT 2011
On Tue, May 10, 2011 at 6:34 PM, Greg KH <greg at kroah.com> wrote:
>
> From: Greg Kroah-Hartman <gregkh at suse.de>
>
> In the interest of keeping userspace from having to create new root
> filesystems all the time, let's follow the lead of the other in-kernel
> filesystems and provide a proper mount point for it in sysfs.
>
> For selinuxfs, this mount point should be in /sys/fs/selinux/
>
> Cc: Stephen Smalley <sds at tycho.nsa.gov>
> Cc: James Morris <jmorris at namei.org>
> Cc: Eric Paris <eparis at parisplace.org>
> Cc: Lennart Poettering <mzerqung at 0pointer.de>
> Cc: Daniel J Walsh <dwalsh at redhat.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh at suse.de>
security/selinux/selinuxfs.c: In function ‘init_sel_fs’:
security/selinux/selinuxfs.c:1909: error: ‘selinux_kobj’ undeclared
(first use in this function)
security/selinux/selinuxfs.c:1909: error: (Each undeclared identifier
is reported only once
security/selinux/selinuxfs.c:1909: error: for each function it appears in.)
security/selinux/selinuxfs.c: In function ‘exit_sel_fs’:
security/selinux/selinuxfs.c:1934: error: implicit declaration of
function ‘kobjext_put’
security/selinux/selinuxfs.c:1934: error: ‘selinux_kobj’ undeclared
(first use in this function)
make[2]: *** [security/selinux/selinuxfs.o] Error 1
make[2]: *** Waiting for unfinished jobs....
>
> ---
>
> Resend, due to lack of response.
>
> Note, patch is untested, I don't have any selinux-based machines here,
> sorry.
>
>
> diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c
> index ea39cb7..2381c16 100644
> --- a/security/selinux/selinuxfs.c
> +++ b/security/selinux/selinuxfs.c
> @@ -1897,6 +1897,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)
> {
> @@ -1904,9 +1905,16 @@ static int __init init_sel_fs(void)
>
> if (!selinux_enabled)
> return 0;
> +
> + selinux_kobj = kobject_create_and_add("selinux", fs_kobj);
> + if (!selinux_kobj)
> + return -ENOMEM;
> +
> err = register_filesystem(&sel_fs_type);
> - if (err)
> + if (err) {
> + kobject_put(selinux_kobj);
> return err;
> + }
>
> selinuxfs_mount = kern_mount(&sel_fs_type);
> if (IS_ERR(selinuxfs_mount)) {
> @@ -1923,6 +1931,7 @@ __initcall(init_sel_fs);
> #ifdef CONFIG_SECURITY_SELINUX_DISABLE
> void exit_sel_fs(void)
> {
> + kobjext_put(selinux_kobj);
> unregister_filesystem(&sel_fs_type);
> }
> #endif
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
>
More information about the systemd-devel
mailing list