From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1E859184; Tue, 23 Jan 2024 01:09:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705972155; cv=none; b=Ng9DXsZKoVq8Mq1J1FjEYDr2MUy/YgIXwL5VF3RBpzclWEmQOrpwVR16tXGw1K8gvO3OkPrgsEo/pZYknIRUxO5ZOFnPe/ovl1rKtb2n9qnJ0nlrNQ6dXqQma5dbuKdNTvQOdPaa3LzzMK1MU/EsS0hfJkv1GNzFq5jHUuyBmT0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705972155; c=relaxed/simple; bh=c6FFbEgbwMb9HlaoMUI0jg6MndlA8zcpwmvX0jXCWDg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Zc3sFNfSFshd7A8kvPx6Sou4olMZlaPRpjuM16G/SWmxiKcGsgFSdlaAT2bzujCFYaq/KQsVEnewKOaVf58ThvoMME5SO9B6cgPcpC0k7052ZIU9yYq8t9ereMGFindMXFrfeaXHKoJBYdgF3CAOuClGD/0BKEUJIk/y0E287sA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=yIJEMh15; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="yIJEMh15" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D607DC433C7; Tue, 23 Jan 2024 01:09:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1705972155; bh=c6FFbEgbwMb9HlaoMUI0jg6MndlA8zcpwmvX0jXCWDg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yIJEMh15eRfdPpK2L6RzYbPeZRAOaYPlZKNaPjsRJyltv0OrrazYTD2F7MGvmVez+ IP5UJ2H9hW9mpUftXo3LR7EeU/dXzUpIM6F2JPkgY3GOMY2QKFddoZFGS98CnFIM3u 7b6Dhzw2O05hmUrIVd7oYTe2KCOScqvrF+0L0QKY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Nikita Kiryushin , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 5.15 081/374] ACPI: LPIT: Avoid u32 multiplication overflow Date: Mon, 22 Jan 2024 15:55:37 -0800 Message-ID: <20240122235747.443826869@linuxfoundation.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240122235744.598274724@linuxfoundation.org> References: <20240122235744.598274724@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Nikita Kiryushin [ 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 Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- 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 48e5059d67ca..7de59730030c 100644 --- a/drivers/acpi/acpi_lpit.c +++ b/drivers/acpi/acpi_lpit.c @@ -98,7 +98,7 @@ static void lpit_update_residency(struct lpit_residency_info *info, struct acpi_lpit_native *lpit_native) { 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; -- 2.43.0