]> git.proxmox.com Git - pve-kernel.git/blob - patches/kernel/0267-Thermal-int340x-prevent-speculative-execution.patch
58d560d1e2d0c6a294ad4cc090a57d6174dfad6b
[pve-kernel.git] / patches / kernel / 0267-Thermal-int340x-prevent-speculative-execution.patch
1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: Elena Reshetova <elena.reshetova@intel.com>
3 Date: Mon, 4 Sep 2017 13:11:51 +0300
4 Subject: [PATCH] Thermal/int340x: prevent speculative execution
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 CVE-2017-5753
10 CVE-2017-5715
11
12 Real commit text tbd
13
14 Signed-off-by: Elena Reshetova <elena.reshetova@intel.com>
15 Signed-off-by: Tim Chen <tim.c.chen@linux.intel.com>
16 Signed-off-by: Andy Whitcroft <apw@canonical.com>
17 Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
18 (cherry picked from commit 3904f4cadeeaa9370f0635eb2f66194ca238325b)
19 Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
20 ---
21 drivers/thermal/int340x_thermal/int340x_thermal_zone.c | 11 ++++++-----
22 1 file changed, 6 insertions(+), 5 deletions(-)
23
24 diff --git a/drivers/thermal/int340x_thermal/int340x_thermal_zone.c b/drivers/thermal/int340x_thermal/int340x_thermal_zone.c
25 index 145a5c53ff5c..4f9917ef3c11 100644
26 --- a/drivers/thermal/int340x_thermal/int340x_thermal_zone.c
27 +++ b/drivers/thermal/int340x_thermal/int340x_thermal_zone.c
28 @@ -57,15 +57,16 @@ static int int340x_thermal_get_trip_temp(struct thermal_zone_device *zone,
29 if (d->override_ops && d->override_ops->get_trip_temp)
30 return d->override_ops->get_trip_temp(zone, trip, temp);
31
32 - if (trip < d->aux_trip_nr)
33 + if (trip < d->aux_trip_nr) {
34 + gmb();
35 *temp = d->aux_trips[trip];
36 - else if (trip == d->crt_trip_id)
37 + } else if (trip == d->crt_trip_id) {
38 *temp = d->crt_temp;
39 - else if (trip == d->psv_trip_id)
40 + } else if (trip == d->psv_trip_id) {
41 *temp = d->psv_temp;
42 - else if (trip == d->hot_trip_id)
43 + } else if (trip == d->hot_trip_id) {
44 *temp = d->hot_temp;
45 - else {
46 + } else {
47 for (i = 0; i < INT340X_THERMAL_MAX_ACT_TRIP_COUNT; i++) {
48 if (d->act_trips[i].valid &&
49 d->act_trips[i].id == trip) {
50 --
51 2.14.2
52