]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
platform/x86/intel: pmc: fix ltr decode in pmc_core_ltr_show()
authorDmitry Kandybka <d.kandybka@gmail.com>
Thu, 23 Jan 2025 22:07:39 +0000 (01:07 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 22 Mar 2025 19:54:15 +0000 (12:54 -0700)
commit8bf1b5eeaf94b3af28ba6f9830c2e7a8c142d1f1
treea25de005cb0eb8c67ece962af0a1df4ded06b8bb
parent20d6994b6f1f46576e8a1b7c26bcf55dc2cf0132
platform/x86/intel: pmc: fix ltr decode in pmc_core_ltr_show()

[ Upstream commit 583ef25bb2a094813351a727ddec38b35a15b9f8 ]

In pmc_core_ltr_show(), promote 'val' to 'u64' to avoid possible integer
overflow. Values (10 bit) are multiplied by the scale, the result of
expression is in a range from 1 to 34,326,183,936 which is bigger then
UINT32_MAX. Compile tested only.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Dmitry Kandybka <d.kandybka@gmail.com>
Reviewed-by: Rajneesh Bhardwaj <irenic.rajneesh@gmail.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20250123220739.68087-1-d.kandybka@gmail.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/platform/x86/intel/pmc/core.c