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

514bad
From 13a348670fef0047555395ce6977e86e0005f8bd Mon Sep 17 00:00:00 2001
ab4cc4
From: Bastien Nocera <hadess@hadess.net>
ab4cc4
Date: Wed, 13 Sep 2017 15:37:11 +0200
514bad
Subject: [PATCH 3/4] systemd: Add more filesystem lockdown
ab4cc4
ab4cc4
We can only access the configuration file as read-only and read-write
ab4cc4
to the Bluetooth cache directory and sub-directories.
ab4cc4
---
514bad
 Makefile.am              | 3 +++
ab4cc4
 src/bluetooth.service.in | 4 ++++
514bad
 2 files changed, 7 insertions(+)
ab4cc4
ab4cc4
diff --git a/Makefile.am b/Makefile.am
514bad
index ac88c12e0..0a6d09847 100644
ab4cc4
--- a/Makefile.am
ab4cc4
+++ b/Makefile.am
514bad
@@ -617,6 +617,9 @@
ab4cc4
 
ab4cc4
 SED_PROCESS = $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
505b3c
 		$(SED) -e 's,@pkglibexecdir\@,$(pkglibexecdir),g' \
514bad
+		       -e 's,@libexecdir\@,$(libexecdir),g' \
ab4cc4
+		       -e 's,@statedir\@,$(statedir),g' \
ab4cc4
+		       -e 's,@confdir\@,$(confdir),g' \
ab4cc4
 		< $< > $@
ab4cc4
 
514bad
 if RUN_RST2MAN
ab4cc4
diff --git a/src/bluetooth.service.in b/src/bluetooth.service.in
505b3c
index 7c2f60bb4..4daedef2a 100644
ab4cc4
--- a/src/bluetooth.service.in
ab4cc4
+++ b/src/bluetooth.service.in
ab4cc4
@@ -17,6 +17,10 @@ LimitNPROC=1
ab4cc4
 ProtectHome=true
ab4cc4
 ProtectSystem=full
ab4cc4
 PrivateTmp=true
ab4cc4
+ProtectKernelTunables=true
ab4cc4
+ProtectControlGroups=true
ab4cc4
+ReadWritePaths=@statedir@
ab4cc4
+ReadOnlyPaths=@confdir@
ab4cc4
 
ab4cc4
 # Privilege escalation
ab4cc4
 NoNewPrivileges=true
ab4cc4
-- 
514bad
2.21.0
ab4cc4