From nobody Sat May 11 19:30:43 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1709627485564537.2503116107438; Tue, 5 Mar 2024 00:31:25 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id CA3A11A4B; Tue, 5 Mar 2024 03:31:23 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 6CAE01961; Tue, 5 Mar 2024 03:29:59 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 7638B195F; Tue, 5 Mar 2024 03:29:55 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 65CCF1961 for ; Tue, 5 Mar 2024 03:29:54 -0500 (EST) Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-373-BclRdNtkPXm-iRLmMq3rBw-1; Tue, 05 Mar 2024 03:29:52 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 22F1929AA396 for ; Tue, 5 Mar 2024 08:29:52 +0000 (UTC) Received: from ajulis-thinkpadt14gen4.remote.csb (unknown [10.43.3.76]) by smtp.corp.redhat.com (Postfix) with ESMTP id BF0EA40C6CB5 for ; Tue, 5 Mar 2024 08:29:51 +0000 (UTC) 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,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 X-MC-Unique: BclRdNtkPXm-iRLmMq3rBw-1 From: Adam Julis To: devel@lists.libvirt.org Subject: [PATCH] virsh: Fix overflow error of freepages command Date: Tue, 5 Mar 2024 09:29:06 +0100 Message-ID: <6859348c7528492037524b94004e0c313c8ca3f9.1709627305.git.ajulis@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Message-ID-Hash: MKJBXAMUNWBSEY4EOGY2ZYRMDTHXID2R X-Message-ID-Hash: MKJBXAMUNWBSEY4EOGY2ZYRMDTHXID2R X-MailFrom: ajulis@redhat.com 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; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header 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"; x-default="true" Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1709627486126100001 Trying to print pages of a size larger than the UINT_MAX of the given platf= orm, a system error was printed, but this is a legitimate request, fixed Signed-off-by: Adam Julis --- tools/virsh-host.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/virsh-host.c b/tools/virsh-host.c index 6c14be865f..dc1282e718 100644 --- a/tools/virsh-host.c +++ b/tools/virsh-host.c @@ -335,7 +335,7 @@ cmdFreepages(vshControl *ctl, const vshCmd *cmd) =20 VSH_EXCLUSIVE_OPTIONS_VAR(all, cellno); =20 - if (vshCommandOptScaledInt(ctl, cmd, "pagesize", &bytes, 1024, UINT_MA= X) < 0) + if (vshCommandOptScaledInt(ctl, cmd, "pagesize", &bytes, 1024, UINT_MA= X*1024ULL) < 0) goto cleanup; kibibytes =3D VIR_DIV_UP(bytes, 1024); =20 --=20 2.43.2 _______________________________________________ Devel mailing list -- devel@lists.libvirt.org To unsubscribe send an email to devel-leave@lists.libvirt.org