From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=68.232.153.95; helo=esa5.dell-outbound.iphmx.com; envelope-from=jim.dailey@dell.com; receiver=edk2-devel@lists.01.org Received: from esa5.dell-outbound.iphmx.com (esa5.dell-outbound.iphmx.com [68.232.153.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 1B92D21A02937 for ; Thu, 11 Oct 2018 06:05:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=dell.com; i=@dell.com; q=dns/txt; s=smtpout; t=1539263148; x=1570799148; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=CxP3adQ9CO72HUFSTYAJxEmW5XKqL/nmRRf351oXRPk=; b=qUNjjlhlDM4UpbpI0e+1Zu1nFnKX0OsaXThAEpSijCWurk6NwKNE44TU QsHpjKrcCVaLwNgr9/1/Ty1BcCaHhgEDxRbwLOGFX69NHH1BGWMv5lYtK dBQvSQpAFkClQhzHzYT0MrTOoQHoyO5+POA+mhFTL2HcVEuYA158huLFk 8=; X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2ECAADnSb9bhyWd50NiGgEBAQEBAgE?= =?us-ascii?q?BAQEHAgEBAQGBUQUBAQEBCwEBgmh/KAqHNYRMX41kgXiQH4RpgXoLAQEYCwu?= =?us-ascii?q?EPgKEdzQNDQEDAQECAQECAQECEAEBARUJCCkjDEIBDgGBZCIRgQkBAQEBAQE?= =?us-ascii?q?BAQEjKgINYwEBAQEDAQEQFRM0CwwEAgEIEQQBAR8JBycBHgkIAgQOBQgagn4?= =?us-ascii?q?BggEPm1GJVwEBAYFoM4NwhWQFjVyBEoMSgxsBAwEXgRCBBIULAokNlQMHAoZ?= =?us-ascii?q?ShXeEAx+BT4d8hkYsjAiGK4MMAgQCBAUCFIFCN4FXcFCCbIIjEQkRiB4rhT5?= =?us-ascii?q?vAYY1g16BLoEfAQE?= X-IPAS-Result: =?us-ascii?q?A2ECAADnSb9bhyWd50NiGgEBAQEBAgEBAQEHAgEBAQGBU?= =?us-ascii?q?QUBAQEBCwEBgmh/KAqHNYRMX41kgXiQH4RpgXoLAQEYCwuEPgKEdzQNDQEDA?= =?us-ascii?q?QECAQECAQECEAEBARUJCCkjDEIBDgGBZCIRgQkBAQEBAQEBAQEjKgINYwEBA?= =?us-ascii?q?QEDAQEQFRM0CwwEAgEIEQQBAR8JBycBHgkIAgQOBQgagn4BggEPm1GJVwEBA?= =?us-ascii?q?YFoM4NwhWQFjVyBEoMSgxsBAwEXgRCBBIULAokNlQMHAoZShXeEAx+BT4d8h?= =?us-ascii?q?kYsjAiGK4MMAgQCBAUCFIFCN4FXcFCCbIIjEQkRiB4rhT5vAYY1g16BLoEfA?= =?us-ascii?q?QE?= Received: from mx0b-00154901.pphosted.com (HELO mx0a-00154901.pphosted.com) ([67.231.157.37]) by esa5.dell-outbound.iphmx.com with ESMTP/TLS/AES256-SHA256; 11 Oct 2018 08:05:47 -0500 Received: from pps.filterd (m0089484.ppops.net [127.0.0.1]) by mx0b-00154901.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w9BD31Bb096890 for ; Thu, 11 Oct 2018 09:05:55 -0400 Received: from esa2.dell-outbound2.iphmx.com (esa2.dell-outbound2.iphmx.com [68.232.153.202]) by mx0b-00154901.pphosted.com with ESMTP id 2n22dkhp13-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 11 Oct 2018 09:05:55 -0400 From: Received: from ausc60ps301.us.dell.com ([143.166.148.206]) by esa2.dell-outbound2.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA256; 11 Oct 2018 19:05:46 +0600 X-LoopCount0: from 10.166.136.216 X-IronPort-AV: E=Sophos;i="5.54,368,1534827600"; d="scan'208";a="1207507566" To: CC: , Thread-Topic: [edk2] [PATCH] ShellPkg/dmem: Only dump sizeof (EFI_SYSTEM_TABLE) bytes for gST Thread-Index: AQHUYTdS2Ef3bH0afE2o0ZL/8uMp16UaArzw Date: Thu, 11 Oct 2018 13:05:52 +0000 Message-ID: <96c3fa7383b94fa0852822e25341777a@ausx13mps335.AMER.DELL.COM> References: <20181011075249.240844-1-ruiyu.ni@intel.com> In-Reply-To: <20181011075249.240844-1-ruiyu.ni@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_17cb76b2-10b8-4fe1-93d4-2202842406cd_Enabled=True; MSIP_Label_17cb76b2-10b8-4fe1-93d4-2202842406cd_SiteId=945c199a-83a2-4e80-9f8c-5a91be5752dd; MSIP_Label_17cb76b2-10b8-4fe1-93d4-2202842406cd_Owner=Jim_Dailey@Dell.com; MSIP_Label_17cb76b2-10b8-4fe1-93d4-2202842406cd_SetDate=2018-10-11T13:03:21.2288292Z; MSIP_Label_17cb76b2-10b8-4fe1-93d4-2202842406cd_Name=External Public; MSIP_Label_17cb76b2-10b8-4fe1-93d4-2202842406cd_Application=Microsoft Azure Information Protection; MSIP_Label_17cb76b2-10b8-4fe1-93d4-2202842406cd_Extended_MSFT_Method=Manual; Sensitivity=External Public x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.143.242.75] MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-10-11_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=997 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1810110128 Subject: Re: [PATCH] ShellPkg/dmem: Only dump sizeof (EFI_SYSTEM_TABLE) bytes for gST X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Oct 2018 13:05:58 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Is the line: Size =3D gST->Hdr.HeaderSize; possibly a better way of handling this? Either way: Reviewed-by: Jim Dailey -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Ruiy= u Ni Sent: Thursday, October 11, 2018 2:53 AM To: edk2-devel@lists.01.org Cc: Jaben Carsey Subject: [edk2] [PATCH] ShellPkg/dmem: Only dump sizeof (EFI_SYSTEM_TABLE) = bytes for gST REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1236 When "dmem" runs without additional arguments, it dumps the memory content of EFI_SYSTEM_TABLE. But today's implementation dumps 512 bytes. It's not correct because sizeof (EFI_SYSTEM_TABLE) is less than 512, the 512-read causes page fault exception in a heap-guard enabled environment. The patch changes the implementation to only dump sizeof (EFI_SYSTEM_TABLE) bytes for gST. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni Cc: Jaben Carsey --- ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c b/ShellPkg/= Library/UefiShellDebug1CommandsLib/Dmem.c index f38593a9e9..a4c18c9b68 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c @@ -149,7 +149,7 @@ ShellCommandRunDmem ( Temp1 =3D ShellCommandLineGetRawValue(Package, 1); if (Temp1 =3D=3D NULL) { Address =3D gST; - Size =3D 512; + Size =3D sizeof (*gST); } else { if (!ShellIsHexOrDecimalNumber(Temp1, TRUE, FALSE) || EFI_ERROR(Sh= ellConvertStringToUint64(Temp1, (UINT64*)&Address, TRUE, FALSE))) { ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), = gShellDebug1HiiHandle, L"dmem", Temp1); --=20 2.16.1.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel