]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.18-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 2 May 2018 15:56:19 +0000 (08:56 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 2 May 2018 15:56:19 +0000 (08:56 -0700)
added patches:
perf-core-fix-the-perf_cpu_time_max_percent-check.patch

queue-3.18/perf-core-fix-the-perf_cpu_time_max_percent-check.patch [new file with mode: 0644]
queue-3.18/series

diff --git a/queue-3.18/perf-core-fix-the-perf_cpu_time_max_percent-check.patch b/queue-3.18/perf-core-fix-the-perf_cpu_time_max_percent-check.patch
new file mode 100644 (file)
index 0000000..6cef46b
--- /dev/null
@@ -0,0 +1,48 @@
+From 1572e45a924f254d9570093abde46430c3172e3d Mon Sep 17 00:00:00 2001
+From: Tan Xiaojun <tanxiaojun@huawei.com>
+Date: Thu, 23 Feb 2017 14:04:39 +0800
+Subject: perf/core: Fix the perf_cpu_time_max_percent check
+
+From: Tan Xiaojun <tanxiaojun@huawei.com>
+
+commit 1572e45a924f254d9570093abde46430c3172e3d upstream.
+
+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@huawei.com>
+Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
+Cc: <acme@kernel.org>
+Cc: <alexander.shishkin@linux.intel.com>
+Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
+Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
+Cc: Jiri Olsa <jolsa@redhat.com>
+Cc: Linus Torvalds <torvalds@linux-foundation.org>
+Cc: Peter Zijlstra <peterz@infradead.org>
+Cc: Stephane Eranian <eranian@google.com>
+Cc: Thomas Gleixner <tglx@linutronix.de>
+Cc: Vince Weaver <vincent.weaver@maine.edu>
+Link: http://lkml.kernel.org/r/1487829879-56237-1-git-send-email-tanxiaojun@huawei.com
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Cc: Guenter Roeck <linux@roeck-us.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ kernel/events/core.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/kernel/events/core.c
++++ b/kernel/events/core.c
+@@ -224,7 +224,7 @@ int perf_cpu_time_max_percent_handler(st
+                               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;
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..ad4c44ab7a5d4f96a3acf1e1054c8b5cd36fa903 100644 (file)
@@ -0,0 +1 @@
+perf-core-fix-the-perf_cpu_time_max_percent-check.patch