From nobody Tue Dec 30 22:51:16 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C7EEEC4332F for ; Thu, 9 Nov 2023 18:09:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344932AbjKISJO (ORCPT ); Thu, 9 Nov 2023 13:09:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231478AbjKISJM (ORCPT ); Thu, 9 Nov 2023 13:09:12 -0500 Received: from relay164.nicmail.ru (relay164.nicmail.ru [91.189.117.8]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7DC0CE; Thu, 9 Nov 2023 10:09:07 -0800 (PST) Received: from [10.28.138.151] (port=11776 helo=[192.168.95.111]) by relay.hosting.mail.nic.ru with esmtp (Exim 5.55) (envelope-from ) id 1r19Sf-00020H-DZ; Thu, 09 Nov 2023 21:09:01 +0300 Received: from [87.245.155.195] (account kiryushin@ancud.ru HELO [192.168.95.111]) by incarp1103.mail.hosting.nic.ru (Exim 5.55) with id 1r19Sf-001rie-0S; Thu, 09 Nov 2023 21:09:01 +0300 Message-ID: <430a1271-a45c-4f5a-90c7-a62703ac7cf4@ancud.ru> Date: Thu, 9 Nov 2023 21:08:59 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Nikita Kiryushin Subject: [PATCH] ACPI: LPIT: fix u32 multiplication overflow To: "Rafael J. Wysocki" Cc: Len Brown , Srinivas Pandruvada , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-MS-Exchange-Organization-SCL: -1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8"; format="flowed" 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 --- drivers/acpi/acpi_lpit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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=20 lpit_residency_info *info, return; info->frequency =3D 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 =3D 1; -- 2.34.1