From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (EUR04-VI1-obe.outbound.protection.outlook.com [40.107.8.71]) by mx.groups.io with SMTP id smtpd.web12.14609.1585929958556442552 for ; Fri, 03 Apr 2020 09:05:59 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=tDNicf9T; spf=pass (domain: arm.com, ip: 40.107.8.71, mailfrom: sami.mujawar@arm.com) 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=zs3IjME6/c/cH4kM5eZQIwikMealhsiSE8hgVziRDFk=; b=tDNicf9TiCjc6hRVrCI07fPD0WJ1IehPJVFhlEIXapVni0vBt1v5xPW197uFqh1Vj0xFar7Eys21Fbb5uZEtdM+o1pGOZ6Q6RQHvTzpaNkIqzBuO19qa6xv1T2W2afKwAN8w7XcP3n3F2L/hpq9jsgxW0f1sP2M9nFkgQCR84rU= Received: from AM6P195CA0081.EURP195.PROD.OUTLOOK.COM (2603:10a6:209:86::22) by VI1PR0801MB2013.eurprd08.prod.outlook.com (2603:10a6:800:8a::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Fri, 3 Apr 2020 16:05:55 +0000 Received: from AM5EUR03FT008.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:86:cafe::19) by AM6P195CA0081.outlook.office365.com (2603:10a6:209:86::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.15 via Frontend Transport; Fri, 3 Apr 2020 16:05:55 +0000 Authentication-Results: spf=pass (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=bestguesspass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT008.mail.protection.outlook.com (10.152.16.123) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.17 via Frontend Transport; Fri, 3 Apr 2020 16:05:55 +0000 Received: ("Tessian outbound 55454527ea3b:v50"); Fri, 03 Apr 2020 16:05:54 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 60ca39e19af2ae78 X-CR-MTA-TID: 64aa7808 Received: from fd1d0a170cfa.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id E9B49989-97D3-40E3-8651-4549D667B402.1; Fri, 03 Apr 2020 16:04:43 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id fd1d0a170cfa.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 03 Apr 2020 16:04:43 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fSrsxcu2k6xr43yP82Skw3oKOVvgsNrx6j8B056cQTZDbTyUyMEiU2+Ft+8r0b6XM9OcsTre7sJ6NLt4FjDZ2IuSVHbzJSNYVERd/3PddnOC8iGVVah0Ocs+wXNpa7gCf/iJSjNB3xT2DqzhNeXGnORUBNIw0T/CSxJ3Yw/M7Inj3BpQKzGhfmRk8fjPQNrFN26V/lhomw81fsoaKxzy3DGw+eIqOpJ3R37PNldZDI+cu6pRUK5AGCvHampi/JyKU2umHKY1KrAiJSEm3Wu37XMQ4GUuMxjT8yqx1OcBPY6jUVwsa4+/u5kNLErjE03Yy9Ew+Ge/051hLvtFfWMCCg== 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=zs3IjME6/c/cH4kM5eZQIwikMealhsiSE8hgVziRDFk=; b=PXKeHz3+EkBNIs8QIgjvDBrySE5sHcDg6UjOEkrPhq78EbYLDHI/RdO4tGP3KC6BNwyT26xn/y/vtsJGfodf0ERSlrLV/2YQJ9f2BKJsJ/jp8EZUWTIpjQ793+3iBlY2BSs9QhM8FdSYESnixuMz38kkZChERxG3huJt8/7YlTcqCWsBSliyZXn68G8RfIek5OGGtDxdJWXYj9MnKEI7avSBwT59yUq/2pBvbtHT4ICgZGYM+jeE3XsLCE6YS+32DdsD7RpNhjJjp1peenFTU74OU7BkTzXRhokuwa8rXe2Db3nz37lr9/WonDyiryxXvw0EusoiD4HMDYmo+BH6PA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com; dmarc=bestguesspass 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=zs3IjME6/c/cH4kM5eZQIwikMealhsiSE8hgVziRDFk=; b=tDNicf9TiCjc6hRVrCI07fPD0WJ1IehPJVFhlEIXapVni0vBt1v5xPW197uFqh1Vj0xFar7Eys21Fbb5uZEtdM+o1pGOZ6Q6RQHvTzpaNkIqzBuO19qa6xv1T2W2afKwAN8w7XcP3n3F2L/hpq9jsgxW0f1sP2M9nFkgQCR84rU= Received: from AM0P190CA0015.EURP190.PROD.OUTLOOK.COM (2603:10a6:208:190::25) by DB6PR08MB2806.eurprd08.prod.outlook.com (2603:10a6:6:23::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Fri, 3 Apr 2020 16:04:41 +0000 Received: from VE1EUR03FT047.eop-EUR03.prod.protection.outlook.com (2603:10a6:208:190:cafe::9) by AM0P190CA0015.outlook.office365.com (2603:10a6:208:190::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.15 via Frontend Transport; Fri, 3 Apr 2020 16:04:41 +0000 Authentication-Results-Original: spf=pass (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=bestguesspass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; Received: from nebula.arm.com (40.67.248.234) by VE1EUR03FT047.mail.protection.outlook.com (10.152.19.218) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.2856.17 via Frontend Transport; Fri, 3 Apr 2020 16:04:40 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) 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; Fri, 3 Apr 2020 16:04:38 +0000 Received: from E107187.Arm.com (10.57.22.241) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.1415.2 via Frontend Transport; Fri, 3 Apr 2020 16:04:37 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , Subject: [PATCH edk2-platforms v1 1/1] Platform/ARM: Fix uninitialized variable in RunAxf Date: Fri, 3 Apr 2020 17:04:36 +0100 Message-ID: <20200403160436.37896-1-sami.mujawar@arm.com> X-Mailer: git-send-email 2.11.0.windows.3 MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFTY:;SFS:(10009020)(4636009)(376002)(396003)(136003)(346002)(39860400002)(46966005)(36756003)(186003)(82740400003)(4326008)(7696005)(5660300002)(26005)(44832011)(316002)(86362001)(426003)(54906003)(2906002)(6916009)(70206006)(8936002)(81166006)(1076003)(8676002)(47076004)(2616005)(81156014)(336012)(966005)(478600001)(70586007)(356004);DIR:OUT;SFP:1101; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 83491fac-13cb-4b6e-d0b0-08d7d7e8e3dc X-MS-TrafficTypeDiagnostic: DB6PR08MB2806:|VI1PR0801MB2013: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:8882;OLM:8882; X-Forefront-PRVS: 0362BF9FDB X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: P1MYxX/NikuNsXralFmLOGbx5JaUKBhZLAnWgnre1lBu+lIDwM35/5k3uGKEA+Yl9wbFi4OoFPGKysPg+R4yY+pqNNAdMxV1BTwRiXHexsxiMGSRYBf2+5V5k/pCVt8pevGIhIWpSU/Zuk/psvxfC9DrWwBFKtTmg9AxA1rPkDh8Y+A7GREjG72dazqoOeDAXVnFO2HMB4HK8M99t3lw3Izh1G9AOlfWsZJpUNLld3CPyZL/XdApdxZbQ++N0AgEwjV+liAPRoB+NjbK3g8TtIlsonz7oz9CMFNE/m86+sKxCSnyMgarH1mzZuCrsAOsK+xmpNfd0Ga0kPGYQvGs96FzPqtqkNS0EgBfzXFr8TkNRfXqLnn8Yob6rhMqWXl/98SaXHQdQfY3xhBZ+9APBjY4xudwQbIJHDJHzBXb+dBtD1NvAEQZqafBmZuGCiVvDt/PEZlLMivX0vb4z3nVRPI3tlykK+78VNfcnyAMQEJzUAHosqHMZCBY2Oi53KatSUyCozQCJi+SvijknB7o4oCxRlu938b/2xpVjNfWbV+MO2f21cSY/89FUlSujRumHUX4gPaXUn9DnCvuHHcNQw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR08MB2806 Original-Authentication-Results: spf=pass (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=bestguesspass action=none header.from=arm.com; Return-Path: Sami.Mujawar@arm.com X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT008.eop-EUR03.prod.protection.outlook.com X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFTY:;SFS:(10009020)(4636009)(39860400002)(396003)(346002)(376002)(136003)(46966005)(47076004)(70206006)(5660300002)(26005)(1076003)(6916009)(70586007)(966005)(478600001)(36756003)(2906002)(36906005)(336012)(54906003)(426003)(2616005)(8676002)(86362001)(4326008)(8936002)(44832011)(316002)(81156014)(186003)(82740400003)(7696005)(81166006)(26826003);DIR:OUT;SFP:1101; X-MS-Office365-Filtering-Correlation-Id-Prvs: c2ac16f8-8774-409e-3ee1-08d7d7e8b7a5 X-Forefront-PRVS: 0362BF9FDB X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +2HqSEl2ehc4UOVkueNwL2GnNtcXoWronSDghmSM7KamQmmxjKolXb21RjakBNSbLKCurk7UgHiANX8P6YjAOHy15afGY+P4EuRZLdhzkhWfCZS1qpqulI9CtWHTGddXyz7uupsAjGYen7hVwb7FCWTGM01PzMkUqbAYDoErR1nS0kEj2kYQz0hKVwHm/8KfzDrvf5xMUDa01O761rqZSngMkKNs1wUKvUovGjmZfyv5QUCNgjrsez08LHbxvZtmIY6FA2y3FFyFvvmtAwrx2HQZvk23TZBwYl8F19cc05eZ+ivsEkQZZqcoGSSoflGeeeLzgIcvtLOF8hbZRqZNBZI2pH9izcJBZDSW+q0dLTo5mjXS2mMgyhSfYOhnL/mGGlLahSsDgDwWOqCcsSst2CydQQmC+JNfRJiV9keAcbTIjutetCIuLqIaL2POxyZYgnYMjUs1pefuXgEHxfmwEKwT0lPsRpu+qKL9/RcnL8ZegUwqq6DMKaIw6aBZsOeyNHEAruDy+g8rvLAsDiDEd0v2/tDqm5oHb9NxcgEyHGGtNqDyVwPru7VY0B+kiA2pKSLdEVZchK6o+XU0Iim8sA== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Apr 2020 16:05:55.0867 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 83491fac-13cb-4b6e-d0b0-08d7d7e8e3dc 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: VI1PR0801MB2013 Content-Type: text/plain RunAxf is a shell command used for running an Axf file. The ShellDynCmdRunAxfHandler() loads an ELF file or one processed by the Flashloader. It calls the appropriate loaders to load the file in memory and to obtain the entry point address. The first argument to RunAxfPivot() is the entry point address for the image to execute. The patch https://github.com/tianocore/edk2-platforms/commit/996047695a06167a918b07b22fcd0fbd0def5da6 changes set/way cache maintenance operations to by-VA operation. This patch however introduced an error: 'variable StartElf is not initialized'. Since, StartElf is the first argument to RunAxfPivot(), which is expected to be the entry point address; RunAxfPivot() would end up branching to an invalid address resulting in a crash. Therefore, initialize StartElf to the entry point address before calling RunAxfPivot(). Signed-off-by: Sami Mujawar --- The changes can be seen at: https://github.com/samimujawar/edk2-platforms/tree/769_runaxf_fix_uninit_var_v1 Notes: V1: - Fix uninitialized variable usage in RunAxf [SAMI] Platform/ARM/Library/ArmShellCmdRunAxf/RunAxf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Platform/ARM/Library/ArmShellCmdRunAxf/RunAxf.c b/Platform/ARM/Library/ArmShellCmdRunAxf/RunAxf.c index dbad50ae866ac91d796b70ce7eed1dda4ab99957..d23739ad38d922ea16b5dc615604e9016c30fcbe 100644 --- a/Platform/ARM/Library/ArmShellCmdRunAxf/RunAxf.c +++ b/Platform/ARM/Library/ArmShellCmdRunAxf/RunAxf.c @@ -2,7 +2,7 @@ * * Shell command for launching AXF files. * -* Copyright (c) 2014, ARM Limited. All rights reserved. +* Copyright (c) 2014 - 2020, ARM Limited. All rights reserved. * * SPDX-License-Identifier: BSD-2-Clause-Patent * @@ -315,6 +315,7 @@ ShellDynCmdRunAxfHandler ( // WriteBackDataCacheRange (LoadedImage->ImageBase, LoadedImage->ImageSize); + StartElf = (ELF_ENTRYPOINT)Entrypoint; RunAxfPivot (StartElf, 0, 0, 0, 0); // We should never get here.. But if we do, spin.. -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'