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  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]
Date:   Sat, 9 Mar 2019 06:36:00 -0800
From:   tip-bot for Konstantin Khlebnikov <tipbot@...or.com>
To:     linux-tip-commits@...r.kernel.org
Cc:     khlebnikov@...dex-team.ru, dave.hansen@...ux.intel.com,
        peterz@...radead.org, hpa@...or.com, luto@...nel.org,
        linux-kernel@...r.kernel.org, hannes@...xchg.org, bp@...en8.de,
        lizefan@...wei.com, mingo@...nel.org, tglx@...utronix.de,
        torvalds@...ux-foundation.org, tj@...nel.org, riel@...riel.com
Subject: [tip:sched/urgent] sched/core: Fix buffer overflow in cgroup2
 property cpu.max

Commit-ID:  5105fa52df1f249f996308188dd1e85c3ae62de5
Gitweb:     https://git.kernel.org/tip/5105fa52df1f249f996308188dd1e85c3ae62de5
Author:     Konstantin Khlebnikov <khlebnikov@...dex-team.ru>
AuthorDate: Wed, 6 Mar 2019 20:11:42 +0300
Committer:  Ingo Molnar <mingo@...nel.org>
CommitDate: Sat, 9 Mar 2019 14:03:51 +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