Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 7ad721b

Browse files
Quentin PerretPeter Zijlstra
authored andcommitted
sched: Don't report SCHED_FLAG_SUGOV in sched_getattr()
SCHED_FLAG_SUGOV is supposed to be a kernel-only flag that userspace cannot interact with. However, sched_getattr() currently reports it in sched_flags if called on a sugov worker even though it is not actually defined in a UAPI header. To avoid this, make sure to clean-up the sched_flags field in sched_getattr() before returning to userspace. Signed-off-by: Quentin Perret <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent f950915 commit 7ad721b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

kernel/sched/core.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7530,6 +7530,7 @@ SYSCALL_DEFINE4(sched_getattr, pid_t, pid, struct sched_attr __user *, uattr,
75307530
kattr.sched_priority = p->rt_priority;
75317531
else
75327532
kattr.sched_nice = task_nice(p);
7533+
kattr.sched_flags &= SCHED_FLAG_ALL;
75337534

75347535
#ifdef CONFIG_UCLAMP_TASK
75357536
/*

0 commit comments

Comments
 (0)