]> www.infradead.org Git - users/jedix/linux-maple.git/commit
hwmon: (amd_energy) Restore visibility of energy counters
authorGuenter Roeck <linux@roeck-us.net>
Wed, 31 Mar 2021 01:20:52 +0000 (18:20 -0700)
committerGuenter Roeck <linux@roeck-us.net>
Mon, 12 Apr 2021 14:23:44 +0000 (07:23 -0700)
commit935f6562d263a03297f154e5ef434bb6b216870d
treef2d1458d764e7215d96568b77b0170d93bb6d2cd
parent55a0bd4de2f5740baa7908704f56b57859d5cb19
hwmon: (amd_energy) Restore visibility of energy counters

Commit 60268b0e8258 ("hwmon: (amd_energy) modify the visibility of
the counters") restricted visibility of AMD energy counters to work
around a side-channel attack using energy data to determine which
instructions are executed. The attack is described in 'PLATYPUS:
Software-based Power Side-Channel Attacks on x86'. It relies on quick
and accurate energy readings.

Limiting energy readings to privileged users is annoying. A much better
solution is to make energy readings unusable for attacks by randomizing
the time between updates. We can do that by caching energy values for
a short and randomized period of time.

Cc: Naveen Krishna Chatradhi <nchatrad@amd.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/amd_energy.c