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

505b3c
From 1da4185a89fba1c14032ab87757e5fb798d76bc0 Mon Sep 17 00:00:00 2001
505b3c
From: Gopal Tiwari <gtiwari@redhat.com>
505b3c
Date: Mon, 8 Jun 2020 19:55:39 +0530
505b3c
Subject: [PATCH BlueZ 3/4] systemd: Add more filesystem lockdown
505b3c
ab4cc4
From 73a9c0902e7c97adf96e735407a75033152c04a9 Mon Sep 17 00:00:00 2001
ab4cc4
From: Bastien Nocera <hadess@hadess.net>
ab4cc4
Date: Wed, 13 Sep 2017 15:37:11 +0200
505b3c
505b3c
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
---
ab4cc4
 Makefile.am              | 2 ++
ab4cc4
 src/bluetooth.service.in | 4 ++++
ab4cc4
 2 files changed, 6 insertions(+)
ab4cc4
ab4cc4
diff --git a/Makefile.am b/Makefile.am
505b3c
index cdd2fd8fb..0af1a8c45 100644
ab4cc4
--- a/Makefile.am
ab4cc4
+++ b/Makefile.am
505b3c
@@ -580,6 +580,8 @@ MAINTAINERCLEANFILES = Makefile.in \
ab4cc4
 
ab4cc4
 SED_PROCESS = $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
505b3c
 		$(SED) -e 's,@pkglibexecdir\@,$(pkglibexecdir),g' \
ab4cc4
+		       -e 's,@statedir\@,$(statedir),g' \
ab4cc4
+		       -e 's,@confdir\@,$(confdir),g' \
ab4cc4
 		< $< > $@
ab4cc4
 
ab4cc4
 %.service: %.service.in Makefile
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
-- 
505b3c
2.21.1
ab4cc4