From nobody Sat Nov 23 19:58:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1732026302; cv=none; d=zohomail.com; s=zohoarc; b=hjfPTJ4827pl+MNaJ5vXDWY8VxD4rnQs5gvSNjko6xoXEKORXB8FO7pg0xDDf3cKP2NAqcCyLm3kFO+08ZwsVQYvvbBgHcO2v3vYm4NBO2ZMl+XVgGdIuBN2ldi4jSc6kX30mYqelkVKWaXQHfEZMVzwaFWWtuoAVEqphmbEQmQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732026302; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=Uf4u1FQII+EcRWfJ9x1uUFpYR7e3NkroR87Xx7eXM1M=; b=e74kQpGqSOwjshmr+u99eevlKoMXBjzoBlYTVEvemv9dg16kvijMddvR67TktDEysW63//u+qUv7jZTJF2l6+8tyv+Wz53wYwgODcCWyCQwbQfMxtOgg5kZgVkK30/yDjXWHa8ZP5RPuF7DwGuqfl9CIdD8PA/LodZHRxO+XKo0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1732026302416357.66195691376083; Tue, 19 Nov 2024 06:25:02 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tDP8b-0005q6-6n; Tue, 19 Nov 2024 09:23:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tDP8Z-0005pK-FK for qemu-devel@nongnu.org; Tue, 19 Nov 2024 09:23:27 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tDP8X-0006CB-9T for qemu-devel@nongnu.org; Tue, 19 Nov 2024 09:23:27 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-43167ff0f91so39259445e9.1 for ; Tue, 19 Nov 2024 06:23:24 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-432dac21a15sm193049985e9.38.2024.11.19.06.23.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Nov 2024 06:23:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732026203; x=1732631003; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=Uf4u1FQII+EcRWfJ9x1uUFpYR7e3NkroR87Xx7eXM1M=; b=amB41AV/u2T3TP4oyevnnMvuWWdsKBJLndE01rvlDvpciPLw/vEwMeXG1QHXYEGbtC FvW7Eufw1xTkTz7xeh2/34YWWJbU+j+nRfeiLC40x/DrZM1c4Qk3e3vHZj5v6HBxXjlt qZF/PTDQvWD5dabnshNFLRNssjCuFeN5ekCTUYDsDINDFt1hywjhIOXvsu4yGXRsXyHU sXeKgMKhS/YGkcX8noVl/WgRKGmE8tXQyHZKMedamvRVZRUpM9Go95znuNqBqwXhqkj6 YHUyVgmx4dMdtTDcGKW4aun+519N2x8fcIaQBT7N9RSyzAvy5TsJe2q7ny6End1uHZUD CqAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732026203; x=1732631003; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Uf4u1FQII+EcRWfJ9x1uUFpYR7e3NkroR87Xx7eXM1M=; b=bRNtluvcHV5DB7pJMlkn7CTgynJjy0KWezsMaHJ5bM5WElrDYfio2INuBTOAKuK2ZU QaaPCNlOWiPC+1sCylzOSeXH3zM6dR75MQIGt6AZtd+vqF5pIefZaEVhirJcxlwTvhm9 4Lp9JA48PcQgTmLYknBTbczLodmcy+XoV6s9qSd6/eKqnmd9RZQJEjqLWnYobNgCTmOI oMydEF8mkc7ZFVR0EwJGOz4p5DKEevv693DxsZFHZSQMm4GlT5+ZXqoF6gqhCLADcgmC 75cdO7Sod0NIXEKFGJqmkQorSLZQ/+rg1dkncx7XXcBYdMW/zyZpqb5FoAXEUiqRK+fR yjJQ== X-Gm-Message-State: AOJu0YwFUqHG5RqAHPq1RLQnST0glA1oPnoeSjiBPpVm685a6rQcYiaH HsBc5gx4MdMDNq/m35LNsQfsWK2p0niUclUvxzUTeFMudr8p5groS1AU5V9ZFB49GHBiRoQVSMO M X-Google-Smtp-Source: AGHT+IEiW2dYC8JTrIAAGIkBUY6xCyqcj3IIIDaT6lWA0Ne3nUmin7D09uHAJ4uFtSYk5wtGacPvpw== X-Received: by 2002:a5d:59a6:0:b0:382:503f:a323 with SMTP id ffacd0b85a97d-382503fa505mr1478473f8f.19.1732026203335; Tue, 19 Nov 2024 06:23:23 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 01/15] hw/timer/exynos4210_mct: fix possible int overflow Date: Tue, 19 Nov 2024 14:23:07 +0000 Message-Id: <20241119142321.1853732-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241119142321.1853732-1-peter.maydell@linaro.org> References: <20241119142321.1853732-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x335.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1732026304060116600 Content-Type: text/plain; charset="utf-8" From: Dmitry Frolov The product "icnto * s->tcntb" may overflow uint32_t. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Dmitry Frolov Message-id: 20241106083801.219578-2-frolov@swemel.ru Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- hw/timer/exynos4210_mct.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/timer/exynos4210_mct.c b/hw/timer/exynos4210_mct.c index e807fe2de90..5c6e139b202 100644 --- a/hw/timer/exynos4210_mct.c +++ b/hw/timer/exynos4210_mct.c @@ -815,7 +815,7 @@ static uint32_t exynos4210_ltick_cnt_get_cnto(struct ti= ck_timer *s) /* Both are counting */ icnto =3D remain / s->tcntb; if (icnto) { - tcnto =3D remain % (icnto * s->tcntb); + tcnto =3D remain % ((uint64_t)icnto * s->tcntb); } else { tcnto =3D remain % s->tcntb; } --=20 2.34.1