chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a641dcd
)
core: remount /sys/fs/cgroup/ read-only after we mounted all controllers
author
Lennart Poettering
<lennart@poettering.net>
Tue, 18 Mar 2014 03:06:54 +0000
(
04:06
+0100)
committer
Lennart Poettering
<lennart@poettering.net>
Tue, 18 Mar 2014 03:48:26 +0000
(
04:48
+0100)
Given that glibc searches for /dev/shm by just looking for any tmpfs we
should be more careful with providing tmpfs instances arbitrary code
might end up writing to.
src/core/mount-setup.c
patch
|
blob
|
history
diff --git
a/src/core/mount-setup.c
b/src/core/mount-setup.c
index c6d3f4bbcc7142d6b41c9d6647762caf04028e4b..147333a6c65e7b8d5c96e38cc4f82828f392b917 100644
(file)
--- a/
src/core/mount-setup.c
+++ b/
src/core/mount-setup.c
@@
-338,6
+338,10
@@
int mount_cgroup_controllers(char ***join_controllers) {
}
}
+ /* Now that we mounted everything, let's make the tmpfs the
+ * cgroup file systems are mounted into read-only. */
+ mount("tmpfs", "/sys/fs/cgroup", "tmpfs", MS_REMOUNT|MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_STRICTATIME|MS_RDONLY, "mode=755");
+
return 0;
}