Blame SOURCES/0003-systemd-Add-more-filesystem-lockdown.patch

e0630b
From 73a9c0902e7c97adf96e735407a75033152c04a9 Mon Sep 17 00:00:00 2001
e0630b
From: Bastien Nocera <hadess@hadess.net>
e0630b
Date: Wed, 13 Sep 2017 15:37:11 +0200
e0630b
Subject: [PATCH 3/4] systemd: Add more filesystem lockdown
e0630b
e0630b
We can only access the configuration file as read-only and read-write
e0630b
to the Bluetooth cache directory and sub-directories.
e0630b
---
e0630b
 Makefile.am              | 2 ++
e0630b
 src/bluetooth.service.in | 4 ++++
e0630b
 2 files changed, 6 insertions(+)
e0630b
e0630b
diff --git a/Makefile.am b/Makefile.am
e0630b
index 1c38d94e5..13ccf9079 100644
e0630b
--- a/Makefile.am
e0630b
+++ b/Makefile.am
e0630b
@@ -478,6 +478,8 @@ MAINTAINERCLEANFILES = Makefile.in \
e0630b
 
e0630b
 SED_PROCESS = $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
e0630b
 		$(SED) -e 's,@libexecdir\@,$(libexecdir),g' \
e0630b
+		       -e 's,@statedir\@,$(statedir),g' \
e0630b
+		       -e 's,@confdir\@,$(confdir),g' \
e0630b
 		< $< > $@
e0630b
 
e0630b
 %.service: %.service.in Makefile
e0630b
diff --git a/src/bluetooth.service.in b/src/bluetooth.service.in
e0630b
index a6f3030f9..7e55b5043 100644
e0630b
--- a/src/bluetooth.service.in
e0630b
+++ b/src/bluetooth.service.in
e0630b
@@ -17,6 +17,10 @@ LimitNPROC=1
e0630b
 ProtectHome=true
e0630b
 ProtectSystem=full
e0630b
 PrivateTmp=true
e0630b
+ProtectKernelTunables=true
e0630b
+ProtectControlGroups=true
e0630b
+ReadWritePaths=@statedir@
e0630b
+ReadOnlyPaths=@confdir@
e0630b
 
e0630b
 # Privilege escalation
e0630b
 NoNewPrivileges=true
e0630b
-- 
e0630b
2.14.1
e0630b