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
..
2025-11-22 10:19:41 +01:00
2025-10-17 21:11:23 +09:00
2026-09-11 08:18:43 +02:00
2026-01-02 04:05:45 +09:00
2026-10-16 17:24:50 +01:00
2025-12-24 07:37:58 +01:00
2026-04-13 13:20:43 +02:00
2026-04-12 15:27:15 +02:00
2025-12-15 08:50:13 +09:00
2026-08-01 03:23:40 +09:00
2026-08-01 03:23:21 +09:00
2026-08-31 23:33:40 +02:00
2026-08-31 23:33:39 +02:00
2026-10-16 17:24:50 +01:00
2026-10-16 17:24:50 +01:00
2026-05-18 21:42:56 +02:00
2026-05-18 21:42:56 +02:00
2025-10-17 21:11:23 +09:00
2026-07-15 02:18:05 +09:00
2026-10-16 11:36:31 +01:00
2026-01-02 04:05:45 +09:00
2025-11-26 16:22:50 +09:00
2025-11-26 16:22:50 +09:00
2026-05-18 21:42:56 +02:00
2025-11-26 16:22:50 +09:00
2026-05-18 12:29:12 +02:00
2025-11-26 16:22:50 +09:00
2026-10-16 17:24:50 +01:00
2025-11-26 16:22:50 +09:00
2025-11-26 16:22:50 +09:00
2025-11-26 16:22:50 +09:00
2026-09-22 14:38:02 +02:00
2025-12-18 17:37:26 +01:00
2025-11-26 16:22:50 +09:00
2025-11-26 16:22:50 +09:00
2025-11-26 19:02:31 +09:00
2025-11-26 16:22:50 +09:00
2025-11-26 16:22:50 +09:00
2025-11-26 16:22:50 +09:00
2026-06-20 12:31:28 +02:00
2025-11-26 16:22:50 +09:00
2026-08-03 14:29:07 +09:00
2025-11-26 16:22:50 +09:00
2026-08-19 02:28:19 +09:00
2025-11-26 16:22:50 +09:00
2025-11-26 16:22:50 +09:00
2025-11-26 16:22:50 +09:00
2025-11-26 19:02:31 +09:00
2025-11-26 16:22:50 +09:00
2026-10-16 11:36:32 +01:00
2026-06-22 13:01:17 +01:00
2026-01-19 17:49:29 +01:00
2026-01-06 17:59:10 +01:00
2026-08-18 06:30:10 +09:00
2025-12-15 08:50:13 +09:00
2026-10-16 17:24:51 +01:00
2026-01-02 04:04:19 +09:00
2026-09-03 10:09:32 -07:00
2026-09-03 10:09:32 -07:00
2026-09-22 13:48:24 +02:00
2026-02-10 21:54:12 +01:00
2026-10-16 17:24:52 +01:00
2026-08-25 06:05:37 -07:00
2026-08-18 06:30:10 +09:00
2026-05-21 10:14:08 +01:00
2026-08-28 06:34:45 +09:00
2026-06-22 17:19:54 +02:00
2025-11-04 10:55:04 +01:00
2026-05-18 02:32:39 +09:00
2026-07-02 17:19:18 +02:00
2026-05-21 10:33:03 +09:00
2025-10-16 17:00:29 +02:00
2026-07-01 16:09:27 +02:00
2026-05-05 17:22:26 +02:00
2026-09-03 10:09:32 -07:00
2026-04-27 13:49:24 +02:00
2026-01-02 04:05:45 +09:00
2026-08-31 19:40:33 +09:00
2026-10-16 11:36:32 +01:00
2026-08-03 14:29:07 +09:00
2026-08-15 00:26:40 +09:00
2026-06-23 22:55:23 +02:00
2026-09-22 14:38:02 +02:00
2026-05-15 13:46:08 +01:00
2026-10-16 11:36:31 +01:00
2025-10-17 21:11:23 +09:00
2025-11-26 19:02:31 +09:00
2025-11-26 19:02:31 +09:00
2026-09-22 14:38:02 +02:00
2026-09-01 02:12:52 +09:00
2026-09-22 14:38:02 +02:00
2026-10-16 11:36:33 +01:00
2026-07-18 04:56:32 +09:00
2026-01-02 04:05:45 +09:00
2026-09-22 02:46:35 +09:00
2026-09-22 02:46:35 +09:00
2026-08-05 14:44:25 +01:00
2026-05-21 10:33:03 +09:00
2026-01-02 04:05:45 +09:00
2026-07-01 22:46:45 +01:00
2026-01-02 04:05:45 +09:00
2025-11-26 16:22:50 +09:00
2025-11-26 16:22:50 +09:00
2026-07-18 04:56:32 +09:00
2026-03-20 21:38:08 +01:00
2026-09-01 02:12:52 +09:00
2026-09-01 02:12:52 +09:00
2025-11-26 19:02:31 +09:00
2026-01-02 04:05:45 +09:00
2026-08-03 14:29:07 +09:00
2026-08-03 14:29:07 +09:00
2026-03-30 14:18:56 +02:00
2025-10-17 21:11:23 +09:00
2026-07-31 09:49:41 +02:00
2026-06-23 22:55:23 +02:00
2026-08-25 06:05:37 -07:00
2026-01-02 04:05:45 +09:00
2026-05-15 14:01:57 +09:00
2026-10-16 11:36:32 +01:00
2025-12-15 08:50:13 +09:00
2026-08-01 00:53:33 +09:00
2026-01-02 04:05:45 +09:00
2026-06-23 17:36:03 +01:00
2026-06-22 13:01:17 +01:00
2025-10-17 21:11:23 +09:00
2026-04-12 15:27:15 +02:00
2025-11-26 19:02:31 +09:00
2026-05-06 12:04:51 +01:00
2025-11-26 19:02:31 +09:00
2026-09-08 17:34:06 +08:00
2026-09-01 02:12:52 +09:00
2026-05-15 14:01:57 +09:00
2026-04-16 02:15:52 -07:00
2026-04-16 02:15:52 -07:00
2026-05-18 21:42:56 +02:00
2025-10-17 21:11:23 +09:00
2026-05-15 00:02:01 -07:00
2026-05-15 00:02:01 -07:00
2026-03-29 20:32:15 +02:00
2025-10-17 21:11:23 +09:00
2026-06-28 13:40:07 +09:00
2026-07-15 02:18:05 +09:00
2026-05-19 11:05:55 +02:00
2026-05-19 11:05:55 +02:00
2026-04-15 23:37:55 -07:00
2026-04-15 23:37:55 -07:00
2026-09-22 14:38:02 +02:00
2026-03-26 15:21:10 +01:00
2026-07-02 17:01:02 +01:00
2026-02-16 09:44:57 +01:00
2026-04-16 02:15:52 -07:00
2026-04-16 02:15:52 -07:00
2026-05-11 03:03:32 -07:00
2026-05-11 03:03:32 -07:00
2026-05-12 08:51:26 -07:00
2026-05-11 04:32:03 -07:00
2026-06-20 12:31:28 +02:00
2026-05-15 00:02:01 -07:00
2026-05-12 08:55:33 -07:00
2026-05-12 08:55:33 -07:00
2026-05-11 04:32:14 -07:00
2026-05-11 04:32:14 -07:00
2026-05-12 08:51:26 -07:00
2026-05-11 04:32:14 -07:00
2026-07-25 15:35:28 +09:00
2026-04-27 13:49:24 +02:00
2026-07-12 23:09:01 +02:00
2026-02-16 09:44:58 +01:00