lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <162815607530.395.9529872932900083627.tip-bot2@tip-bot2>
Date:   Thu, 05 Aug 2021 09:34:35 -0000
From:   "tip-bot2 for Quentin Perret" <tip-bot2@...utronix.de>
To:     linux-tip-commits@...r.kernel.org
Cc:     Quentin Perret <qperret@...gle.com>,
        "Peter Zijlstra (Intel)" <peterz@...radead.org>, x86@...nel.org,
        linux-kernel@...r.kernel.org
Subject: [tip: sched/core] sched: Don't report SCHED_FLAG_SUGOV in sched_getattr()

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@...gle.com>
AuthorDate:    Tue, 27 Jul 2021 11:11:02 +01:00
Committer:     Peter Zijlstra <peterz@...radead.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@...gle.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.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
 	/*

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ