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=gicf1Hfb; spf=pass (domain: arm.com, ip: 40.107.5.88, mailfrom: krzysztof.koch@arm.com) Received: from EUR03-VE1-obe.outbound.protection.outlook.com (EUR03-VE1-obe.outbound.protection.outlook.com [40.107.5.88]) by groups.io with SMTP; Thu, 01 Aug 2019 01:44:47 -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=P4LyEwFnWqukEQutnkgZpf3KCJJw0wpG/eVI2tdiFgU=; b=gicf1HfbOLBIA72wwtAlDBhgqnADah6zPLNdMCIJ8H4iTLxucJgOJGrfM3ja8dpu5Vg0jbnPBnHnDM1Cgu6LEciAIKwHeSDZcMfpsQpYouLTs4rTAatpTYydf9J6CIcMIyiW9UAjOtAWuYIl1cMKJ829GREi+UwcJsJKySdWWkU= Received: from AM6PR08CA0032.eurprd08.prod.outlook.com (2603:10a6:20b:c0::20) by VI1PR0801MB1853.eurprd08.prod.outlook.com (2603:10a6:800:5a::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2136.16; Thu, 1 Aug 2019 08:44:43 +0000 Received: from VE1EUR03FT029.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e09::206) by AM6PR08CA0032.outlook.office365.com (2603:10a6:20b:c0::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2136.14 via Frontend Transport; Thu, 1 Aug 2019 08:44:42 +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 VE1EUR03FT029.mail.protection.outlook.com (10.152.18.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2052.18 via Frontend Transport; Thu, 1 Aug 2019 08:44:40 +0000 Received: ("Tessian outbound 220137ab7b0b:v26"); Thu, 01 Aug 2019 08:44:40 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: c1f440478e62f6cf X-CR-MTA-TID: 64aa7808 Received: from fe214f2c49a2.1 (ip-172-16-0-2.eu-west-1.compute.internal [104.47.5.57]) by 64aa7808-outbound-1.mta.getcheckrecipient.com id 726ADB9D-36A9-4B1F-8819-73A7B22B451E.1; Thu, 01 Aug 2019 08:44:35 +0000 Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-he1eur02lp2057.outbound.protection.outlook.com [104.47.5.57]) by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id fe214f2c49a2.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384); Thu, 01 Aug 2019 08:44:35 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cc8/ApcrbCzh2M7W/JC5FjlDwtv6aShTIiONPwX9A6E3w/JGi6f+a6R5PYvUWFUYjLomR2mfmEn8dGksWC9IK9qEEA2JPmWO7jQbfcQqKFRps4dNlkyJ/MpiJccwWyxemBOc2kCmHjaUDUH8pKucQ9oIC9ZrsCvVyjf4fYJmzgMuiR/Hb4QTrnYj+cfimS831a4WDcyCDy88datKqt5K0kOOMWKLl8tIzsyytq8iSiEsJvOBAOuQY5VqMnTTsMGyJ/cZjYf5puh0zHb+LOr0MezV/eHGmYw30ndLfXmD8n0X6W6EBHLGfjpMVLsN2h0zJSxlClspsNXSnk//dw8FVw== 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=P4LyEwFnWqukEQutnkgZpf3KCJJw0wpG/eVI2tdiFgU=; b=Eb0N/5Mzr09tZxZure6Mg5EzXduxjZc/nxECEcPnkCOCXLaC0M2yAPOafpwwb69iWR8R9CF6O3P3HxeBOh0rZk6Ra6WwaF7yAdJmJEju5ViOTIt7FaxbNwtQuI5oXFFiZWHL5BJO8L5DDKhCrAhuL/XgO+gZFEVWNJaxLDmCz8Txdb6MxbOPkEKGe9uYJO0E6yJ+pa6gy6mG4+76ob0nZeMKhfXB89XszsLpsRvBh2MD3l4qpM5XoRTr/OY5z1EOs+ZEsb4QC4oVuGzdeKapKEulBnXd+VgaasHuJaiqEiOrUeSgdBV43Z/e7ry/DbkE9whWa0KoO35uENZbQz+b7g== 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=P4LyEwFnWqukEQutnkgZpf3KCJJw0wpG/eVI2tdiFgU=; b=gicf1HfbOLBIA72wwtAlDBhgqnADah6zPLNdMCIJ8H4iTLxucJgOJGrfM3ja8dpu5Vg0jbnPBnHnDM1Cgu6LEciAIKwHeSDZcMfpsQpYouLTs4rTAatpTYydf9J6CIcMIyiW9UAjOtAWuYIl1cMKJ829GREi+UwcJsJKySdWWkU= Received: from VI1PR08CA0160.eurprd08.prod.outlook.com (2603:10a6:800:d1::14) by AM0PR08MB4947.eurprd08.prod.outlook.com (2603:10a6:208:158::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2136.13; Thu, 1 Aug 2019 08:44:32 +0000 Received: from VE1EUR03FT036.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e09::201) by VI1PR08CA0160.outlook.office365.com (2603:10a6:800:d1::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2136.12 via Frontend Transport; Thu, 1 Aug 2019 08:44:32 +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 VE1EUR03FT036.mail.protection.outlook.com (10.152.19.204) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.2052.18 via Frontend Transport; Thu, 1 Aug 2019 08:44:29 +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; Thu, 1 Aug 2019 08:44:15 +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, 1 Aug 2019 08:44:14 +0000 From: "Krzysztof Koch" To: CC: , , , , , Subject: [PATCH v1 0/6] Prevent buffer overruns in acpiview table parsers Date: Thu, 1 Aug 2019 09:44:01 +0100 Message-ID: <20190801084407.48712-1-krzysztof.koch@arm.com> X-Mailer: git-send-email 2.16.2.windows.1 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)(979002)(4636009)(136003)(346002)(396003)(376002)(39860400002)(2980300002)(199004)(189003)(186003)(1076003)(966005)(486006)(336012)(6916009)(4326008)(426003)(2616005)(63370400001)(126002)(26005)(5660300002)(53936002)(476003)(63350400001)(6306002)(478600001)(44832011)(53416004)(2351001)(47776003)(305945005)(68736007)(356004)(54906003)(48376002)(50466002)(16586007)(316002)(6666004)(7696005)(70586007)(70206006)(8676002)(81156014)(81166006)(86362001)(36756003)(50226002)(8936002)(2906002)(14444005)(51416003)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1101;SCL:1;SRVR:AM0PR08MB4947;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: 1fbc922e-c910-4fe4-d7fd-08d7165c7e78 X-Microsoft-Antispam-Untrusted: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(5600148)(711020)(4605104)(1401327)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328);SRVR:AM0PR08MB4947; X-MS-TrafficTypeDiagnostic: AM0PR08MB4947:|VI1PR0801MB1853: X-MS-Exchange-PUrlCount: 1 X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true X-MS-Oob-TLC-OOBClassifiers: OLM:6790;OLM:6790; X-Forefront-PRVS: 01165471DB X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info-Original: CGz/vzVwjqrPsupCYBU/oqXY2q/a84LX6YrHZDQYJs2VlDUo+Yb1aTqA57aRGbuLnRS+wmwAb8crGM5eWOMitHfkReTHY21A8mEF+bTRzP1w2ShHSH/4c7UCXgZd68aaGELKgh54Q8bf5+hP3ZDw3H9ZunkYK46iPYuWYurrC0FPJs+OhwUpVckbuAi7uvKACK8P62bS6vVMeHr+QKCaCEXHBWmZTQrewiLPYBVYIHJc2VA5chEIqJTktTG6MWf/jsRK9ocZWvwapO5vUBNPtsW2s1yctvXUrs+OCvkcbLfGOnU3Ixe6uXNsVAGJzeaW2AkM007Is8PX9e8e808jw/FsiOO6Lw7pIx3BOQfSYnSFCH4C/fbtWfDW2ioWxfQ8uG6OTgnn4lwTMOqYp03TSBVQp6O7BUqVu1HUuHeg96U= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB4947 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: VE1EUR03FT029.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)(979002)(4636009)(346002)(39860400002)(376002)(396003)(136003)(2980300002)(189003)(199004)(50226002)(47776003)(14444005)(48376002)(70206006)(50466002)(70586007)(2616005)(305945005)(186003)(126002)(476003)(478600001)(86362001)(966005)(26826003)(2351001)(44832011)(486006)(53416004)(2906002)(81166006)(81156014)(6916009)(22756006)(4326008)(426003)(336012)(8676002)(8936002)(6306002)(316002)(26005)(16586007)(5660300002)(36906005)(36756003)(6666004)(51416003)(7696005)(1076003)(63350400001)(63370400001)(54906003)(76130400001)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR0801MB1853;H:64aa7808-outbound-1.mta.getcheckrecipient.com;FPR:;SPF:TempError;LANG:en;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;MX:1;A:1; X-MS-Office365-Filtering-Correlation-Id-Prvs: 7c6db4df-94a8-4d76-805b-08d7165c7834 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(710020)(711020)(4605104)(1401327)(2017052603328);SRVR:VI1PR0801MB1853; NoDisclaimer: True X-Forefront-PRVS: 01165471DB X-Microsoft-Antispam-Message-Info: xb5FwCV5iAnVA8WheH/W7IKAZoszoBERnkfJT0GZJWpQTKTCQHAd3pC2YLgjl3KXGselO4MoeWAEgwRxartPjxF2QBr2nTOqcwOSj3lYJhGvhp/2HmfQkYKJfs89Filpt2RXxNvCXqz7MPk0UdyrRB78J+k1NFTHB30E3AqH3wKuQER2OWyi+pvXT3593/F3PfGoF4Pk9y7jggauON6g1qWNKclo7877A1mnSENkyVafQSbmwV96KKRNQNiXR88BepXBoU6iVTX+2xOS2kgxFIF/VtHdQ+jDom8MlLAE6d9K+iTaKXbHg8KONlIewEp1qP0pgzzT9FEd4xRt5m08TQyfi9HsK02FOnSGhUbYYzMr5QaUhw70jwzCgpxkc5McRI1d7nU+5yuRllppYZ4uacTQL4GWntX9Yq+lbv1Zv1Y= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2019 08:44:40.9274 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1fbc922e-c910-4fe4-d7fd-08d7165c7e78 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: VI1PR0801MB1853 Content-Type: text/plain This patch series makes minor modifications to a number of ACPI table parsers with a goal to minimize the risk of buffer overruns. Some of these overruns can be caused by invalid ACPI table data. Changes can be seet at: https://github.com/KrzysztofKoch1/edk2/tree/612_prevent_buffer_overruns_v1 Krzysztof Koch (6): ShellPkg: acpiview: DBG2: Prevent buffer overruns ShellPkg: acpiview: GTDT: Prevent buffer overruns ShellPkg: acpiview: IORT: Prevent buffer overruns ShellPkg: acpiview: MADT: Prevent buffer overruns ShellPkg: acpiview: PPTT: Prevent buffer overruns ShellPkg: acpiview: SRAT: Prevent buffer overruns ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Dbg2/Dbg2Parser.c | 141 ++++++++++----- ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Gtdt/GtdtParser.c | 147 +++++++-------- ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c | 191 +++++++++++--------- ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/MadtParser.c | 2 +- ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pptt/PpttParser.c | 38 ++-- ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParser.c | 14 +- 6 files changed, 314 insertions(+), 219 deletions(-) -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'