Commit 1c050491 authored by Elena Reshetova's avatar Elena Reshetova Committed by Marcelo Henrique Cerri

Thermal/int340x: prevent speculative execution

CVE-2017-5753
CVE-2017-5715

Real commit text tbd
Signed-off-by: default avatarElena Reshetova <elena.reshetova@intel.com>
Signed-off-by: default avatarTim Chen <tim.c.chen@linux.intel.com>
Signed-off-by: default avatarAndy Whitcroft <apw@canonical.com>
(cherry picked from commit 7ef8b5b36b47e74d35506760175eaf1f4235068b)
Signed-off-by: default avatarAndy Whitcroft <apw@canonical.com>
parent fa24f391
...@@ -57,15 +57,16 @@ static int int340x_thermal_get_trip_temp(struct thermal_zone_device *zone, ...@@ -57,15 +57,16 @@ static int int340x_thermal_get_trip_temp(struct thermal_zone_device *zone,
if (d->override_ops && d->override_ops->get_trip_temp) if (d->override_ops && d->override_ops->get_trip_temp)
return d->override_ops->get_trip_temp(zone, trip, temp); return d->override_ops->get_trip_temp(zone, trip, temp);
if (trip < d->aux_trip_nr) if (trip < d->aux_trip_nr) {
gmb();
*temp = d->aux_trips[trip]; *temp = d->aux_trips[trip];
else if (trip == d->crt_trip_id) } else if (trip == d->crt_trip_id) {
*temp = d->crt_temp; *temp = d->crt_temp;
else if (trip == d->psv_trip_id) } else if (trip == d->psv_trip_id) {
*temp = d->psv_temp; *temp = d->psv_temp;
else if (trip == d->hot_trip_id) } else if (trip == d->hot_trip_id) {
*temp = d->hot_temp; *temp = d->hot_temp;
else { } else {
for (i = 0; i < INT340X_THERMAL_MAX_ACT_TRIP_COUNT; i++) { for (i = 0; i < INT340X_THERMAL_MAX_ACT_TRIP_COUNT; i++) {
if (d->act_trips[i].valid && if (d->act_trips[i].valid &&
d->act_trips[i].id == trip) { d->act_trips[i].id == trip) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment