summaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorNikita Kiryushin <kiryushin@ancud.ru>2023-11-09 21:08:59 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-01-25 15:44:39 -0800
commitb7aab9d906e2e252a7783f872406033ec49b6dae (patch)
tree6439f9ddc3d57929656e1fabd898ff099a48ab68 /drivers/acpi
parent72884ce4e10417b1233b614bf134da852df0f15f (diff)
downloadlinux-stable-b7aab9d906e2e252a7783f872406033ec49b6dae.tar.gz
linux-stable-b7aab9d906e2e252a7783f872406033ec49b6dae.tar.bz2
linux-stable-b7aab9d906e2e252a7783f872406033ec49b6dae.zip
ACPI: LPIT: Avoid u32 multiplication overflow
[ Upstream commit 56d2eeda87995245300836ee4dbd13b002311782 ] In lpit_update_residency() there is a possibility of overflow in multiplication, if tsc_khz is large enough (> UINT_MAX/1000). Change multiplication to mul_u32_u32(). Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: eeb2d80d502a ("ACPI / LPIT: Add Low Power Idle Table (LPIT) support") Signed-off-by: Nikita Kiryushin <kiryushin@ancud.ru> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/acpi_lpit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/acpi/acpi_lpit.c b/drivers/acpi/acpi_lpit.c
index c5598b6d5db8..794962c5c88e 100644
--- a/drivers/acpi/acpi_lpit.c
+++ b/drivers/acpi/acpi_lpit.c
@@ -105,7 +105,7 @@ static void lpit_update_residency(struct lpit_residency_info *info,
return;
info->frequency = lpit_native->counter_frequency ?
- lpit_native->counter_frequency : tsc_khz * 1000;
+ lpit_native->counter_frequency : mul_u32_u32(tsc_khz, 1000U);
if (!info->frequency)
info->frequency = 1;