Files
systemd/man
Ricardo Branco 2d3dd0a4fc 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 590ff29a641a4ddb736ea59303af9721fc6c1400)
2026-10-16 17:24:52 +01:00
..
2024-12-25 17:00:31 +01:00
2023-12-25 09:15:53 +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
2026-05-18 21:42:56 +02:00
2025-08-11 10:30:26 +02:00
2025-08-11 10:30:26 +02: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
2023-12-26 08:59:53 +01:00
2023-12-26 08:59:53 +01:00
2023-12-26 13:10:36 +01:00
2026-02-20 01:18:54 +09:00
2026-09-18 20:23:00 +02:00
2025-07-16 05:47:38 +09:00
2023-12-24 09:32:26 +01:00
2024-11-06 19:06:40 +09:00
2025-09-18 10:57:38 +01:00