From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web11.3948.1641439260483732405 for ; Wed, 05 Jan 2022 19:21:00 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=KwMfQ4+t; spf=pass (domain: intel.com, ip: 134.134.136.65, mailfrom: hao.a.wu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1641439260; x=1672975260; h=from:to:subject:date:message-id:references:in-reply-to: mime-version; bh=JmbSLlhDv8h4i/5UnLNfjyukZ0oOajG7472HnvqO5vc=; b=KwMfQ4+tdXmZjCp+N38RgSKjmNrzAIqtKg72mMGWUOJDhdCnx9fcDQ// 1wqTnc5HQ3rf+IbbZpmTm35iiF+Ub0y0VTKBmOOUtWRphudCDrb30HEdP QzbvprwzZ9H3k/H9PcKzSevEKuxTU7lMbmLICvsTZYRxQwPH4eqqTDbWT AtS5egKGQikzBUEkXu/igffNWwp6qPQMNEmqV06nCQpdaaNuhpJ2vwIUM X7NGOhuyDFRDQq4dvayfEUojztQgVVqNJAsuVPqL+zUApYEifkZ7P5Pgs wubn94ohRq6K86ebF60BWtaJ5C78Eus8WNE68svDD1ywB2N08YKHuCMgZ Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10217"; a="242537839" X-IronPort-AV: E=Sophos;i="5.88,265,1635231600"; d="scan'208,217";a="242537839" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jan 2022 19:20:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,265,1635231600"; d="scan'208,217";a="611689451" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by FMSMGA003.fm.intel.com with ESMTP; 05 Jan 2022 19:20:59 -0800 Received: from orsmsx605.amr.corp.intel.com (10.22.229.18) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Wed, 5 Jan 2022 19:20:59 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Wed, 5 Jan 2022 19:20:59 -0800 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (104.47.73.170) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Wed, 5 Jan 2022 19:20:58 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y8wBigigCTEcs2i5wkZ48LnqV9ROKOyKlHR29kTRL5wFpmRNrsFWibYnuC20GmE9Ta3UnVzRBA0bXWUJ56b3CMEWnGXDqcLsMIBE4+GTATiD/g+AjwrPdnF+Xgpvz61EwdPAj/lBwdWoSXzaH51wPn9yHCUNYNlimHJP7v0IfjvqwuA+6pCvDp43TCA1d/jw+1S2/uqso3FN78H5WynM49u0Do//A8Yfn9PYqaklYCxO3KCuSMPnZeEyoDj09zrXUKzNOxklysk/CcidTsH6il9r2IYgDJ5ik5mL4c0hIdSyb9vmftKO5uTbzYBUKG6yaP4Qe2imxusghd/O2vTUqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=YF3+HHVldvvF9Nv/FbRfyeoTkn5TB0G1Ue1A4n2sok0=; b=Tn141BOUoIScCWjEG8s46G3OBBi539dXqIFgzyHxuGnbX/d8tsfTDwXaRPnyiGA1mTd5yp0cwjRSVw2bOxEdueSrHwrmHYKeHqHsioyzov/qqs9T8qCnKTput85e3BkGS9gUHKXB6eOZjSqAboHkZLZScd+IaYnNzFS/gk2z3U1WVHTkG9Ynmk8uhv7SKGukDiFWEPTRT+N8qjnV6FEvlJA64w2lBH/0GXS7Vi/DKv0+cIybxebEE9v44hBrOOa9Q+uKIi/5G+LuDm4i7koEmO01oPa1FMP8Aekh1DhCRzd8QSnu/5ccbSKJ2RgusHm7sHb7MhHQ5HUIxUeeJ2Ht8Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from DM6PR11MB4025.namprd11.prod.outlook.com (2603:10b6:5:197::31) by DM6PR11MB3451.namprd11.prod.outlook.com (2603:10b6:5:5b::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4844.14; Thu, 6 Jan 2022 03:20:57 +0000 Received: from DM6PR11MB4025.namprd11.prod.outlook.com ([fe80::b8f1:aa83:cbbf:6964]) by DM6PR11MB4025.namprd11.prod.outlook.com ([fe80::b8f1:aa83:cbbf:6964%6]) with mapi id 15.20.4844.017; Thu, 6 Jan 2022 03:20:57 +0000 From: "Wu, Hao A" To: "Edwards, Craig" , "Gao, Liming" , "Wang, Jian J" , "Ni, Ray" , "Gao, Zhichao" , "devel@edk2.groups.io" , "Shutt, Mark" Subject: Re: [Patch MBR endless loop hang with invalid LBA0 1/1] MdeModulePkg/PartitionDxe: Add break to handle invalid LBA0 in MBR Thread-Topic: [Patch MBR endless loop hang with invalid LBA0 1/1] MdeModulePkg/PartitionDxe: Add break to handle invalid LBA0 in MBR Thread-Index: AdgCZVzj5whplCenSWm261VEn+0/fwARri+A Date: Thu, 6 Jan 2022 03:20:57 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_73dd1fcc-24d7-4f55-9dc2-c1518f171327_Enabled=true; MSIP_Label_73dd1fcc-24d7-4f55-9dc2-c1518f171327_SetDate=2022-01-05T18:53:11Z; MSIP_Label_73dd1fcc-24d7-4f55-9dc2-c1518f171327_Method=Standard; MSIP_Label_73dd1fcc-24d7-4f55-9dc2-c1518f171327_Name=No Protection (Label Only) - Internal Use; MSIP_Label_73dd1fcc-24d7-4f55-9dc2-c1518f171327_SiteId=945c199a-83a2-4e80-9f8c-5a91be5752dd; MSIP_Label_73dd1fcc-24d7-4f55-9dc2-c1518f171327_ActionId=628769ec-5e69-4788-82ed-a28e932d329d; MSIP_Label_73dd1fcc-24d7-4f55-9dc2-c1518f171327_ContentBits=2 dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 74e3b392-ae39-4065-efcb-08d9d0c38e44 x-ms-traffictypediagnostic: DM6PR11MB3451:EE_ x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5516; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: IhIvRc5LWCpH1gfQrl7elQxseZtw6+T8anbbyzZM+0ELReZemky8k4Kb9wVr/0UVBRO28Emi1K09Nyn5KIwwb7Zb3am5SvtGcKwTLbuii71A/gVDxlaYMgavUgGbqhMgcci4oozU6vbM1S1ifhnMsAHQ5FTpvTdo6VaLaNkZoHj8uxHa2v41RgK3F8OyXrlz3HrFTkH1RI69d4kth2jLa2tgMD0+Z2sr4Wc2Abhfw4V7O21lRrkm4/TlZKCDvXKOix0bfNRb65kIQIugShzwzKSS5J3q+bLo94nrZv5gcC+7zxWJJVdicnZH1HPFKzus5JBGFMT+YaNIUUv3DtOPJXFnvjwNX5RJDcLnu2Sqp20lhDYv8Dmn2/ixnPSfR6fUhuvnofkTwOxdW6FkDn75n695Lx22RHmkWqIFGz0g+M8MCfYvZaB2nf4h+lP+Q61NnCrmv56aSMKUKD1aoM9skw4cMGblAL0GukF0Qk7vL4dha+6iHzmqpczNnm21tRPWpEFKFOvEKxOC0ZX7NN/uXNFZ0dQekN50NaFlwx1ph2LEacmDgTsXNbApO5Zn3364F60BcGXoVmVskS6Boqx5gz51GI3aNkkGjR6NOjfZPsQSov3vkU38OX0Iw/4y3T2Zi/pwpKT23rrfptx7yG6TBfBP8kfas+kbqBXhkEvFn2J79WUz08QENudhQLctgxLN90sOTuhm1Pccp1yv7//4X93PoRlpix74jU/oz7pf/Z4= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR11MB4025.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(921005)(33656002)(55016003)(82960400001)(83380400001)(71200400001)(26005)(5660300002)(86362001)(52536014)(7696005)(9686003)(316002)(508600001)(53546011)(186003)(66946007)(6506007)(64756008)(66556008)(2906002)(110136005)(66446008)(66476007)(38100700002)(8936002)(45080400002)(122000001)(38070700005)(76116006)(8676002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?8FcMcL69N8Ty03juaAzWoxv9F4xJcSDc0uT+eOSSWeL1mksL3uMQoID5UoMx?= =?us-ascii?Q?0RJDpfP/7sZUW5sibwRjNxIcavnmdJE8ed2+m2MtIBKqOj2u0nfNVE0buQDq?= =?us-ascii?Q?H/zejmc+SDXHBh6sL3R/50pOfsNJtUEnd5HRfl2gxJNj6V4TTQd98KXIooHe?= =?us-ascii?Q?WengfOqT1z7lqfWgZux4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7Ks+wqeuA6kgT88gCvLpp8?= =?us-ascii?Q?Jx0zGvIhoohxCAcJ8KXsqvl6WlTsAmztUEFdpYIwoA7azQu7rp1SXw+ZpZn9?= =?us-ascii?Q?wKx3dvxOUUb01Dns/CNtbzNOw6B38rlBf7BHWmkmHdx9eYcPZvmTjS6GjPgM?= =?us-ascii?Q?3SqSV2GfeK6wBULGA9XtCZs+mqwCPwGh3ds+F964LIS/OITXHxn+AaT41YiK?= =?us-ascii?Q?89PQdGWfoC1g+uAtdw/OAAZetNUeAwt5kv515N0TKe/2daBDB5wpE8PR++ZW?= =?us-ascii?Q?Zg9k15xEsYVE0iqCNVKOszVdxbZgxvTlKsFkpPDIaqW4pwH4pqeDCT0y+hV4?= =?us-ascii?Q?j9Etets31mKOW8MQE6WPqiRi3ARPxLtwU+dU6viiJnlAV+48cLTjXZNGXLyN?= =?us-ascii?Q?srQq8KK1W9RF+OeAiMZSazEfEJqQLAcVGdXa8OITEXcnXiCPMqnwP9zZucna?= =?us-ascii?Q?gXerWpRZygk3Hwkb0MG8809c1v4rrAi6N4ysxr7NqZ1yuOdT5V1x6EGos+FF?= =?us-ascii?Q?imYDJoTh3hsRRviP/eK9SVTb6h/Fk0177EOuuNMEjT8rprwuJ28+W5wiYI6F?= =?us-ascii?Q?Yjs9qR5JKclxy7ZP5Sk0Gm8=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB4025.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 74e3b392-ae39-4065-efcb-08d9d0c38e44 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Jan 2022 03:20:57.2156 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: qIuVHyN4j7xfTm2fyXzs9GQiplQzmNz9gXlj5++50BThcVl6rPT5P2NGwO/53IrbKiSIPbjul7DD5GIMvtQgLA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3451 Return-Path: hao.a.wu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_DM6PR11MB4025F387855BE93BEFA4150CCA4C9DM6PR11MB4025namp_" --_000_DM6PR11MB4025F387855BE93BEFA4150CCA4C9DM6PR11MB4025namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Inline comment below: From: Edwards, Craig Sent: Thursday, January 6, 2022 2:53 AM To: Gao, Liming ; Wang, Jian J ; Wu, Hao A ; Ni, Ray ; Gao, Zhi= chao ; devel@edk2.groups.io; Shutt, Mark Subject: [Patch MBR endless loop hang with invalid LBA0 1/1] MdeModulePkg/P= artitionDxe: Add break to handle invalid LBA0 in MBR Read Disk does a modification of ExtMbrStartingLba with the code MultU64x32 (ExtMbrStartingLba, BlockSize) Error detection to see if ExtMbrStartingLBA has a value of 0. This is invalid as LBA 0 =3D MBR. After modification, the next time ExtMbrStartingLba is in this function if ExtMbrStartingLba is set to 0 in the MBR it never passes the while/do evaluation It is multiplied by= 0 by read disk , set to 0 by an invalid MBR and goes back to evaluation This condition will also cause Ws19 and WS22 to hang, however Microsoft has developed a hotfix patch that will be released in 2022 Cc: Liming Gao > Cc: Jian J Wang > Cc: Hao A Wu > Cc: Ray Ni > Cc: Zhichao Gao > Signed-off-by: Craig Edwards > Date: Wed Jan 5 12:27:46 2022 -0600 On branch graceful_handle_mbr_hang_edit1 Changes to be committed: modified: MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c --- MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c b/MdeModulePkg/= Universal/Disk/PartitionDxe/Mbr.c index 0f8dc5486521..ad18840e5efd 100644 --- a/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c +++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c @@ -293,6 +293,12 @@ PartitionInstallMbrChildHandles ( (Mbr->Partition[0].OSIndicator =3D=3D EXTENDED_WINDOWS_PARTITION= )) { ExtMbrStartingLba =3D UNPACK_UINT32 (Mbr->Partition[0].StartingLBA= ); + // + // A value of 0 is invalid for StartingLBA + // + if (ExtMbrStartingLba =3D=3D 0) { + break; + } Seems the indent includes 2 unneeded spaces. I will help to remove them whe= n merging the patch. Reviewed-by: Hao A Wu Will wait a couple of days before merging to see if comments from other rev= iewers. Best Regards, Hao Wu continue; } -- 2.32.0.windows.1 Craig Edwards Software Engineer Dell | GDP | PSE | COMMS | BIOS Craig_Edwards@Dell.com Internal Use - Confidential --_000_DM6PR11MB4025F387855BE93BEFA4150CCA4C9DM6PR11MB4025namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Inline comment below:

 

 

From: Edwards, Craig <Craig.Edwards@dell.c= om>
Sent: Thursday, January 6, 2022 2:53 AM
To: Gao, Liming <gaoliming@byosoft.com.cn>; Wang, Jian J <j= ian.j.wang@intel.com>; Wu, Hao A <hao.a.wu@intel.com>; Ni, Ray <= ;ray.ni@intel.com>; Gao, Zhichao <zhichao.gao@intel.com>; devel@ed= k2.groups.io; Shutt, Mark <mark.shutt@dell.com>
Subject: [Patch MBR endless loop hang with invalid LBA0 1/1] MdeModu= lePkg/PartitionDxe: Add break to handle invalid LBA0 in MBR

 

Read Disk does a modification of ExtMbrStartingLba with = the code MultU64x32

(ExtMbrStartingLba, BlockSize) Error detection to see if= ExtMbrStartingLBA

has a value of 0. This is invalid as LBA 0 =3D MBR. Afte= r modification, the

next time ExtMbrStartingLba is in this function if ExtMb= rStartingLba is set

to 0 in the MBR it never passes the while/do evaluation = It is multiplied by 0

by read disk , set to 0 by an invalid MBR and goes back = to evaluation This

condition will also cause Ws19 and WS22 to hang, however= Microsoft has

developed a hotfix patch that will be released in 2022

 

Cc: Liming Gao <gaoliming@byosoft.com.cn>

Cc: Jian J Wang <j= ian.j.wang@intel.com>

Cc: Hao A Wu <hao.a.wu@intel.com>

Cc: Ray Ni <ray.ni@inte= l.com>

Cc: Zhichao Gao <z= hichao.gao@intel.com>

 

Signed-off-by: Craig Edwards <craig.edwards@dell.com= >

 

Date:      Wed Jan 5 12:27:46 2= 022 -0600

 

On branch graceful_handle_mbr_hang_edit1

Changes to be committed:

        modified:&nbs= p;  MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c

---

MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c | 6 +++++= +

1 file changed, 6 insertions(+)

 

diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Mb= r.c b/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c

index 0f8dc5486521..ad18840e5efd 100644

--- a/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c

+++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c

@@ -293,6 +293,12 @@ PartitionInstallMbrChildHandles (

         &n= bsp; (Mbr->Partition[0].OSIndicator =3D=3D EXTENDED_WINDOWS_PARTITION))<= o:p>

       {=

         ExtMbrS= tartingLba =3D UNPACK_UINT32 (Mbr->Partition[0].StartingLBA);=

+          = //

+          = // A value of 0 is invalid for StartingLBA

+          = //

+          = if (ExtMbrStartingLba =3D=3D 0) {

+         &= nbsp;  break;

+          = }

 

 

Seems the indent includes 2 unneeded spaces. I will = help to remove them when merging the patch.

Reviewed-by: Hao A Wu <hao.a.wu@intel.com>

 

Will wait a couple of days before merging to see if = comments from other reviewers.

 

Best Regards,

Hao Wu

 

 

         continu= e;

       }=

 

--

2.32.0.windows.1

 

 

 

 

 

Craig Edwards

Software Engineer

Dell | GDP | P= SE | COMMS | BIOS

 

 

 


Internal Use - Confidential

 

--_000_DM6PR11MB4025F387855BE93BEFA4150CCA4C9DM6PR11MB4025namp_--