From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=mZ+B24ck; spf=pass (domain: arm.com, ip: 40.107.7.49, mailfrom: krzysztof.koch@arm.com) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (EUR04-HE1-obe.outbound.protection.outlook.com [40.107.7.49]) by groups.io with SMTP; Thu, 15 Aug 2019 06:11:54 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PTlIEPVRlSJQ83SrGgCJEc6F/muKRPVr3Hq2SlBc/d0=; b=mZ+B24ckvkVsTOvjA6Ft4NnI7i35YIbRyvp9Q7j4/cjIzUacftt3l3c5xpkiG92RDHhULGIOWYGIQW9AkTrlsWkr8tF41XjaacTzVf3n5ucLlzWi5cI8TMob8t4kkF9Fg6k/UzzzcBz24eieYUcmgVM+NO4q3xAJ7CgRyKDLWyo= Received: from DB7PR08CA0031.eurprd08.prod.outlook.com (2603:10a6:5:16::44) by DB6PR0802MB2599.eurprd08.prod.outlook.com (2603:10a6:4:a2::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2157.20; Thu, 15 Aug 2019 13:11:50 +0000 Received: from AM5EUR03FT053.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e08::207) by DB7PR08CA0031.outlook.office365.com (2603:10a6:5:16::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2157.18 via Frontend Transport; Thu, 15 Aug 2019 13:11:50 +0000 Authentication-Results: spf=temperror (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; edk2.groups.io; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;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 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT053.mail.protection.outlook.com (10.152.16.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2178.16 via Frontend Transport; Thu, 15 Aug 2019 13:11:48 +0000 Received: ("Tessian outbound 1e6e633a5b56:v26"); Thu, 15 Aug 2019 13:11:46 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: b5bd2c6f38513bbc X-CR-MTA-TID: 64aa7808 Received: from 691c85c9e73e.1 (cr-mta-lb-1.cr-mta-net [104.47.14.50]) by 64aa7808-outbound-1.mta.getcheckrecipient.com id A6A84E9E-EFFB-44E1-A78B-98A3B455B874.1; Thu, 15 Aug 2019 13:11:40 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04lp2050.outbound.protection.outlook.com [104.47.14.50]) by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 691c85c9e73e.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384); Thu, 15 Aug 2019 13:11:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KPiCROoWrrYUhzsJhaYkFaz3+wQDtzQ8c7YubAmOobk/+SSSjU2OFL3k4kuXw/T5Cg0cgEl7SLaObqJ+8AYKYP5bangpQboVRugcM0ZsBs3AGVzbZXqeH6dw8XRyVT3Jo+gYaGO/yHzTPAAhgGq1k+3EODz7IrdoaWK+ImPFXNnNvg4wl9zAtA6VH2kvbuPwg9m4JYB4ynVqO4hOIhSbNCH9WMMiiwHFk0tFfEeB1EhCKPXOQ5FzgXjd6nP6iitDqQvdnkwXLZRnLrJRWWq/iFpEP2eKwvsYaEcZJjhNeQ3xvwbVPdJ2DZtv1Q+DjDYbDoyjgHByg79UvhfzjnQ4cw== 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=PTlIEPVRlSJQ83SrGgCJEc6F/muKRPVr3Hq2SlBc/d0=; b=TgxnVyqcPmdOVA3OpxtU0+iaQ+4pAtRTDw/NMPVDWlS4hQ06N7ysNu8vYLt4h5sW6lOWNuyi0yCfXC/oh6OoFGZ981CPHTXm7SK6+mNEIOM2JSGfH5VbtHZNflgJgGCqmhqfn1RK4xvQ/VVORlAeu4XID9jprxRLcouAIYnPpJHOsjP+r6eDrHUEtDNZaLt/chUXHAvDIqZp7FfbAC4Ajyukx+7wlyLtorW3UL3EQZ5mxIo5Jz8CG+eizd4tD3oaIDVbZ5Z0sz4zrtENmu2rTkqY9RMAhJjoeavwOHjJJZEK8yrAR+mIE2Kbesr2IGO0kRPcu8T2grDpLuKPYtTUxA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=temperror (sender ip is 40.67.248.234) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com; dmarc=temperror action=none header.from=arm.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PTlIEPVRlSJQ83SrGgCJEc6F/muKRPVr3Hq2SlBc/d0=; b=mZ+B24ckvkVsTOvjA6Ft4NnI7i35YIbRyvp9Q7j4/cjIzUacftt3l3c5xpkiG92RDHhULGIOWYGIQW9AkTrlsWkr8tF41XjaacTzVf3n5ucLlzWi5cI8TMob8t4kkF9Fg6k/UzzzcBz24eieYUcmgVM+NO4q3xAJ7CgRyKDLWyo= Received: from AM6PR08CA0043.eurprd08.prod.outlook.com (2603:10a6:20b:c0::31) by AM6PR08MB4949.eurprd08.prod.outlook.com (2603:10a6:20b:ee::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2178.16; Thu, 15 Aug 2019 13:11:37 +0000 Received: from DB5EUR03FT007.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e0a::202) by AM6PR08CA0043.outlook.office365.com (2603:10a6:20b:c0::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2157.18 via Frontend Transport; Thu, 15 Aug 2019 13:11:37 +0000 Authentication-Results-Original: 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 DB5EUR03FT007.mail.protection.outlook.com (10.152.20.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2178.16 via Frontend Transport; Thu, 15 Aug 2019 13:11:36 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1415.2; Thu, 15 Aug 2019 13:11:34 +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; Thu, 15 Aug 2019 13:11:33 +0000 From: "Krzysztof Koch" To: CC: , , , , , Subject: [PATCH v1 02/11] ShellPkg: acpiview: RSDP: Validate global pointer before use Date: Thu, 15 Aug 2019 14:11:12 +0100 Message-ID: <20190815131121.52644-3-krzysztof.koch@arm.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: <20190815131121.52644-1-krzysztof.koch@arm.com> References: <20190815131121.52644-1-krzysztof.koch@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;IPV:NLI;CTRY:IE;EFV:NLI;SFV:NSPM;SFS:(10009020)(4636009)(376002)(39860400002)(346002)(396003)(136003)(2980300002)(199004)(189003)(6666004)(16586007)(356004)(316002)(76176011)(54906003)(63350400001)(63370400001)(426003)(11346002)(70206006)(70586007)(446003)(186003)(7696005)(336012)(51416003)(26005)(6916009)(305945005)(8676002)(486006)(44832011)(476003)(2616005)(126002)(2351001)(50466002)(4326008)(478600001)(81156014)(81166006)(15650500001)(48376002)(5660300002)(50226002)(47776003)(2906002)(8936002)(36756003)(53416004)(53936002)(86362001)(1076003);DIR:OUT;SFP:1101;SCL:1;SRVR:AM6PR08MB4949;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: 969cdeaf-a2a7-4f8f-707b-08d72182214e X-Microsoft-Antispam-Untrusted: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328);SRVR:AM6PR08MB4949; X-MS-TrafficTypeDiagnostic: AM6PR08MB4949:|DB6PR0802MB2599: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true X-MS-Oob-TLC-OOBClassifiers: OLM:6790;OLM:6790; X-Forefront-PRVS: 01304918F3 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info-Original: C11Gn/g/A5kdyvhBbwDY/ux/eltwZyCCHwkZ1D7nkOTYDeKnFzzw8k+URHXVa3McIJX8Je5NxmRy9FUToOGSshv/wIPV7UPtA+zLBTkw/Kzf1T2PpZPOrZtbC0tW1zHjtHt2bdTK/LKzFJWv/KG4MnwSKIVfgzASnbEZHYSefClWlVehQqM4TER66SkXp7wRy7xUUvZg+UrdLKVfPjiM1/zSL18n7LvRf14HUidnjWMlxt6Ai3kQALL0z7dou39HYmhrUSAhDSRn1hBex0E3XnLoTlAmhKmvmppyPHLqyr4F7LinZdng8DBuCThjFKFc64FEeCQJNr2jUqb5spNJJk3yk/SQrDOQgC/ZVma/NgQnh3F6+QUGG2d4/Q7gden8SEVLIXpAwu8FHAfxok/dwh+c6IA4zzaMU4iaX4zUqx0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB4949 Original-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; Return-Path: Krzysztof.Koch@arm.com X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT053.eop-EUR03.prod.protection.outlook.com X-Forefront-Antispam-Report: CIP:63.35.35.123;IPV:CAL;SCL:-1;CTRY:IE;EFV:NLI;SFV:NSPM;SFS:(10009020)(4636009)(136003)(396003)(376002)(39860400002)(346002)(2980300002)(199004)(189003)(54906003)(316002)(6666004)(2616005)(7696005)(126002)(76176011)(51416003)(16586007)(478600001)(446003)(11346002)(476003)(305945005)(36906005)(50226002)(15650500001)(81156014)(5660300002)(81166006)(8936002)(36756003)(86362001)(53416004)(486006)(70206006)(63350400001)(22756006)(2906002)(63370400001)(47776003)(48376002)(2351001)(44832011)(186003)(4326008)(336012)(26826003)(76130400001)(1076003)(426003)(8676002)(70586007)(50466002)(6916009)(26005);DIR:OUT;SFP:1101;SCL:1;SRVR:DB6PR0802MB2599;H:64aa7808-outbound-1.mta.getcheckrecipient.com;FPR:;SPF:TempError;LANG:en;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;A:1;MX:1; X-MS-Office365-Filtering-Correlation-Id-Prvs: 7724d3c1-f952-4936-769a-08d721821a05 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(710020)(711020)(4605104)(1401327)(2017052603328);SRVR:DB6PR0802MB2599; NoDisclaimer: True X-Forefront-PRVS: 01304918F3 X-Microsoft-Antispam-Message-Info: dSqUvj6QbJnEqLXRfmVJOO2pZWrH42JkGSj9i6iaJPJI4xyQAo26cTSRwvnSXbm4mTY8u4Oxz/T8FrZKD71yJoI5HQEPeRmhsThSdwrZ1/6dlsgZLL8d3Hvg02RpK8TqIBnS2ZGwHba3qR1qbbUAGThn3+6Yv/CPmBhhhE8FEKX4DFIuCvmpl9FmrVgaHTNBM+GGvkD8TVp3dmsOGR72DR9kJu+ejK82pPTzVHuCCfdawPPuI7v5LIxJeWx2CSAq71JmzIl09zyG1W2v/zTKOUmf3e/3SE3Zr6mxVJa4rf+MToCHX3aTKUb6lukuLOnDRjHOIT0vlcsHtsQttvBMJ3COVjiZ1XKj6yT9THyFiAdOchLpDuSN5bK9dzAyYquzJHNPo4JeMu2rVBGzCbW8pw6NEdkozvnCuoIvISv/m/U= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Aug 2019 13:11:48.3707 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 969cdeaf-a2a7-4f8f-707b-08d72182214e X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0802MB2599 Content-Type: text/plain Check if XsdtAddress pointer has been successfully updated before it is used for further table parsing. Signed-off-by: Krzysztof Koch --- Notes: v1: - Test against NULL pointers [Krzysztof] ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rsdp/RsdpParser.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rsdp/RsdpParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rsdp/RsdpParser.c index 5a5c4b50c12e6eb0aa0efb1765df7e123f614da3..f4a8732a7db7c437031f2a3d2f266b80eff17b4b 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rsdp/RsdpParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rsdp/RsdpParser.c @@ -138,6 +138,18 @@ ParseAcpiRsdp ( PARSER_PARAMS (RsdpParser) ); + // Check if the values used to control the parsing logic have been + // successfully read. + if (XsdtAddress == NULL) { + IncrementErrorCount (); + Print ( + L"ERROR: Insufficient table length. AcpiTableLength = %d." \ + L"RSDP parsing aborted.\n", + AcpiTableLength + ); + return; + } + // This code currently supports parsing of XSDT table only // and does not parse the RSDT table. Platforms provide the // RSDT to enable compatibility with ACPI 1.0 operating systems. -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'