|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
From b654a1065f278c93b3891cc5993645026e0d3702 Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
From: Lennart Poettering <lennart@poettering.net>
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
Date: Fri, 4 Jul 2014 03:10:09 +0200
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
Subject: [PATCH] units: conditionalize configfs and debugfs with CAP_SYS_RAWIO
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
We really don't want these in containers as they provide a too lowlevel
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
look on the system.
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
Conditionalize them with CAP_SYS_RAWIO since that's required to access
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
/proc/kcore, /dev/kmem and similar, which feel similar in style. Also,
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
npsawn containers lack that capability.
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
(cherry picked from commit fa229d09281d435153b4cfd138a2a62fa66d889b)
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
units/sys-kernel-config.mount | 1 +
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
units/sys-kernel-debug.mount | 1 +
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
2 files changed, 2 insertions(+)
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
diff --git a/units/sys-kernel-config.mount b/units/sys-kernel-config.mount
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
index 020101c0d8..21648eff6a 100644
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
--- a/units/sys-kernel-config.mount
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+++ b/units/sys-kernel-config.mount
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
@@ -11,6 +11,7 @@ Documentation=https://www.kernel.org/doc/Documentation/filesystems/configfs/conf
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
Documentation=http://www.freedesktop.org/wiki/Software/systemd/APIFileSystems
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
DefaultDependencies=no
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
ConditionPathExists=/sys/kernel/config
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+ConditionCapability=CAP_SYS_RAWIO
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
After=systemd-modules-load.service
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
Before=sysinit.target
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
diff --git a/units/sys-kernel-debug.mount b/units/sys-kernel-debug.mount
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
index 5369728a9f..1e94387bac 100644
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
--- a/units/sys-kernel-debug.mount
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+++ b/units/sys-kernel-debug.mount
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
@@ -11,6 +11,7 @@ Documentation=https://www.kernel.org/doc/Documentation/filesystems/debugfs.txt
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
Documentation=http://www.freedesktop.org/wiki/Software/systemd/APIFileSystems
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
DefaultDependencies=no
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
ConditionPathExists=/sys/kernel/debug
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+ConditionCapability=CAP_SYS_RAWIO
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
Before=sysinit.target
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
[Mount]
|