From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (NAM02-SN1-obe.outbound.protection.outlook.com [40.92.5.16]) by mx.groups.io with SMTP id smtpd.web12.921.1586382383119067813 for ; Wed, 08 Apr 2020 14:46:23 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@outlook.com header.s=selector1 header.b=N2tPlUT4; spf=pass (domain: outlook.com, ip: 40.92.5.16, mailfrom: michael.kubacki@outlook.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KFsxsb2qdnU/X8QcLl4Uvn7AYph7+TkBEWbvhr9f2tC6cHe9ZJ6ztUlnZI+8r+05I5LxQxDcWpyXfAKTlavGiTPYrnAo2yZr+4Bj7O6uOG6GqeJMUOVX2vZIA3/sVZdru6e12VsNF4aGf3pTxRxbmfmDe8TsaB5hTRxX1Ysjv+/biLVucYZZf54emy6r950uHX21plewFTVRMKqmGuK2mx8F8j80S1sWV7Uy0VNfoUhu9Z1xc78OrQk83u0Q6mkxXFJpP9FZoT2wElt9muspF1+rca2RWA+Z5gzTXRoLYx+qaCFSnnt+OzLuYbZ3YtwHrjRoWeaWEjGWFB2KohS1bA== 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-SenderADCheck; bh=frqwVwYe9eYrjvTUoM2T1TOM1JYTNo+G0ZpBc/a8KZ0=; b=nvDGyGkZfLEGsEo+LwJilztGjYV1cWZFvIT3bInHW6hhG1RmXef3aQ2ZtlrhwrLfEFPGiasIZubxbn/D/KggVmsGM3Cp1zO50AJUk5XfNu0KRXyoFqSSvIxLgLEBBXpODZXaY8TcFMRPPGlNDXNiAIcED6aGuAejUw1UnHZU2q7fkAx6XFY1JkuevC9dncoL2yJm7aQY1imcZ5YZ1aPTlf9eOGxfROY+FFKvHAftpcfPXMGWSd7GIEehBuo/cVSs42osT67l7N30/RAPhbCt/dIAYdNz0KNJ056TGf9qRDxxQ1CuwsFbmeBRZPqzy9bNakMWG8+reRqNEFyzR1d9RA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=outlook.com; dmarc=pass action=none header.from=outlook.com; dkim=pass header.d=outlook.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=frqwVwYe9eYrjvTUoM2T1TOM1JYTNo+G0ZpBc/a8KZ0=; b=N2tPlUT460t7guFg7aK7N7PbLGRgUWcjp9xmrCJTMYIDKw7Ajxjt1D+ZKVumtWSdosUefILBrtpvbUj0gwg1I1Lhw5pfjkOBmBZMfmUtvX4qNmUYgmppPy++HFnlnQCfWTIF6czM6kT2MD/yyikSkhJjMO/1Ny6cxz8i2yFiwVZj37YWv80KZXdlU2iENGd2M7+aXDJaOkPipeU3erVPUc6G1RjdGjazGUTBuFe3IZElG6u05IyiRmOm4sFnnSuBZm3ZLwidh1Tv7a+bMvBIxcPQlCXdApB64E2GqhSvBRj4LoftPRFzzEdsvLdLbXwYlylIeOJdE0im1p42p/KlJw== Received: from BL2NAM02FT006.eop-nam02.prod.protection.outlook.com (10.152.76.59) by BL2NAM02HT240.eop-nam02.prod.protection.outlook.com (10.152.76.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2900.15; Wed, 8 Apr 2020 21:46:22 +0000 Received: from MWHPR07MB3440.namprd07.prod.outlook.com (2a01:111:e400:7e46::51) by BL2NAM02FT006.mail.protection.outlook.com (2a01:111:e400:7e46::239) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2900.15 via Frontend Transport; Wed, 8 Apr 2020 21:46:21 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:0AD62FB0F8B62F2F67F78F99C2F5B776E3FB6934844AC1FD29CD6DEB622A1ACC;UpperCasedChecksum:C78EB974B9076CCEFEE0085DF918328A4C38B10F72D4EDA2B99F42A8A220290E;SizeAsReceived:7723;Count:47 Received: from MWHPR07MB3440.namprd07.prod.outlook.com ([fe80::f5a7:e51b:e22a:959f]) by MWHPR07MB3440.namprd07.prod.outlook.com ([fe80::f5a7:e51b:e22a:959f%7]) with mapi id 15.20.2878.022; Wed, 8 Apr 2020 21:46:21 +0000 From: "Michael Kubacki" To: devel@edk2.groups.io Cc: Dandan Bi , Hao A Wu , Jian J Wang , Kun Qin , Liming Gao Subject: [PATCH v1 1/1] MdeModulePkg/ReportStatusCodeRouter: Take HeaderSize into Consideration Date: Wed, 8 Apr 2020 14:45:28 -0700 Message-ID: X-Mailer: git-send-email 2.16.3.windows.1 X-ClientProxiedBy: CO2PR18CA0052.namprd18.prod.outlook.com (2603:10b6:104:2::20) To MWHPR07MB3440.namprd07.prod.outlook.com (2603:10b6:301:69::28) Return-Path: michael.kubacki@outlook.com X-Microsoft-Original-Message-ID: <20200408214528.55272-1-michael.kubacki@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (2001:4898:80e8:b:9479:4eba:b219:79f8) by CO2PR18CA0052.namprd18.prod.outlook.com (2603:10b6:104:2::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.16 via Frontend Transport; Wed, 8 Apr 2020 21:46:20 +0000 X-Mailer: git-send-email 2.16.3.windows.1 X-Microsoft-Original-Message-ID: <20200408214528.55272-1-michael.kubacki@outlook.com> X-TMN: [PzeQGiwvAJgEY7NjfunWOURzwo4Yo9G3hUEknA9NbpocCVo9TfZfkAhv5yVXIDLK] X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 47 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: dd94b772-ea96-469a-0121-08d7dc0646af X-MS-TrafficTypeDiagnostic: BL2NAM02HT240: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: r/DtXSAs2E/0XqppbWvNVnU79OckFTq9sJuZwUwXBkL207qs50MdxESiNzTpV1nF5Tb4OkEDmN+e1bGrcSRqA52GdNE1xgCWQmIjlHAFVL9ouAvYQLRoQbFRkb6AhAfET2svZ8E3km5P4AVo3+43OgnAAdCwetsqD72xCyUpb7XDNvPBAdMmO7IRjQyQ2qeVJgfnXoXxF6AhjuG9/SA0qLefs8uSxifnM1/YfiO84/s= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:0;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR07MB3440.namprd07.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:;DIR:OUT;SFP:1901; X-MS-Exchange-AntiSpam-MessageData: gmE+o9g1CMB3U0bYJn9splpR3jFRks18WqhzghJWDB20ZtNyNf71UOQSPanxF+KDS/fClahCXogLknNm0WuuLlF8I7JuPX04OBO016LnBhBvGe4FlZ3NM+inNOqCDo3DrssijYDE6mjdqG3ppQhw2WYSJbm6g4F2aiGgrpA338eq1JgIusQDJZh4Hb+0sbFTYGcPRiYunFbPBBmw/gvz9g== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: dd94b772-ea96-469a-0121-08d7dc0646af X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Apr 2020 21:46:21.8272 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2NAM02HT240 Content-Type: text/plain From: Michael Kubacki REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2669 Updates ReportDispatcher() to take the size in the HeaderSize field in a EFI_STATUS_CODE_DATA element into account when walking the data buffer. This size will cause the header size to differ from the compiled sizeof header. Cc: Dandan Bi Cc: Hao A Wu Cc: Jian J Wang Cc: Kun Qin Cc: Liming Gao Signed-off-by: Michael Kubacki --- MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusCodeRouterRuntimeDxe.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusCodeRouterRuntimeDxe.c b/MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusCodeRouterRuntimeDxe.c index 6ca7e180ebb3..920191cb3a8c 100644 --- a/MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusCodeRouterRuntimeDxe.c +++ b/MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusCodeRouterRuntimeDxe.c @@ -3,6 +3,7 @@ and Status Code Runtime Protocol. Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
+ Copyright (c) Microsoft Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -64,7 +65,7 @@ RscHandlerNotification ( &RscData->Data ); - Address += (sizeof (RSC_DATA_ENTRY) + RscData->Data.Size); + Address += (OFFSET_OF (RSC_DATA_ENTRY, Data) + RscData->Data.HeaderSize + RscData->Data.Size); Address = ALIGN_VARIABLE (Address); } @@ -271,7 +272,7 @@ ReportDispatcher ( RscData = (RSC_DATA_ENTRY *) (UINTN) CallbackEntry->EndPointer; CallbackEntry->EndPointer += sizeof (RSC_DATA_ENTRY); if (Data != NULL) { - CallbackEntry->EndPointer += Data->Size; + CallbackEntry->EndPointer += (Data->Size + Data->HeaderSize - sizeof (EFI_STATUS_CODE_DATA)); } // -- 2.16.3.windows.1