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

b05691
From 1da4185a89fba1c14032ab87757e5fb798d76bc0 Mon Sep 17 00:00:00 2001
b05691
From: Gopal Tiwari <gtiwari@redhat.com>
b05691
Date: Mon, 8 Jun 2020 19:55:39 +0530
b05691
Subject: [PATCH BlueZ 3/4] systemd: Add more filesystem lockdown
b05691
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
b05691
b05691
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
b05691
index cdd2fd8fb..0af1a8c45 100644
e0630b
--- a/Makefile.am
e0630b
+++ b/Makefile.am
b05691
@@ -580,6 +580,8 @@ MAINTAINERCLEANFILES = Makefile.in \
e0630b
 
e0630b
 SED_PROCESS = $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
b05691
 		$(SED) -e 's,@pkglibexecdir\@,$(pkglibexecdir),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
b05691
index 7c2f60bb4..4daedef2a 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
-- 
b05691
2.21.1
e0630b