From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-00154904.pphosted.com (mx0b-00154904.pphosted.com [148.163.137.20]) by mx.groups.io with SMTP id smtpd.web10.5098.1641408804646653805 for ; Wed, 05 Jan 2022 10:53:24 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@dell.com header.s=smtpout1 header.b=Bk3INtls; spf=pass (domain: dell.com, ip: 148.163.137.20, mailfrom: craig.edwards@dell.com) Received: from pps.filterd (m0170398.ppops.net [127.0.0.1]) by mx0b-00154904.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 205FkNhe021204; Wed, 5 Jan 2022 13:53:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dell.com; h=from : to : subject : date : message-id : content-type : mime-version; s=smtpout1; bh=9/W8Q15+ipHpsl17EjJ3w3TFqikDMhqkVwkar0VtJqQ=; b=Bk3INtlsj2iduEGOuqgY8D0Z4BIWo/GDcs+HEBCNRU2LlVSe1gK8dUw9fjMvQ82eFOHC SuxOyt8HJ2l4gsTjxW6clmIT5+313DC+dBZe1M4GHYU86OHZj/D1rrSvI0Qz9Jpvullv NMfEDzLtElFuMDvLTa5tM8D9h/v0+7K9M1GdDsCPFjsVrwU7yHcaiskA4z7REWhiTD96 TJkbca4JI/Z6Iz2swQ1KmM0Gz6wwIxcbS+obzwwxynNCUIdF9+mGvSBaHZABrue192eM 8/9FDQTHlzMPJHP2cOwOtTdBh3h1cMJ+LDFC80do+g2ya3vNtZrPrOJG+L0E5EKON1fG sg== Received: from mx0b-00154901.pphosted.com (mx0b-00154901.pphosted.com [67.231.157.37]) by mx0b-00154904.pphosted.com (PPS) with ESMTPS id 3dd81h2dk0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 Jan 2022 13:53:18 -0500 Received: from pps.filterd (m0134318.ppops.net [127.0.0.1]) by mx0a-00154901.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 205IpJ43080299; Wed, 5 Jan 2022 13:53:17 -0500 Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2100.outbound.protection.outlook.com [104.47.58.100]) by mx0a-00154901.pphosted.com with ESMTP id 3db5dqnmf8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 05 Jan 2022 13:53:17 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Rc1HcMQwzEYXFQ7L8vy2MGBjI5IfyQnV9iWP/xqbpXgJPAKu1PlMXNp/uLSKC04cR+gCi6sSGp7/JJ1dUC1os/wVBHQMgzupX4/jZ04lWsJxWglR07TtbdW9Py/Hc0zGxL0Oh60ZF+7Lleq0cAFYhX4F6MSomxIsjetNO6Pn7sCqayDGB+xvHJnAo1vnTWauDQPrQUDhwA5tOqPf4nDuZij9KzzaRDzULvxV3QOKlmkCPjWrCH978ZBEyNc168Jg3xC67xVbE55dW9hDB/ubjrd3AhM1rHPIOPDGed4e+vS8/LsYBgYMOR1Qrv5LrKLJff3sfBsO0StKgfH+IWkBAg== 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=9/W8Q15+ipHpsl17EjJ3w3TFqikDMhqkVwkar0VtJqQ=; b=nkCB59mBa7LRQdE9OXT4PqPe0t7dC+7zHZOIItoPcvwFOpfEvknZrlYyaClVutW8Zuac1t6LaNGZop58RDVFYXCDtkUp3CLWIXYQdHi55V8/Zcs+7htybi1INjISnO56BdCiP4w7kMWY3I2oqR1fZPE5tV1rSosPIf2ihSwl2bq9yUKKfSTN0IRyPRHxWe3sPyMcpHVWqeDap5Zpalj6B1VjvVGaT+UKekIxiUuB0zKauxKXdjppTTMTBN9U7AuIp1PsZN1regwnQAbfc5fjiyo/6SJ4XBAftZvFfCDh/Urcm7zen6ae3TaJ/FE7BrT+2wCb0s8Uqp/Wjv9q50wycA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=dell.com; dmarc=pass action=none header.from=dell.com; dkim=pass header.d=dell.com; arc=none Received: from SA1PR19MB5168.namprd19.prod.outlook.com (2603:10b6:806:1a2::16) by SA1PR19MB5087.namprd19.prod.outlook.com (2603:10b6:806:1a8::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4844.15; Wed, 5 Jan 2022 18:53:12 +0000 Received: from SA1PR19MB5168.namprd19.prod.outlook.com ([fe80::a97a:e5ca:ab0:5b41]) by SA1PR19MB5168.namprd19.prod.outlook.com ([fe80::a97a:e5ca:ab0:5b41%7]) with mapi id 15.20.4844.016; Wed, 5 Jan 2022 18:53:12 +0000 From: "Edwards, Craig" To: "gaoliming@byosoft.com.cn" , "jian.j.wang@intel.com" , "hao.a.wu@intel.com" , "ray.ni@intel.com" , "zhichao.gao@intel.com" , "devel@edk2.groups.io" , "Shutt, Mark" Subject: [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/fw== Date: Wed, 5 Jan 2022 18:53:12 +0000 Message-ID: Accept-Language: en-US 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 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e2ec09ae-4857-4848-2622-08d9d07c9fe7 x-ms-traffictypediagnostic: SA1PR19MB5087:EE_ x-microsoft-antispam-prvs: x-exotenant: 2khUwGVqB6N9v58KS13ncyUmMJd8q4 x-ms-oob-tlc-oobclassifiers: OLM:7691; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: djv2HC1nU/LIdbXegDp1Gqu2qZIR0hQEMmGXdtkeoctz7PCQUbGKR91oEIAdY17Li9DFrUSMkp2axGTlN/Cuq2CLYJVkeZNg/yyDLk8K1ikZYqFRFRD50tn5FVHMM6dX05Q1jF+GeE8Q7ijgYQ0tu0rSzxStCrpfebn7qHsDEym4aBZkiXtEAucXHjRs+48uibJwt/U6T3sUw+CKIbNirOgVeqjkn5nVFeunn0P+4CSWrmQU3b9suHXtkflpoai6s2EJecpjw7rHoxLO6do0oY4pfCRUR4jcWnfRqcM5jDp8jha3QXGba/dRiX6imF5usuNdoPrqvrhJ+KOLrhmFzS3TQqGToZZWmbefVuZr1Efsap5nbUlXR3WG6Zj+Dlfh6yvl8KiX0Q7OMOS0F1QJpesackEjUFI56H9e9CiDj1NK+VV2CkB4kOyrWR/3OJf9Lm8FbO1dIrwjRv0CG63/QfLI7WuRN2aSGUkH4GyBpd3Y7mv0k669CZ+8/E8XUcv/ilgZRVaqWc54vB5ILA/cj+1CZjgEM1vObrc6GGcC/VQ+SHvHkD1ri1nzOw4uCR0vC6apg8davVzEBUZxcoC86nsamFaHZSxe7p/FajP5w00TJwY4SP6BJt86c1zyE1YpszMeZeuXItJe6u0ngj4qQT9Bho2f+ppYT6mbpHfIHhu9zP790BUOgVKIbPfPuVIQ4diWs9lnipw2eGUyy7LK6g== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA1PR19MB5168.namprd19.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(508600001)(8936002)(6506007)(316002)(30864003)(2906002)(66556008)(786003)(66476007)(38070700005)(7696005)(110136005)(71200400001)(966005)(64756008)(86362001)(55016003)(66946007)(5660300002)(26005)(38100700002)(33656002)(83380400001)(8676002)(52536014)(66446008)(82960400001)(9686003)(186003)(6636002)(45080400002)(122000001)(76116006);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?7HEwN5g9FJmiSHoD4SJ2sjmHafnETnAv9sgjN92sD4RT4a7oOCxb/Ekp0KpP?= =?us-ascii?Q?vl0ypyadIaRu/LUk1phfSJ4siKyKS5DScR7Qj3SpxQX/Ce6qe85rENOBsx9F?= =?us-ascii?Q?HitTQkJ/QiHMpoLpmxInx5GyLlJX6THt4spvVKljsH9AaDS2/sF7AQ+9PXme?= =?us-ascii?Q?bvyfEbrCPxkEjaMxZxBwGJVoQCCBOmm7xSrdmkFHIowwV5c2ilWXXB4KIU0h?= =?us-ascii?Q?AjwjuK96aoiJ0ZaHzI8lLpfYlgX5u1T+sAwz0nuncEBtoOJkiTUEifuqRu/P?= =?us-ascii?Q?HkUDcOkp23Ny5HnzqD/tG/XjlPZOH5dvBXwB5KXBGtfTbJwjxADkVgiA3JwS?= =?us-ascii?Q?3KI9zlDuWGu6cXB7RbEu+hu6ylV82/Oi8BajEuVGuVTmaVBB1VzLFY+DGdCr?= =?us-ascii?Q?zyPfShu+4BAgTtW924uOr81vnlR6UjjnPX6WjCxdlh7+ZWSPDzXqwZhTdGED?=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6FZpCCMIrlQK?= =?us-ascii?Q?gePrWhfoAD1ZiajvKqBQ+GlXNCmks7kpGQFha/eLD3pdADfMXruZdYS6BwL9?= =?us-ascii?Q?yDBltW4rIAPSV8jqDArvhMv5RLOYS8WbImH5XGVVksNg4ChCQkHILcvXeA5Y?= =?us-ascii?Q?CUXe/yPZv8gWpZOpRWbGnil5U2cz60OLzKOKjQ+LDWKFQWotCuT9OQCU/RtQ?= =?us-ascii?Q?ew31LE/8CSFHTVTFnTf4fGjZneyhym/Jn8uB35tAxKPzC8MT4bLi1ktrH3uw?= =?us-ascii?Q?1Q=3D=3D?= MIME-Version: 1.0 X-OriginatorOrg: Dell.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SA1PR19MB5168.namprd19.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e2ec09ae-4857-4848-2622-08d9d07c9fe7 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Jan 2022 18:53:12.6102 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 945c199a-83a2-4e80-9f8c-5a91be5752dd X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 0UtyGlvQDIXZQfX767i70CPCkYtIr2yruxYjNl0ofAL3yvPD35hLIRxrKiJL/nEE6BBu+Ju/7gGUqPlwh60TmQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR19MB5087 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.425,18.0.790 definitions=2022-01-05_05:2022-01-04,2022-01-05 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 mlxscore=0 lowpriorityscore=0 suspectscore=0 phishscore=0 malwarescore=0 priorityscore=1501 mlxlogscore=916 adultscore=0 impostorscore=0 bulkscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2201050121 X-Proofpoint-ORIG-GUID: GjYaITCiKZnj1WQ46O1F4pL3gMtLDlxH X-Proofpoint-GUID: GjYaITCiKZnj1WQ46O1F4pL3gMtLDlxH X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 phishscore=0 bulkscore=0 malwarescore=0 spamscore=0 mlxlogscore=999 suspectscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2201050121 Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_SA1PR19MB516828F7611B1403EC2D8B77E74B9SA1PR19MB5168namp_" --_000_SA1PR19MB516828F7611B1403EC2D8B77E74B9SA1PR19MB5168namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Read Disk does a modification of ExtMbrStartingLba with the code MultU64x3= 2 (ExtMbrStartingLba, BlockSize) Error detection to see if ExtMbrStartingLBA has a value of 0. This is invalid as LBA 0 =3D MBR. After modification, th= e next time ExtMbrStartingLba is in this function if ExtMbrStartingLba is se= t to 0 in the MBR it never passes the while/do evaluation It is multiplied b= y 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; + } continue; } -- 2.32.0.windows.1 Craig Edwards Software Engineer Dell | GDP | PSE | COMMS | BIOS Craig_Edwards@Dell.com Internal Use - Confidential --_000_SA1PR19MB516828F7611B1403EC2D8B77E74B9SA1PR19MB5168namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
Read Disk does a modification of ExtMbrStartingLba with the code Mult= U64x32
(ExtMbrStartingLba, BlockSize) Error detection to see if ExtMbrStarti= ngLBA
has a value of 0. This is invalid as LBA 0 =3D MBR. After modificatio= n, 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 multipl= ied 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 ha= s
developed a hotfix patch that will be released in 2022
 
Cc: = Lim= ing Gao <gaoliming@byosoft.com.cn>
Cc: = Jia= n J Wang <jian.j.wang@intel.com>
Cc: = Hao A Wu <= hao.a.wu@intel.com>
Cc: = Ray= Ni <ray.ni@intel.com>
Cc: = Zhi= chao Gao <zhichao.gao@intel.com>
&nbs= p;
Sign= ed-off-by: Craig Edwards <craig.edwards@dell.com>
&nbs= p;
Date:      Wed Jan 5 12:27:46 2022 -0600
 
On branch graceful_handle_mbr_hang_edit1
Changes to be committed:
        modified:   MdeMo= dulePkg/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/MdeModul= ePkg/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 (ExtMbrStar= tingLba =3D=3D 0) {
+            br= eak;
+          }
         continue;
       }
 
--
2.32.0.windows.1
&nbs= p;
&nbs= p;
&nbs= p;
&nbs= p;
&nbs= p;
Craig Edwards
Software Engineer
Dell | GDP | PSE | COMMS | BIOS
&nbs= p;
&nbs= p;
&nbs= p;

Internal Use - Confidential
&nbs= p;
--_000_SA1PR19MB516828F7611B1403EC2D8B77E74B9SA1PR19MB5168namp_--