0265-Thermal-int340x-prevent-speculative-execution.patch 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
  2. From: Elena Reshetova <[email protected]>
  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. CVE-2017-5753
  9. CVE-2017-5715
  10. Real commit text tbd
  11. Signed-off-by: Elena Reshetova <[email protected]>
  12. Signed-off-by: Tim Chen <[email protected]>
  13. Signed-off-by: Andy Whitcroft <[email protected]>
  14. Signed-off-by: Kleber Sacilotto de Souza <[email protected]>
  15. (cherry picked from commit 3904f4cadeeaa9370f0635eb2f66194ca238325b)
  16. Signed-off-by: Fabian Grünbichler <[email protected]>
  17. ---
  18. drivers/thermal/int340x_thermal/int340x_thermal_zone.c | 11 ++++++-----
  19. 1 file changed, 6 insertions(+), 5 deletions(-)
  20. diff --git a/drivers/thermal/int340x_thermal/int340x_thermal_zone.c b/drivers/thermal/int340x_thermal/int340x_thermal_zone.c
  21. index 145a5c53ff5c..4f9917ef3c11 100644
  22. --- a/drivers/thermal/int340x_thermal/int340x_thermal_zone.c
  23. +++ b/drivers/thermal/int340x_thermal/int340x_thermal_zone.c
  24. @@ -57,15 +57,16 @@ static int int340x_thermal_get_trip_temp(struct thermal_zone_device *zone,
  25. if (d->override_ops && d->override_ops->get_trip_temp)
  26. return d->override_ops->get_trip_temp(zone, trip, temp);
  27. - if (trip < d->aux_trip_nr)
  28. + if (trip < d->aux_trip_nr) {
  29. + gmb();
  30. *temp = d->aux_trips[trip];
  31. - else if (trip == d->crt_trip_id)
  32. + } else if (trip == d->crt_trip_id) {
  33. *temp = d->crt_temp;
  34. - else if (trip == d->psv_trip_id)
  35. + } else if (trip == d->psv_trip_id) {
  36. *temp = d->psv_temp;
  37. - else if (trip == d->hot_trip_id)
  38. + } else if (trip == d->hot_trip_id) {
  39. *temp = d->hot_temp;
  40. - else {
  41. + } else {
  42. for (i = 0; i < INT340X_THERMAL_MAX_ACT_TRIP_COUNT; i++) {
  43. if (d->act_trips[i].valid &&
  44. d->act_trips[i].id == trip) {
  45. --
  46. 2.14.2