aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/scripts/python/exported-sql-viewer.py
diff options
context:
space:
mode:
authorZhang Rui <rui.zhang@intel.com>2023-03-08 11:07:11 +0800
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2023-03-17 19:22:44 +0100
commit2a96243e22f880ad53a977e09680aee276dc50b5 (patch)
tree9231cdbd69be3172dd812b8a8a10bf382930cab5 /tools/perf/scripts/python/exported-sql-viewer.py
parentLinux 6.3-rc2 (diff)
downloadlinux-2a96243e22f880ad53a977e09680aee276dc50b5.tar.gz
linux-2a96243e22f880ad53a977e09680aee276dc50b5.zip
thermal: intel: x86_pkg_temp_thermal: Add lower bound check for sysfs input
When setting a trip point temperature from sysfs, there is an upper bound check on the user input, but no lower bound check. As hardware register has 7 bits for a trip point temperature, the offset to tj_max of the input temperature must be equal to/less than 0x7f. Or else, 1. bogus temperature is updated into the trip temperature bits. 2. the upper bits of the register can be polluted. For example, $ rdmsr 0x1b2 2000003 $ echo -180000 > /sys/class/thermal/thermal_zone1/trip_point_1_temp $ rdmsr 0x1b2 3980003 Not only the trip point temp is set to 76C on this platform (tj_max is 100), the Power Notification (Bit 24) is also enabled erronously. Fix the problem by adding lower bound check for sysfs input. Reported-by: Dan Carpenter <error27@gmail.com> Link: https://lore.kernel.org/all/add7a378-4d50-4ba1-81d3-a0c17db25a0b@kili.mountain/ Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'tools/perf/scripts/python/exported-sql-viewer.py')
0 files changed, 0 insertions, 0 deletions
irqchips: Replace __this_cpu_ptr usesChristoph Lameter2-6/+6 2014-08-26drivers/net/ethernet/tile: __get_cpu_var call introduced in 3.14Christoph Lameter1-2/+2 2014-08-26metag: Replace __get_cpu_var uses for address calculationChristoph Lameter1-7/+7 2014-08-26md: Replace __this_cpu_ptr with raw_cpu_ptrChristoph Lameter1-1/+1 2014-08-26net: Replace get_cpu_var through this_cpu_ptrChristoph Lameter11-20/+20 2014-08-26watchdog: Replace __raw_get_cpu_var usesChristoph Lameter1-6/+6 2014-08-26drivers/net/ethernet/tile: Replace __get_cpu_var uses for address calculationChristoph Lameter2-13/+13 2014-08-26drivers/clocksource: Replace __get_cpu_var used for address calculationChristoph Lameter1-1/+1 2014-08-26drivers/oprofile: Replace __get_cpu_var uses for address calculationChristoph Lameter2-6/+6 2014-08-26drivers/cpuidle: Replace __get_cpu_var uses for address calculationChristoph Lameter2-5/+5 2014-08-26drivers/char/random: Replace __get_cpu_var usesChristoph Lameter1-1/+1 2014-08-26block: Replace __this_cpu_ptr with raw_cpu_ptrChristoph Lameter1-1/+1 2014-08-26scheduler: Replace __get_cpu_var with this_cpu_ptrChristoph Lameter7-23/+23 2014-08-26time: Convert a bunch of &__get_cpu_var introduced in the 3.16 merge periodChristoph Lameter1-8/+8 2014-08-26time: Replace __get_cpu_var usesChristoph Lameter10-29/+29 2014-08-26kernel misc: Replace __get_cpu_var usesChristoph Lameter2-5/+5 2014-08-16Linux 3.17-rc1v3.17-rc1Linus Torvalds1-2/+2 2014-08-16platform/x86: Enable build support for toshiba_hapsAzael Avalos2-0/+20 2014-08-16Documentation: Add file about toshiba_haps moduleAzael Avalos2-0/+78