]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfsprogs-dev.git/commitdiff
xfs_scrub_all_fail: reduce security lockdowns to avoid postfix problems
authorDarrick J. Wong <djwong@kernel.org>
Thu, 4 Jun 2026 06:05:07 +0000 (23:05 -0700)
committerAndrey Albershteyn <aalbersh@kernel.org>
Thu, 11 Jun 2026 10:26:04 +0000 (12:26 +0200)
The same lockdown logic of commit 9042fcc08eed6a ("xfs_scrub_fail:
tighten up the security on the background systemd service") was applied
to the media scan failure reporting service.  Therefore, it's also
broken on systems that have setgid mailer programs (e.g. postfix).  Fix
this by applying the same change from commit 15fd6fc686d5ce here too.

While we're at it, put this service in the background scrub slice for
resource control.

Cc: linux-xfs@vger.kernel.org # v6.17.0
Fixes: 15fd6fc686d5ce ("xfs_scrub_fail: reduce security lockdowns to avoid postfix problems")
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Fixes: e040916f649f ("xfs_scrub_all: failure reporting for the xfs_scrub_all job")
Reviewed-by: Andrey Albershteyn <aalbersh@kernel.org>
scrub/xfs_scrub_all_fail.service.in

index 53479db8477175d0a9a5cbb34d9dc275772b15ae..e11ca5460457a79b20565360cbf9c92838d14e66 100644 (file)
@@ -15,57 +15,10 @@ User=mail
 Group=mail
 SupplementaryGroups=systemd-journal
 
-# No realtime scheduling
-RestrictRealtime=true
+# Create the service underneath the scrub background service slice so that we
+# can control resource usage.
+Slice=system-xfs_scrub.slice
 
-# Make the entire filesystem readonly and /home inaccessible.
-ProtectSystem=full
-ProtectHome=yes
-PrivateTmp=true
-RestrictSUIDSGID=true
-
-# Emailing reports requires network access, but not the ability to change the
-# hostname.
-ProtectHostname=true
-
-# Don't let the program mess with the kernel configuration at all
-ProtectKernelLogs=true
-ProtectKernelModules=true
-ProtectKernelTunables=true
-ProtectControlGroups=true
-ProtectProc=invisible
-RestrictNamespaces=true
-
-# Can't hide /proc because journalctl needs it to find various pieces of log
-# information
-#ProcSubset=pid
-
-# Only allow the default personality Linux
-LockPersonality=true
-
-# No writable memory pages
-MemoryDenyWriteExecute=true
-
-# Don't let our mounts leak out to the host
-PrivateMounts=true
-
-# Restrict system calls to the native arch and only enough to get things going
-SystemCallArchitectures=native
-SystemCallFilter=@system-service
-SystemCallFilter=~@privileged
-SystemCallFilter=~@resources
-SystemCallFilter=~@mount
-
-# xfs_scrub needs these privileges to run, and no others
-CapabilityBoundingSet=
-NoNewPrivileges=true
-
-# Failure reporting shouldn't create world-readable files
-UMask=0077
-
-# Clean up any IPC objects when this unit stops
-RemoveIPC=true
-
-# No access to hardware device files
-PrivateDevices=true
-ProtectClock=true
+# No further restrictions because some installations may have MTAs such as
+# postfix, which require the ability to run setgid programs and other
+# foolishness.