Files
twx-linux/kernel
Quentin Perret bc0d543f53 sched/deadline: Fix reset_on_fork reporting of DL tasks
[ Upstream commit f95091536f ]

It is possible for sched_getattr() to incorrectly report the state of
the reset_on_fork flag when called on a deadline task.

Indeed, if the flag was set on a deadline task using sched_setattr()
with flags (SCHED_FLAG_RESET_ON_FORK | SCHED_FLAG_KEEP_PARAMS), then
p->sched_reset_on_fork will be set, but __setscheduler() will bail out
early, which means that the dl_se->flags will not get updated by
__setscheduler_params()->__setparam_dl(). Consequently, if
sched_getattr() is then called on the task, __getparam_dl() will
override kattr.sched_flags with the now out-of-date copy in dl_se->flags
and report the stale value to userspace.

To fix this, make sure to only copy the flags that are relevant to
sched_deadline to and from the dl_se->flags field.

Signed-off-by: Quentin Perret <qperret@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20210727101103.2729607-2-qperret@google.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-09-22 11:47:49 +02:00
..
2020-09-17 13:45:31 +02:00
…
2019-12-13 08:51:11 +01:00
2019-12-01 09:17:17 +01:00
…
…
2021-07-20 16:16:04 +02:00
…
…
…
…
…
…
…
…
…
2021-02-10 09:21:06 +01:00
2020-03-25 08:06:13 +01:00
…
…
…
…
…
…
2021-02-07 14:48:38 +01:00
…
…
…
2020-01-09 10:18:59 +01:00
…
…
…
…
…
…
…