summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Wellving <andreas.wellving@enea.com>2018-10-12 12:21:55 +0200
committerAdrian Dudau <Adrian.Dudau@enea.com>2018-10-16 17:38:29 +0200
commit7ee5d87086d53fa536de454744683216a5260f77 (patch)
tree1b54a2dd760e8ccc9a904c90735634a1bd2def6a
parent9d7d5feacd408f22ec91afc9e88016a5ece31d32 (diff)
downloadenea-kernel-cache-7ee5d87086d53fa536de454744683216a5260f77.tar.gz
perf/core: CVE-2017-18255
perf/core: Fix the perf_cpu_time_max_percent check References: https://github.com/torvalds/linux/commit/1572e45a924f254d9570093abde46430c3172e3d Change-Id: Ic12a79ed3b786b997114dcaf61f6d91e0e7af1b1 Signed-off-by: Andreas Wellving <andreas.wellving@enea.com>
-rw-r--r--patches/cve/4.9.x.scc3
-rw-r--r--patches/cve/CVE-2017-18255-perf-core-Fix-the-perf_cpu_time_max_percent-check.patch50
2 files changed, 53 insertions, 0 deletions
diff --git a/patches/cve/4.9.x.scc b/patches/cve/4.9.x.scc
index 9950d18..dbbefde 100644
--- a/patches/cve/4.9.x.scc
+++ b/patches/cve/4.9.x.scc
@@ -19,3 +19,6 @@ patch CVE-2018-1108-random-fix-crng_ready-test.patch
19#CVEs fixed in 4.9.98: 19#CVEs fixed in 4.9.98:
20patch CVE-2018-1093-ext4-add-validity-checks-for-bitmap-block-numbers.patch 20patch CVE-2018-1093-ext4-add-validity-checks-for-bitmap-block-numbers.patch
21patch CVE-2018-9415-ARM-amba-Fix-race-condition-with-driver_override.patch 21patch CVE-2018-9415-ARM-amba-Fix-race-condition-with-driver_override.patch
22
23#CVEs fixed in 4.9.99:
24patch CVE-2017-18255-perf-core-Fix-the-perf_cpu_time_max_percent-check.patch
diff --git a/patches/cve/CVE-2017-18255-perf-core-Fix-the-perf_cpu_time_max_percent-check.patch b/patches/cve/CVE-2017-18255-perf-core-Fix-the-perf_cpu_time_max_percent-check.patch
new file mode 100644
index 0000000..c48f310
--- /dev/null
+++ b/patches/cve/CVE-2017-18255-perf-core-Fix-the-perf_cpu_time_max_percent-check.patch
@@ -0,0 +1,50 @@
1From 1572e45a924f254d9570093abde46430c3172e3d Mon Sep 17 00:00:00 2001
2From: Tan Xiaojun <tanxiaojun@huawei.com>
3Date: Thu, 23 Feb 2017 14:04:39 +0800
4Subject: [PATCH] perf/core: Fix the perf_cpu_time_max_percent check
5
6Use "proc_dointvec_minmax" instead of "proc_dointvec" to check the input
7value from user-space.
8
9If not, we can set a big value and some vars will overflow like
10"sysctl_perf_event_sample_rate" which will cause a lot of unexpected
11problems.
12
13CVE: CVE-2018-18255
14Upstream-Status: Backport
15
16Signed-off-by: Tan Xiaojun <tanxiaojun@huawei.com>
17Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
18Cc: <acme@kernel.org>
19Cc: <alexander.shishkin@linux.intel.com>
20Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
21Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
22Cc: Jiri Olsa <jolsa@redhat.com>
23Cc: Linus Torvalds <torvalds@linux-foundation.org>
24Cc: Peter Zijlstra <peterz@infradead.org>
25Cc: Stephane Eranian <eranian@google.com>
26Cc: Thomas Gleixner <tglx@linutronix.de>
27Cc: Vince Weaver <vincent.weaver@maine.edu>
28Link: http://lkml.kernel.org/r/1487829879-56237-1-git-send-email-tanxiaojun@huawei.com
29Signed-off-by: Ingo Molnar <mingo@kernel.org>
30Signed-off-by: Andreas Wellving <andreas.wellving@enea.com>
31---
32 kernel/events/core.c | 2 +-
33 1 file changed, 1 insertion(+), 1 deletion(-)
34
35diff --git a/kernel/events/core.c b/kernel/events/core.c
36index d4e3f8d..c1c1cdf 100644
37--- a/kernel/events/core.c
38+++ b/kernel/events/core.c
39@@ -455,7 +455,7 @@ int perf_cpu_time_max_percent_handler(struct ctl_table *table, int write,
40 void __user *buffer, size_t *lenp,
41 loff_t *ppos)
42 {
43- int ret = proc_dointvec(table, write, buffer, lenp, ppos);
44+ int ret = proc_dointvec_minmax(table, write, buffer, lenp, ppos);
45
46 if (ret || !write)
47 return ret;
48--
492.7.4
50