From nobody Sun May 19 06:23:10 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) smtp.mailfrom=devel-bounces@lists.libvirt.org Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 170298621233989.46348279994766; Tue, 19 Dec 2023 03:43:32 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 02E391B87; Tue, 19 Dec 2023 06:43:30 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id D0B5B1B39; Tue, 19 Dec 2023 06:42:29 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 5A61B1B26; Tue, 19 Dec 2023 06:35:07 -0500 (EST) Received: from mail.astralinux.ru (mail.astralinux.ru [217.74.38.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 190311B2A for ; Tue, 19 Dec 2023 06:35:06 -0500 (EST) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.astralinux.ru (Postfix) with ESMTP id DA81B18671A6; Tue, 19 Dec 2023 14:28:04 +0300 (MSK) Received: from mail.astralinux.ru ([127.0.0.1]) by localhost (rbta-msk-vsrv-mail01.astralinux.ru [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id X55sS_TB8-zS; Tue, 19 Dec 2023 14:28:04 +0300 (MSK) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.astralinux.ru (Postfix) with ESMTP id 8D7BA1868987; Tue, 19 Dec 2023 14:28:04 +0300 (MSK) Received: from mail.astralinux.ru ([127.0.0.1]) by localhost (rbta-msk-vsrv-mail01.astralinux.ru [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id HRlTn_mdTjvK; Tue, 19 Dec 2023 14:28:04 +0300 (MSK) Received: from rbta-msk-lt-320952.astralinux.ru (unknown [10.177.20.81]) by mail.astralinux.ru (Postfix) with ESMTPSA id 382B4186884B; Tue, 19 Dec 2023 14:28:04 +0300 (MSK) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 X-Greylist: delayed 418 seconds by postgrey-1.37 at lists.libvirt.org; Tue, 19 Dec 2023 06:35:06 EST X-Virus-Scanned: amavisd-new at astralinux.ru From: Egor Makrushin To: devel@lists.libvirt.org Subject: [PATCH] conf: Remove multiplication to avoid overflow Date: Tue, 19 Dec 2023 14:27:11 +0300 Message-Id: <20231219112711.5070-1-emakrushin@astralinux.ru> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-MailFrom: emakrushin@astralinux.ru X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0 Message-ID-Hash: 54PSYLGWOGLHGPUZIXFH555RG2FKIJFD X-Message-ID-Hash: 54PSYLGWOGLHGPUZIXFH555RG2FKIJFD X-Mailman-Approved-At: Tue, 19 Dec 2023 11:42:26 -0500 CC: sdl.libvirt@linuxtesting.org, Egor Makrushin X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1702986215537100001 Multiplication results in integer overflow. Replace value of 6th agrument with ULLONG_MAX. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 04bd77a19f ("conf: Move and rename virDomainParseScaledValue()") Signed-off-by: Egor Makrushin Reviewed-by: Peter Krempa --- src/conf/domain_conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 58a985fc5d..871fd3a874 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -8523,7 +8523,7 @@ virDomainControllerDefParseXML(virDomainXMLOption *xm= lopt, unsigned long long bytes; if ((rc =3D virParseScaledValue("./pcihole64", NULL, ctxt, &bytes, 1024, - 1024ULL * ULONG_MAX, false)) < 0) + ULLONG_MAX, false)) < 0) return NULL; =20 if (rc =3D=3D 1) --=20 2.30.2 _______________________________________________ Devel mailing list -- devel@lists.libvirt.org To unsubscribe send an email to devel-leave@lists.libvirt.org