From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: None (no SPF record) identity=mailfrom; client-ip=2a00:1450:4010:c07::229; helo=mail-lf0-x229.google.com; envelope-from=mw@semihalf.com; receiver=edk2-devel@lists.01.org Received: from mail-lf0-x229.google.com (mail-lf0-x229.google.com [IPv6:2a00:1450:4010:c07::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id E7D7D20977882 for ; Fri, 1 Jun 2018 06:58:29 -0700 (PDT) Received: by mail-lf0-x229.google.com with SMTP id v135-v6so14993585lfa.9 for ; Fri, 01 Jun 2018 06:58:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=WhgtGzxXt9VS2jH5bhToVsp8JFD8vTEVxMQZYZemClQ=; b=Ne/b3aazJqvF0LMbMotdQnFh2jBkF3PmE9uRIyQoaWGkE5uHgg5348Vhi/SmOGMmTX QNY0d3s7ix0qEdQFDYLAZfjHnVmq1Q/VGcVPnOX67OhUdNeDs1PFAoy4IsajMgGziXx7 yUCOxsUfZt0FCpNrMFOfTO5iEhshbN9CzScSQQv1aRNnbvsX7J8taM/It7rl7xUBo8Tl hyakOaFvE1Od+wpwx9nIBG9AVgEXEROV6feiecHUuJGC4nfnzx3CNECouLp/hCBdDM7T vxtVSf1WorFd3S08VXg/HnBb5op+ABIJCBOrXo5z32eOyxA8e6vxdFMd7K0V4ylNcTBq gv0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=WhgtGzxXt9VS2jH5bhToVsp8JFD8vTEVxMQZYZemClQ=; b=MUd04iKeB9p2h6nEGzhmTooGOABWb3yWENu6PdIoJoteKJGIalUNmFfWQ8gjc+hDKX 8cwSfyyO8ILTBa1M6tiiYmAn0XGZv/nnaMGlT2OeqJXce6av/w/b1Fg3a7ppUnyvlcAC ONQkZ93txx9Hyiv7YX7r68hf/zZtyC4YbroELA6gChOe0Zs4Flc1lWYdfF5mwlvY1hbt 9MEn0w/zIWv3U+aE3LhXTmWL5ORAZiVKbkfvpYqEn73EwVvkd4TMEDKDrMr1y7EWgasU Em+VEPA/XgXEtEaMfId/CEyMnSWQUvUzvdxjJTzeLlES6gCees+CzldcFcCxPZSfHYDd dwMw== X-Gm-Message-State: ALKqPweRKVw2nMxCtLHCBV32jq1f/LoavL1+5/LjuHJGoNX4Kh/J6NE6 7f8zN+SMA+I0EwJmnt+sVW7G0uwTlww= X-Google-Smtp-Source: ADUXVKLsYf+UcXC3ZeI3IRxnw0XsWcZvRU0od8utfwFeqahe/L+j68GTFuxb3orwQSpkTo43rYbWzA== X-Received: by 2002:a2e:8541:: with SMTP id u1-v6mr8123694ljj.10.1527861507481; Fri, 01 Jun 2018 06:58:27 -0700 (PDT) Received: from gilgamesh.semihalf.com (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id t126-v6sm786590lff.7.2018.06.01.06.58.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 01 Jun 2018 06:58:26 -0700 (PDT) From: Marcin Wojtas To: edk2-devel@lists.01.org Cc: feng.tian@intel.com, michael.d.kinney@intel.com, liming.gao@intel.com, leif.lindholm@linaro.org, ard.biesheuvel@linaro.org, jsd@semihalf.com, Marcin Wojtas Date: Fri, 1 Jun 2018 15:58:13 +0200 Message-Id: <1527861493-17332-1-git-send-email-mw@semihalf.com> X-Mailer: git-send-email 2.7.4 Subject: [PATCH] MdeModulePkg PeiCore: Check error status when processing boot FV X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Jun 2018 13:58:30 -0000 Until now the possible errors returned from processing boot firmware volume were not checked, which could cause misbehavior in further booting stages. Add relevant assert. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Marcin Wojtas Signed-off-by: Jan Dabros --- MdeModulePkg/Core/Pei/FwVol/FwVol.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/MdeModulePkg/Core/Pei/FwVol/FwVol.c b/MdeModulePkg/Core/Pei/FwVol/FwVol.c index 8009546..4150b33 100644 --- a/MdeModulePkg/Core/Pei/FwVol/FwVol.c +++ b/MdeModulePkg/Core/Pei/FwVol/FwVol.c @@ -495,12 +495,13 @@ PeiInitializeFv ( // // Get handle of BFV // - FvPpi->ProcessVolume ( - FvPpi, - SecCoreData->BootFirmwareVolumeBase, - (UINTN)BfvHeader->FvLength, - &FvHandle - ); + Status = FvPpi->ProcessVolume ( + FvPpi, + SecCoreData->BootFirmwareVolumeBase, + (UINTN)BfvHeader->FvLength, + &FvHandle + ); + ASSERT_EFI_ERROR (Status); // // Update internal PEI_CORE_FV array. -- 2.7.4