diff options
author | Andreas Wellving <andreas.wellving@enea.com> | 2018-10-12 12:21:55 +0200 |
---|---|---|
committer | Adrian Dudau <Adrian.Dudau@enea.com> | 2018-10-16 17:38:29 +0200 |
commit | 7ee5d87086d53fa536de454744683216a5260f77 (patch) | |
tree | 1b54a2dd760e8ccc9a904c90735634a1bd2def6a | |
parent | 9d7d5feacd408f22ec91afc9e88016a5ece31d32 (diff) | |
download | enea-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.scc | 3 | ||||
-rw-r--r-- | patches/cve/CVE-2017-18255-perf-core-Fix-the-perf_cpu_time_max_percent-check.patch | 50 |
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: |
20 | patch CVE-2018-1093-ext4-add-validity-checks-for-bitmap-block-numbers.patch | 20 | patch CVE-2018-1093-ext4-add-validity-checks-for-bitmap-block-numbers.patch |
21 | patch CVE-2018-9415-ARM-amba-Fix-race-condition-with-driver_override.patch | 21 | patch CVE-2018-9415-ARM-amba-Fix-race-condition-with-driver_override.patch |
22 | |||
23 | #CVEs fixed in 4.9.99: | ||
24 | patch 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 @@ | |||
1 | From 1572e45a924f254d9570093abde46430c3172e3d Mon Sep 17 00:00:00 2001 | ||
2 | From: Tan Xiaojun <tanxiaojun@huawei.com> | ||
3 | Date: Thu, 23 Feb 2017 14:04:39 +0800 | ||
4 | Subject: [PATCH] perf/core: Fix the perf_cpu_time_max_percent check | ||
5 | |||
6 | Use "proc_dointvec_minmax" instead of "proc_dointvec" to check the input | ||
7 | value from user-space. | ||
8 | |||
9 | If 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 | ||
11 | problems. | ||
12 | |||
13 | CVE: CVE-2018-18255 | ||
14 | Upstream-Status: Backport | ||
15 | |||
16 | Signed-off-by: Tan Xiaojun <tanxiaojun@huawei.com> | ||
17 | Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> | ||
18 | Cc: <acme@kernel.org> | ||
19 | Cc: <alexander.shishkin@linux.intel.com> | ||
20 | Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> | ||
21 | Cc: Arnaldo Carvalho de Melo <acme@redhat.com> | ||
22 | Cc: Jiri Olsa <jolsa@redhat.com> | ||
23 | Cc: Linus Torvalds <torvalds@linux-foundation.org> | ||
24 | Cc: Peter Zijlstra <peterz@infradead.org> | ||
25 | Cc: Stephane Eranian <eranian@google.com> | ||
26 | Cc: Thomas Gleixner <tglx@linutronix.de> | ||
27 | Cc: Vince Weaver <vincent.weaver@maine.edu> | ||
28 | Link: http://lkml.kernel.org/r/1487829879-56237-1-git-send-email-tanxiaojun@huawei.com | ||
29 | Signed-off-by: Ingo Molnar <mingo@kernel.org> | ||
30 | Signed-off-by: Andreas Wellving <andreas.wellving@enea.com> | ||
31 | --- | ||
32 | kernel/events/core.c | 2 +- | ||
33 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
34 | |||
35 | diff --git a/kernel/events/core.c b/kernel/events/core.c | ||
36 | index 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 | -- | ||
49 | 2.7.4 | ||
50 | |||