Skip to contentSkip to conversation

mcstrans: preserve runtime directory

PATCH In review Christian Göttsche 3 participants 3 messages Jan 17, 2023 – Feb 1, 2023 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mcstrans: preserve runtime directory

Do not remove the runtime directory /run/setrans/, which is the parent for the security context translation socket .setrans-unix, when the service is stopped, so the path can not be taken over by a foreign program, which could lead to a compromise of the context translation of libselinux.

---
 mcstrans/src/mcstrans.service | 1 +
 1 file changed, 1 insertion(+)
mcstrans/src/mcstrans.service +1 -0
index c13cd09a..fdcfb0d4 100644
@@ -9,6 +9,7 @@ Conflicts=shutdown.target
 [Service]
 ExecStart=/sbin/mcstransd -f
 RuntimeDirectory=setrans
+RuntimeDirectoryPreserve=true
 
 [Install]
 WantedBy=multi-user.target
Signature · 1 line
2.39.0
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Christian Göttsche

Do not remove the runtime directory /run/setrans/, which is the parent for the security context translation socket .setrans-unix, when the service is stopped, so the path can not be taken over by a foreign program, which could lead to a compromise of the context translation of libselinux.

Quoted 19 lines
---
 mcstrans/src/mcstrans.service | 1 +
 1 file changed, 1 insertion(+)
mcstrans/src/mcstrans.service +1 -1
index c13cd09a..fdcfb0d4 100644
@@ -9,6 +9,7 @@ Conflicts=shutdown.target
 [Service]
 ExecStart=/sbin/mcstransd -f
 RuntimeDirectory=setrans
+RuntimeDirectoryPreserve=true
 
 [Install]
 WantedBy=multi-user.target
--

2.39.0

#2 lore raw
In reply to Christian Göttsche
Quoted 7 lines · Christian Göttsche

Do not remove the runtime directory /run/setrans/, which is the parent for the security context translation socket .setrans-unix, when the service is stopped, so the path can not be taken over by a foreign program, which could lead to a compromise of the context translation of libselinux.

I lost Jim's Acked-by mail but according to
https://lore.kernel.org/all/CAP+JOzSvvg_2pZ6aeLGs9Oqh2nK0zpBGAURwbofh9DSAT39iVw@mail.gmail.com/
it was acked and it's merged now.

Thanks.

Quoted 18 lines
---
 mcstrans/src/mcstrans.service | 1 +
 1 file changed, 1 insertion(+)
mcstrans/src/mcstrans.service +1 -0
index c13cd09a..fdcfb0d4 100644
@@ -9,6 +9,7 @@ Conflicts=shutdown.target
 [Service]
 ExecStart=/sbin/mcstransd -f
 RuntimeDirectory=setrans
+RuntimeDirectoryPreserve=true
 
 [Install]
 WantedBy=multi-user.target
Signature · 1 line
2.39.0