From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector1-arm-com header.b=DXeH107z; spf=pass (domain: arm.com, ip: 40.107.0.58, mailfrom: krzysztof.koch@arm.com) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (EUR02-AM5-obe.outbound.protection.outlook.com [40.107.0.58]) by groups.io with SMTP; Wed, 08 May 2019 07:05:31 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QPG+kZeuOFSS1nq0wBhFmIW91W5ihOJzWHYfNvire5U=; b=DXeH107zIBoh3GHqBBb65yVdOnFiPu4QVVYR2X9Dy1fiXmT3lbIDhDllRA4TRwsHw2z1BtvtavMZlEelOubnNm3MOP06iAyEJ3d214x8flVd23ekSqlbJjIOHCsDd7yzDeYWxfn9n6/6ZbXiNNqQOsEd+NuaEBRkbZ/kGjBwWnE= Received: from AM4PR08CA0071.eurprd08.prod.outlook.com (2603:10a6:205:2::42) by DBBPR08MB4460.eurprd08.prod.outlook.com (2603:10a6:10:ce::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1856.11; Wed, 8 May 2019 14:05:27 +0000 Received: from AM5EUR03FT004.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e08::202) by AM4PR08CA0071.outlook.office365.com (2603:10a6:205:2::42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1856.11 via Frontend Transport; Wed, 8 May 2019 14:05:27 +0000 Authentication-Results: spf=temperror (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=temperror action=none header.from=arm.com; Received-SPF: TempError (protection.outlook.com: error in processing during lookup of arm.com: DNS Timeout) Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT004.mail.protection.outlook.com (10.152.16.163) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.1856.11 via Frontend Transport; Wed, 8 May 2019 14:05:25 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1415.2; Wed, 8 May 2019 14:05:09 +0000 Received: from E119924.Arm.com (10.1.199.124) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.1415.2 via Frontend Transport; Wed, 8 May 2019 14:05:09 +0000 From: "Krzysztof Koch" To: CC: , , , , , , , Subject: [PATCH v1 1/1] DynamicTablesPkg: Add frame number validation to GTDT generator Date: Wed, 8 May 2019 15:05:03 +0100 Message-ID: <20190508140503.51808-1-krzysztof.koch@arm.com> X-Mailer: git-send-email 2.16.2.windows.1 Return-Path: Krzysztof.Koch@arm.com MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:40.67.248.234;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(346002)(39860400002)(376002)(396003)(136003)(2980300002)(40434004)(199004)(189003)(48376002)(50466002)(316002)(6916009)(54906003)(2616005)(70206006)(426003)(63350400001)(63370400001)(126002)(6306002)(336012)(476003)(44832011)(486006)(36756003)(2906002)(50226002)(14444005)(5024004)(77096007)(26005)(186003)(53936002)(4326008)(68736007)(86362001)(305945005)(1076003)(2351001)(8676002)(6666004)(356004)(70586007)(7696005)(51416003)(53416004)(5660300002)(81156014)(8936002)(8746002)(81166006)(966005)(47776003)(72206003)(478600001);DIR:OUT;SFP:1101;SCL:1;SRVR:DBBPR08MB4460;H:nebula.arm.com;FPR:;SPF:TempError;LANG:en;PTR:InfoDomainNonexistent;A:1;MX:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9191e5bc-dda7-4596-722f-08d6d3be37fe X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(2017052603328);SRVR:DBBPR08MB4460; X-MS-TrafficTypeDiagnostic: DBBPR08MB4460: X-MS-Exchange-PUrlCount: 1 X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-Forefront-PRVS: 0031A0FFAF X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: TiUJlBwRzXJm4XxxKY+jmhLa23lmld2GT5dJy3L4Bt/ny7+XtbwnyWpCR5Xf8pd0SdIv3gduHlWTT7AZc3aR/bAjXOP7HHj938ukwUPLaD4MxQ0pMWsr94Fm8VfhmmpU3VomQmqgA/aR1FO1Y8kcnVPUabJI5kF1sGjemXf5mgwYpGGx8H7CGcIVNzmU4CfJzLopLtSJXbdKP0mFNU0ZI1FsN3Eryvt7af1QgkJiE4+016zAx+PIC3htCiT7fJ5hYY4xmaYZn4tt+DTAGsnlO3G/Ja4qycCskKdSKMPu92eVFzJCNB1j0KobnVQX8ZPyTQS6b0yxtiE9fjP1/2K8lNok7ORSJZ6VFOEQxT21mpDBijvO1/3N2ThJhV9Rc3oYzO6g+TmgqpAqoQccxeFxNcZdtlTPNg+Gz52kCTiqaXc= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 May 2019 14:05:25.5422 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9191e5bc-dda7-4596-722f-08d6d3be37fe X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[40.67.248.234];Helo=[nebula.arm.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB4460 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Added code to check if the Generic Timer Block Structure's frame number provided by the platform repository is within the allowed range (0-7). References: - ACPI 6.2 Errata A, Table 5-122, September 2017 Signed-off-by: Krzysztof Koch --- The changes can be seen at: https://github.com/KrzysztofKoch1/edk2/tree/woa= _522_gt_frame_number_validate_v1 Notes: v1: - Add GTDT Frame Number validation [Krzysztof] DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c | 9 +++++= ++++ 1 file changed, 9 insertions(+) diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator= .c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c index 8d9ddcf9244b9f8b795edf7a53dd8a071bb121bc..543e6f442f2ab93bc7c9cd5e563= d305c0f400060 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c @@ -218,6 +218,15 @@ AddGTBlockTimerFrames ( GtBlockFrame )); + if (GTBlockTimerFrameList->FrameNumber >=3D 8) { + DEBUG (( + DEBUG_ERROR, + "ERROR: GTDT: Frame number %d is not in the range 0-7\n", + GTBlockTimerFrameList->FrameNumber + )); + return EFI_INVALID_PARAMETER; + } + GtBlockFrame->GTFrameNumber =3D GTBlockTimerFrameList->FrameNumber; GtBlockFrame->Reserved[0] =3D EFI_ACPI_RESERVED_BYTE; GtBlockFrame->Reserved[1] =3D EFI_ACPI_RESERVED_BYTE; -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease notify the sender immediately and do not disclose the contents to any= other person, use it for any purpose, or store or copy the information in = any medium. Thank you.