mkinitrd unification across distributions
 help / color / mirror / Atom feed
* [PATCH 1/2] systemd: mount the securityfs filesystem at early stage
@ 2012-02-15 13:23 Roberto Sassu
  2012-02-15 13:23 ` [PATCH 2/2] main: added support for loading IMA custom policies Roberto Sassu
       [not found] ` <1329312229-11856-1-git-send-email-roberto.sassu-8RLafaVCWuNeoWH0uzbU5w@public.gmane.org>
  0 siblings, 2 replies; 42+ messages in thread
From: Roberto Sassu @ 2012-02-15 13:23 UTC (permalink / raw)
  To: systemd-devel
  Cc: linux-security-module, linux-ima-user, initramfs, ramunno, zohar,
	mzerqung, harald, Roberto Sassu

[-- Attachment #1: Type: text/plain, Size: 4231 bytes --]

The mount of the securityfs filesystem is now performed in the main systemd
executable as it is used by IMA to provide the interface for loading custom
policies. The unit file 'units/sys-kernel-security.mount' has been removed
because it is not longer necessary.

Signed-off-by: Roberto Sassu <roberto.sassu@polito.it>
Acked-by: Gianluca Ramunno <ramunno@polito.it>
---
 Makefile.am                     |    3 ---
 src/mount-setup.c               |    6 ++++--
 src/mount-setup.h               |    2 ++
 units/sys-kernel-security.mount |   17 -----------------
 4 files changed, 6 insertions(+), 22 deletions(-)
 delete mode 100644 units/sys-kernel-security.mount

diff --git a/Makefile.am b/Makefile.am
index 983ea16..d3d0ed8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -291,7 +291,6 @@ dist_systemunit_DATA = \
 	units/dev-mqueue.mount \
 	units/sys-kernel-config.mount \
 	units/sys-kernel-debug.mount \
-	units/sys-kernel-security.mount \
 	units/sys-fs-fuse-connections.mount \
 	units/var-run.mount \
 	units/media.mount \
@@ -2374,7 +2373,6 @@ systemd-install-data-hook:
 			dev-mqueue.mount \
 			sys-kernel-config.mount \
 			sys-kernel-debug.mount \
-			sys-kernel-security.mount \
 			sys-fs-fuse-connections.mount \
 			systemd-modules-load.service \
 			systemd-tmpfiles-setup.service \
@@ -2384,7 +2382,6 @@ systemd-install-data-hook:
 		$(LN_S) ../dev-mqueue.mount dev-mqueue.mount && \
 		$(LN_S) ../sys-kernel-config.mount sys-kernel-config.mount && \
 		$(LN_S) ../sys-kernel-debug.mount sys-kernel-debug.mount && \
-		$(LN_S) ../sys-kernel-security.mount sys-kernel-security.mount && \
 		$(LN_S) ../sys-fs-fuse-connections.mount sys-fs-fuse-connections.mount && \
 		$(LN_S) ../systemd-modules-load.service systemd-modules-load.service && \
 		$(LN_S) ../systemd-tmpfiles-setup.service systemd-tmpfiles-setup.service && \
diff --git a/src/mount-setup.c b/src/mount-setup.c
index 7c14ea8..62bf743 100644
--- a/src/mount-setup.c
+++ b/src/mount-setup.c
@@ -51,13 +51,15 @@ typedef struct MountPoint {
 } MountPoint;
 
 /* The first three entries we might need before SELinux is up. The
- * other ones we can delay until SELinux is loaded. */
-#define N_EARLY_MOUNT 3
+ * fourth (securityfs) is needed by IMA to load a custom policy. The
+ * other ones we can delay until SELinux and IMA are loaded. */
+#define N_EARLY_MOUNT 4
 
 static const MountPoint mount_table[] = {
         { "proc",     "/proc",                  "proc",     NULL,                MS_NOSUID|MS_NOEXEC|MS_NODEV, true },
         { "sysfs",    "/sys",                   "sysfs",    NULL,                MS_NOSUID|MS_NOEXEC|MS_NODEV, true },
         { "devtmpfs", "/dev",                   "devtmpfs", "mode=755",          MS_NOSUID,                    true },
+        { "securityfs", SECURITYFS_MNTPOINT,    "securityfs", NULL,              MS_NOSUID|MS_NOEXEC|MS_NODEV, false },
         { "tmpfs",    "/dev/shm",               "tmpfs",    "mode=1777",         MS_NOSUID|MS_NODEV,           true },
         { "devpts",   "/dev/pts",               "devpts",   "mode=620,gid=" STRINGIFY(TTY_GID), MS_NOSUID|MS_NOEXEC, false },
         { "tmpfs",    "/run",                   "tmpfs",    "mode=755",          MS_NOSUID|MS_NODEV, true },
diff --git a/src/mount-setup.h b/src/mount-setup.h
index c1a27ba..df6f518 100644
--- a/src/mount-setup.h
+++ b/src/mount-setup.h
@@ -24,6 +24,8 @@
 
 #include <stdbool.h>
 
+#define SECURITYFS_MNTPOINT "/sys/kernel/security"
+
 int mount_setup_early(void);
 
 int mount_setup(bool loaded_policy);
diff --git a/units/sys-kernel-security.mount b/units/sys-kernel-security.mount
deleted file mode 100644
index 80cd761..0000000
--- a/units/sys-kernel-security.mount
+++ /dev/null
@@ -1,17 +0,0 @@
-#  This file is part of systemd.
-#
-#  systemd is free software; you can redistribute it and/or modify it
-#  under the terms of the GNU General Public License as published by
-#  the Free Software Foundation; either version 2 of the License, or
-#  (at your option) any later version.
-
-[Unit]
-Description=Security File System
-DefaultDependencies=no
-ConditionPathExists=/sys/kernel/security
-Before=sysinit.target
-
-[Mount]
-What=securityfs
-Where=/sys/kernel/security
-Type=securityfs
-- 
1.7.7.6


[-- Attachment #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 2061 bytes --]

^ permalink raw reply related	[flat|nested] 42+ messages in thread

end of thread, other threads:[~2012-02-21 19:06 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-15 13:23 [PATCH 1/2] systemd: mount the securityfs filesystem at early stage Roberto Sassu
2012-02-15 13:23 ` [PATCH 2/2] main: added support for loading IMA custom policies Roberto Sassu
     [not found]   ` <1329312229-11856-2-git-send-email-roberto.sassu-8RLafaVCWuNeoWH0uzbU5w@public.gmane.org>
2012-02-15 14:30     ` [systemd-devel] " Gustavo Sverzut Barbieri
2012-02-15 16:26       ` Roberto Sassu
     [not found]         ` <4F3BDCAA.7040001-8RLafaVCWuNeoWH0uzbU5w@public.gmane.org>
2012-02-15 16:55           ` [systemd-devel] " Gustavo Sverzut Barbieri
     [not found]             ` <CAPdpN3C0xDeVBrbDxesPdEV+owf-q_wxUHTmr4YDCHw=NgPV1Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-15 17:12               ` Roberto Sassu
     [not found]                 ` <4F3BE763.9060704-8RLafaVCWuNeoWH0uzbU5w@public.gmane.org>
2012-02-16  4:56                   ` [Linux-ima-user] " Michael Cassaniti
2012-02-16 13:19                     ` Mimi Zohar
2012-02-16 13:38                     ` Roberto Sassu
2012-02-16 14:30                       ` Gustavo Sverzut Barbieri
     [not found]                         ` <CAPdpN3AAwJ6s-fOgTCV4h4OCKCw3RhEav56LJaUXWVpuf4Jowg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-16 14:35                           ` Roberto Sassu
2012-02-16 21:50                             ` Gustavo Sverzut Barbieri
2012-02-20 17:24                               ` [Linux-ima-user] " Lennart Poettering
2012-02-20 19:06                                 ` [systemd-devel] " Roberto Sassu
2012-02-20 19:18                                   ` Lennart Poettering
     [not found]                                     ` <20120220191804.GD360-kS5D54t9nk0aINubkmmoJbNAH6kLmebB@public.gmane.org>
2012-02-21 10:05                                       ` Roberto Sassu
     [not found]                                         ` <4F436C7A.9020206-8RLafaVCWuNeoWH0uzbU5w@public.gmane.org>
2012-02-21 13:01                                           ` [Linux-ima-user] [systemd-devel] " Mimi Zohar
2012-02-21 13:58                                             ` Roberto Sassu
2012-02-21 16:15                                               ` Mimi Zohar
2012-02-21 17:32                                                 ` Roberto Sassu
     [not found]                                                   ` <4F43D532.7070006-8RLafaVCWuNeoWH0uzbU5w@public.gmane.org>
2012-02-21 17:54                                                     ` Mimi Zohar
2012-02-21 17:56                                                   ` Kay Sievers
     [not found]                                                     ` <CAPXgP10zCVgj4gDTzkJ1+XqKSHhjrCHwkUazJ8caaeMF2j+mMg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-21 18:07                                                       ` Roberto Sassu
     [not found]                                                         ` <4F43DD49.2040202-8RLafaVCWuNeoWH0uzbU5w@public.gmane.org>
2012-02-21 19:06                                                           ` Kay Sievers
2012-02-21 14:07                                           ` [systemd-devel] [Linux-ima-user] " Colin Guthrie
2012-02-21 14:32                                             ` Kay Sievers
     [not found]                                               ` <CAPXgP13c1B80u14E4FrhZEJ89NDvDP--ciWikz0j+m4En6zPRQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-21 16:14                                                 ` Mimi Zohar
2012-02-21 18:25                                                   ` Roberto Sassu
2012-02-21 12:25                                       ` [Linux-ima-user] [systemd-devel] " Mimi Zohar
2012-02-20 17:21                           ` [systemd-devel] [Linux-ima-user] " Lennart Poettering
     [not found]                     ` <4F3C8C6F.4010708-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-02-20 17:18                       ` Lennart Poettering
2012-02-20 17:14                 ` [systemd-devel] " Lennart Poettering
2012-02-20 18:36                   ` Roberto Sassu
     [not found]                     ` <4F4292A4.2030402-8RLafaVCWuNeoWH0uzbU5w@public.gmane.org>
2012-02-20 19:07                       ` Lennart Poettering
2012-02-21  9:17                         ` Roberto Sassu
2012-02-20 17:13           ` Lennart Poettering
2012-02-20 17:12     ` Lennart Poettering
2012-02-20 18:23       ` Roberto Sassu
     [not found]         ` <4F428FB0.3000200-8RLafaVCWuNeoWH0uzbU5w@public.gmane.org>
2012-02-20 18:52           ` Lennart Poettering
     [not found]             ` <20120220185236.GB360-kS5D54t9nk0aINubkmmoJbNAH6kLmebB@public.gmane.org>
2012-02-20 19:11               ` Roberto Sassu
     [not found] ` <1329312229-11856-1-git-send-email-roberto.sassu-8RLafaVCWuNeoWH0uzbU5w@public.gmane.org>
2012-02-20 17:04   ` [systemd-devel] [PATCH 1/2] systemd: mount the securityfs filesystem at early stage Lennart Poettering
     [not found]     ` <20120220170436.GA26356-kS5D54t9nk0aINubkmmoJbNAH6kLmebB@public.gmane.org>
2012-02-20 18:02       ` Roberto Sassu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox