From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 70825740038 for ; Mon, 27 Nov 2023 08:32:37 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=ZkpQLWh2KZaHi0AqUuloDG1iS//iezHJHTsLiK43i+c=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1701073956; v=1; b=GJY5367hs23IMvBb2h2mZhdK/uAnfq3sFZwM0dLZbNW6mZXimJLcTufV42izen8zjochi4vU 0fKvM64wRR4DauvRJw4nbpxoAKG/yQoWKicZQctnkFpKDiEj3nCZjU9d0a3pfiX3IpwX+UdjUDc dxHx5jpafNvfJHRnAOEl8fwo= X-Received: by 127.0.0.2 with SMTP id at4XYY7687511xk0rnEkqqyd; Mon, 27 Nov 2023 00:32:36 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by mx.groups.io with SMTP id smtpd.web11.88702.1701073954686202086 for ; Mon, 27 Nov 2023 00:32:35 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10906"; a="14219751" X-IronPort-AV: E=Sophos;i="6.04,230,1695711600"; d="scan'208";a="14219751" X-Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2023 00:32:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10906"; a="771849167" X-IronPort-AV: E=Sophos;i="6.04,230,1695711600"; d="scan'208";a="771849167" X-Received: from shwdesfp01.ccr.corp.intel.com ([10.239.158.151]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2023 00:32:32 -0800 From: "Zhiguang Liu" To: devel@edk2.groups.io Cc: Zhiguang Liu , Ray Ni , Rahul Kumar , Gerd Hoffmann , Laszlo Ersek Subject: [edk2-devel] [PATCH 1/3] UefiCpuPkg/CpuPageTableLib: Init local variable before using it. Date: Mon, 27 Nov 2023 16:32:23 +0800 Message-Id: <20231127083225.1294-1-zhiguang.liu@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,zhiguang.liu@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 71Hb7cdmhN173XLQPZ54y41Tx7686176AA= Content-Transfer-Encoding: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=GJY5367h; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io The local variable OneOfPagingEntry is used before initialized, this may cause reserved bit in page table entry is set especially in PAE paging mode. The bug is random because it depends on the value in stack. Cc: Ray Ni Cc: Rahul Kumar Cc: Gerd Hoffmann Cc: Laszlo Ersek Signed-off-by: Zhiguang Liu --- UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c b/UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c index eff02619fa..36b2c4e6a3 100644 --- a/UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c +++ b/UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c @@ -338,7 +338,7 @@ PageTableLibMapInLevel ( ParentAttribute = &LocalParentAttribute; OriginalParentPagingEntry.Uint64 = ParentPagingEntry->Uint64; - + OneOfPagingEntry.Uint64 = 0; // // RegionLength: 256T (1 << 48) 512G (1 << 39), 1G (1 << 30), 2M (1 << 21) or 4K (1 << 12). // @@ -367,8 +367,6 @@ PageTableLibMapInLevel ( if (RETURN_ERROR (Status)) { return Status; } - - OneOfPagingEntry.Pnle.Uint64 = 0; } else { PageTableLibSetPle (Level, &OneOfPagingEntry, 0, &PleBAttribute, &AllOneMask); } -- 2.31.1.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#111729): https://edk2.groups.io/g/devel/message/111729 Mute This Topic: https://groups.io/mt/102825574/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-