[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-4c47acd824aaaa8fc6dc519fb4e08d1522105b7a@git.kernel.org>
Date: Tue, 19 Mar 2019 04:11:37 -0700
From: tip-bot for Konstantin Khlebnikov <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: torvalds@...ux-foundation.org, riel@...riel.com,
lizefan@...wei.com, hpa@...or.com, khlebnikov@...dex-team.ru,
tj@...nel.org, bp@...en8.de, tglx@...utronix.de,
peterz@...radead.org, linux-kernel@...r.kernel.org,
mingo@...nel.org, hannes@...xchg.org, dave.hansen@...ux.intel.com,
luto@...nel.org
Subject: [tip:sched/urgent] sched/core: Fix buffer overflow in cgroup2
property cpu.max
Commit-ID: 4c47acd824aaaa8fc6dc519fb4e08d1522105b7a
Gitweb: https://git.kernel.org/tip/4c47acd824aaaa8fc6dc519fb4e08d1522105b7a
Author: Konstantin Khlebnikov <khlebnikov@...dex-team.ru>
AuthorDate: Wed, 6 Mar 2019 20:11:42 +0300
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Tue, 19 Mar 2019 12:06:15 +0100
sched/core: Fix buffer overflow in cgroup2 property cpu.max
Add limit into sscanf format string for on-stack buffer.
Signed-off-by: Konstantin Khlebnikov <khlebnikov@...dex-team.ru>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Acked-by: Tejun Heo <tj@...nel.org>
Cc: Andy Lutomirski <luto@...nel.org>
Cc: Borislav Petkov <bp@...en8.de>
Cc: Dave Hansen <dave.hansen@...ux.intel.com>
Cc: H. Peter Anvin <hpa@...or.com>
Cc: Johannes Weiner <hannes@...xchg.org>
Cc: Li Zefan <lizefan@...wei.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Rik van Riel <riel@...riel.com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Fixes: 0d5936344f30 ("sched: Implement interface for cgroup unified hierarchy")
Link: https://lkml.kernel.org/r/155189230232.2620.13120481613524200065.stgit@buzz
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
kernel/sched/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 6b2c055564b5..b7a4afdc33cb 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -6943,7 +6943,7 @@ static int __maybe_unused cpu_period_quota_parse(char *buf,
{
char tok[21]; /* U64_MAX */
- if (!sscanf(buf, "%s %llu", tok, periodp))
+ if (sscanf(buf, "%20s %llu", tok, periodp) < 1)
return -EINVAL;
*periodp *= NSEC_PER_USEC;
Powered by blists - more mailing lists