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: <tip-1572e45a924f254d9570093abde46430c3172e3d@git.kernel.org>
Date:   Fri, 24 Feb 2017 01:15:30 -0800
From:   tip-bot for Tan Xiaojun <tipbot@...or.com>
To:     linux-tip-commits@...r.kernel.org
Cc:     tanxiaojun@...wei.com, acme@...nel.org, peterz@...radead.org,
        torvalds@...ux-foundation.org, tglx@...utronix.de,
        vincent.weaver@...ne.edu, eranian@...gle.com,
        linux-kernel@...r.kernel.org, acme@...hat.com, hpa@...or.com,
        mingo@...nel.org, jolsa@...hat.com,
        alexander.shishkin@...ux.intel.com
Subject: [tip:perf/urgent] perf/core: Fix the perf_cpu_time_max_percent
 check

Commit-ID:  1572e45a924f254d9570093abde46430c3172e3d
Gitweb:     http://git.kernel.org/tip/1572e45a924f254d9570093abde46430c3172e3d
Author:     Tan Xiaojun <tanxiaojun@...wei.com>
AuthorDate: Thu, 23 Feb 2017 14:04:39 +0800
Committer:  Ingo Molnar <mingo@...nel.org>
CommitDate: Fri, 24 Feb 2017 08:56:33 +0100

perf/core: Fix the perf_cpu_time_max_percent check

Use "proc_dointvec_minmax" instead of "proc_dointvec" to check the input
value from user-space.

If not, we can set a big value and some vars will overflow like
"sysctl_perf_event_sample_rate" which will cause a lot of unexpected
problems.

Signed-off-by: Tan Xiaojun <tanxiaojun@...wei.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Cc: <acme@...nel.org>
Cc: <alexander.shishkin@...ux.intel.com>
Cc: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
Cc: Jiri Olsa <jolsa@...hat.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Stephane Eranian <eranian@...gle.com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Vince Weaver <vincent.weaver@...ne.edu>
Link: http://lkml.kernel.org/r/1487829879-56237-1-git-send-email-tanxiaojun@huawei.com
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
 kernel/events/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index d4e3f8d..c1c1cdf 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -455,7 +455,7 @@ int perf_cpu_time_max_percent_handler(struct ctl_table *table, int write,
 				void __user *buffer, size_t *lenp,
 				loff_t *ppos)
 {
-	int ret = proc_dointvec(table, write, buffer, lenp, ppos);
+	int ret = proc_dointvec_minmax(table, write, buffer, lenp, ppos);
 
 	if (ret || !write)
 		return ret;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ