Gustavo A. R. Silva d49dbfade9 hwmon: (nct6775) Fix potential Spectre v1
val can be indirectly controlled by user-space, hence leading to
a potential exploitation of the Spectre variant 1 vulnerability.

This issue was detected with the help of Smatch:

vers/hwmon/nct6775.c:2698 store_pwm_weight_temp_sel() warn: potential
spectre issue 'data->temp_src' [r]

Fix this by sanitizing val before using it to index data->temp_src

Notice that given that speculation windows are large, the policy is
to kill the speculation on the first load and not worry if it can be
completed with a dependent load/store [1].

[1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2

Cc: stable@vger.kernel.org
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2018-08-26 17:45:25 -07:00
..
2018-06-12 16:19:22 -07:00
2018-06-12 16:19:22 -07:00
2018-06-12 16:19:22 -07:00
2016-06-27 18:58:04 -07:00
2018-08-23 13:52:46 -07:00
2017-04-02 07:01:53 -07:00
2018-01-17 14:51:12 -08:00
2013-03-18 21:19:49 +01:00
2017-04-02 07:01:53 -07:00
2017-04-13 06:09:26 -07:00
2017-04-02 07:01:53 -07:00
2018-03-22 09:33:24 -07:00
2014-08-04 07:01:35 -07:00
2014-08-04 07:01:35 -07:00
2014-08-04 07:01:35 -07:00
2018-08-23 13:52:46 -07:00
2017-10-29 18:36:03 -07:00
2014-01-29 20:40:08 +01:00
2018-03-10 19:00:14 -08:00
2015-06-21 22:54:53 -07:00
2016-12-02 13:28:05 -08:00