forked from bottlerocket-os/bottlerocket
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path9005-core-mount-etc-with-specific-label.patch
More file actions
29 lines (25 loc) · 1.39 KB
/
9005-core-mount-etc-with-specific-label.patch
File metadata and controls
29 lines (25 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
From f27f7f0d1be1b4c580d07f8025268c0ab72260e8 Mon Sep 17 00:00:00 2001
From: Ben Cressey <bcressey@amazon.com>
Date: Thu, 9 Jul 2020 20:00:36 +0000
Subject: [PATCH 9005/9009] core: mount /etc with specific label
The filesystem is mounted after we load the SELinux policy, so we can
apply the label we need to restrict access.
Signed-off-by: Ben Cressey <bcressey@amazon.com>
---
src/core/mount-setup.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/core/mount-setup.c b/src/core/mount-setup.c
index 915b101..38c1a29 100644
--- a/src/core/mount-setup.c
+++ b/src/core/mount-setup.c
@@ -76,6 +76,8 @@ static const MountPoint mount_table[] = {
{ "tmpfs", "/dev/shm", "tmpfs", "mode=1777,smackfsroot=*", MS_NOSUID|MS_NODEV|MS_STRICTATIME,
mac_smack_use, MNT_FATAL },
#endif
+ { "tmpfs", "/etc", "tmpfs", "mode=755,context=system_u:object_r:etc_t:s0", MS_NOSUID|MS_NODEV|MS_NOATIME|MS_NOEXEC,
+ NULL, MNT_FATAL|MNT_IN_CONTAINER },
{ "tmpfs", "/dev/shm", "tmpfs", "mode=1777", MS_NOSUID|MS_NODEV|MS_STRICTATIME,
NULL, MNT_FATAL|MNT_IN_CONTAINER },
{ "devpts", "/dev/pts", "devpts", "mode=620,gid=" STRINGIFY(TTY_GID), MS_NOSUID|MS_NOEXEC,
--
2.21.3