LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: "tip-bot2 for Quentin Perret" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Quentin Perret <qperret@google.com>,
"Peter Zijlstra (Intel)" <peterz@infradead.org>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: sched/core] sched: Don't report SCHED_FLAG_SUGOV in sched_getattr()
Date: Thu, 05 Aug 2021 09:34:35 -0000 [thread overview]
Message-ID: <162815607530.395.9529872932900083627.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20210727101103.2729607-3-qperret@google.com>
The following commit has been merged into the sched/core branch of tip:
Commit-ID: 7ad721bf10718a4e480a27ded8bb16b8f6feb2d1
Gitweb: https://git.kernel.org/tip/7ad721bf10718a4e480a27ded8bb16b8f6feb2d1
Author: Quentin Perret <qperret@google.com>
AuthorDate: Tue, 27 Jul 2021 11:11:02 +01:00
Committer: Peter Zijlstra <peterz@infradead.org>
CommitterDate: Wed, 04 Aug 2021 15:16:44 +02:00
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 <qperret@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20210727101103.2729607-3-qperret@google.com
---
kernel/sched/core.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 6c562ad..314f70d 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -7530,6 +7530,7 @@ SYSCALL_DEFINE4(sched_getattr, pid_t, pid, struct sched_attr __user *, uattr,
kattr.sched_priority = p->rt_priority;
else
kattr.sched_nice = task_nice(p);
+ kattr.sched_flags &= SCHED_FLAG_ALL;
#ifdef CONFIG_UCLAMP_TASK
/*
prev parent reply other threads:[~2021-08-05 9:34 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-27 10:11 [PATCH 0/2] A couple of sched_getattr() fixes for DL Quentin Perret
2021-07-27 10:11 ` [PATCH 1/2] sched/deadline: Fix reset_on_fork reporting of DL tasks Quentin Perret
2021-07-29 16:26 ` Dietmar Eggemann
2021-08-05 9:34 ` [tip: sched/core] " tip-bot2 for Quentin Perret
2021-07-27 10:11 ` [PATCH 2/2] sched: Don't report SCHED_FLAG_SUGOV in sched_getattr() Quentin Perret
2021-07-28 9:12 ` Juri Lelli
2021-07-28 9:39 ` Quentin Perret
2021-07-28 12:36 ` Juri Lelli
2021-07-29 17:21 ` Dietmar Eggemann
2021-07-29 17:28 ` Quentin Perret
2021-08-05 9:34 ` tip-bot2 for Quentin Perret [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=162815607530.395.9529872932900083627.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=qperret@google.com \
--cc=x86@kernel.org \
--subject='Re: [tip: sched/core] sched: Don'\''t report SCHED_FLAG_SUGOV in sched_getattr()' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).