From nobody Sun May 5 11:02:29 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1610990609; cv=none; d=zohomail.com; s=zohoarc; b=N/2qu/RsjYZ4qNiNOSEVZYDOssUT0/xBRvoi5iasby7g8IpLPJp/PEzvPP0i2gGeohEXJ1P7KaWLqft5T7V+I9Tyha+RH5O4DzQNgw28cR6sy0wjebNm7zcSOT/ypkWFTXFFTBO5y8/6bUMa7OCQV8N2GckAsXSYnbmlMmCe+NA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610990609; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=ZV09mv/MI0mZw1wK0zt42S1BO0My0aXzbkvwI/Ur9/Y=; b=ZdygR/ZQNeEzaJEJj2HP3yUX6lkJgriRCGDbUWiNSRjQR3jrI4PgL9gtlg+HU1TqIn0+kUXVW41USK0YG9ddHpuFaovKPqG1t/TR2ZSjVwJADoWd7gIEpov1+OMH5/4nrnrdiNrgJI8EfEupGuJYD1SaQRYiOQhp1FTU1JrwoDY= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1610990609904106.15150836349437; Mon, 18 Jan 2021 09:23:29 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.69909.125312 (Exim 4.92) (envelope-from ) id 1l1YFH-0008Lb-Ih; Mon, 18 Jan 2021 17:23:15 +0000 Received: by outflank-mailman (output) from mailman id 69909.125312; Mon, 18 Jan 2021 17:23:15 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l1YFH-0008LU-F9; Mon, 18 Jan 2021 17:23:15 +0000 Received: by outflank-mailman (input) for mailman id 69909; Mon, 18 Jan 2021 17:23:13 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l1YFF-0008LO-TE for xen-devel@lists.xenproject.org; Mon, 18 Jan 2021 17:23:13 +0000 Received: from MTA-08-4.privateemail.com (unknown [198.54.122.58]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 5bf2b0ad-0d06-4283-b09c-e8d6e9a9dc53; Mon, 18 Jan 2021 17:23:12 +0000 (UTC) Received: from MTA-08.privateemail.com (localhost [127.0.0.1]) by MTA-08.privateemail.com (Postfix) with ESMTP id 9D4F360098; Mon, 18 Jan 2021 12:23:11 -0500 (EST) Received: from t9.localdomain (unknown [10.20.151.225]) by MTA-08.privateemail.com (Postfix) with ESMTPA id 8D8056007B; Mon, 18 Jan 2021 17:23:10 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 5bf2b0ad-0d06-4283-b09c-e8d6e9a9dc53 From: Tamas K Lengyel To: xen-devel@lists.xenproject.org Cc: Tamas K Lengyel , Jan Beulich , Andrew Cooper , George Dunlap , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Wei Liu Subject: [PATCH] x86/mem_sharing: fix uninitialized 'preempted' variable Date: Mon, 18 Jan 2021 10:23:06 -0700 Message-Id: X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: ClamAV using ClamSMTP Content-Type: text/plain; charset="utf-8" UBSAN catches an uninitialized use of the 'preempted' variable in fork_hap_allocation when there is no preemption. Signed-off-by: Tamas K Lengyel Acked-by: Andrew Cooper --- xen/arch/x86/mm/mem_sharing.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c index c8a6d11b90..adaeab4612 100644 --- a/xen/arch/x86/mm/mem_sharing.c +++ b/xen/arch/x86/mm/mem_sharing.c @@ -1644,7 +1644,7 @@ static int copy_vcpu_settings(struct domain *cd, cons= t struct domain *d) static int fork_hap_allocation(struct domain *cd, struct domain *d) { int rc; - bool preempted; + bool preempted =3D false; unsigned long mb =3D hap_get_allocation(d); =20 if ( mb =3D=3D hap_get_allocation(cd) ) --=20 2.25.1