Files
systemd/man
Ricardo Branco c68d985924 seccomp: also refuse sched_setattr() in RestrictRealtime=
RestrictRealtime= only filtered sched_setscheduler(). sched_setattr()
can switch a task to SCHED_FIFO and SCHED_RR as well, and is the only
way to get SCHED_DEADLINE, so a process that is otherwise allowed to use
realtime scheduling (CAP_SYS_NICE, or a non-zero RLIMIT_RTPRIO) could
bypass the restriction.

The policy is passed in a struct sched_attr by pointer, which seccomp
cannot inspect, so refuse the syscall altogether. This also affects
non-realtime callers of sched_setattr() (nice, utilization clamps),
which now get the same error as the refused policies. Document this in
systemd.exec(5) and extend the test.

CPUSchedulingPolicy= is applied through sched_setattr(), so a service
manager running under RestrictRealtime=yes (e.g. in a container) could
no longer start units with a non-realtime policy. Fall back to
sched_setscheduler() on EPERM, which the filter still allows for these
policies. This is not possible with CPUSchedulingResetOnFork=yes, as the
filter refuses SCHED_RESET_ON_FORK too, so setting the policy still
fails in that case.

Signed-off-by: Ricardo Branco <rbranco@suse.de>
(cherry picked from commit 590ff29a64)
(cherry picked from commit 2d3dd0a4fc)
(cherry picked from commit a9f077a4f3)
2026-10-17 14:45:51 +01:00
..
2024-12-25 17:00:31 +01:00
2025-09-18 10:57:38 +01:00
2025-08-10 13:40:32 +02:00
2025-08-11 10:30:26 +02:00
2025-10-04 18:13:27 +02:00
2025-08-11 10:30:26 +02:00
2025-08-11 10:30:26 +02:00
2026-05-22 13:32:04 +01:00
2024-12-25 17:00:31 +01:00
2024-12-25 17:00:31 +01:00
2025-08-10 13:40:32 +02:00
2026-02-20 01:18:54 +09:00
2026-02-21 03:00:51 +09:00
2025-08-04 05:30:16 +09:00
2026-10-17 14:45:49 +01:00
2026-02-26 05:26:36 +09:00
2025-07-16 05:47:38 +09:00
2026-06-23 15:14:18 +01:00
…
2024-11-06 19:06:40 +09:00
2025-09-18 10:57:38 +01:00
…