From: "Ard Biesheuvel" <ard.biesheuvel@arm.com>
To: devel@edk2.groups.io, gaurav.jain@nxp.com
Cc: Jiewen Yao <jiewen.yao@intel.com>,
Chao Zhang <chao.b.zhang@intel.com>,
Pankaj Bansal <pankaj.bansal@nxp.com>
Subject: Re: [edk2-devel] [PATCH 1/1] SignedCapsulePkg: Add handling of NULL returned from FMP Descriptor
Date: Fri, 8 May 2020 09:57:30 +0200 [thread overview]
Message-ID: <ea5f8b79-5ffa-de5a-3d20-aa00ac49dc9d@arm.com> (raw)
In-Reply-To: <1588755253-25016-1-git-send-email-gaurav.jain@nxp.com>
On 5/6/20 10:54 AM, Gaurav Jain via groups.io wrote:
> Firmware management protocol that does not support GetImageInfo
> return Unsupported.
The UEFI spec does not list EFI_UNSUPPORTED as a permitted return value
for EFI_FIRMWARE_MANAGEMENT_PROTOCOL.GetImageInfo()
What is the point of producing the protocol in this case?
> hence FMP Image Information Buffer is NULL.
> Freeing NULL buffer results in Exception.
>
> Added NULL check for Image Info buffer
> and skip processing FMP protocol handle,
> which does not support GetImageInfo.
>
> Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com>
> ---
> .../Universal/SystemFirmwareUpdate/SystemFirmwareUpdateDxe.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/SignedCapsulePkg/Universal/SystemFirmwareUpdate/SystemFirmwareUpdateDxe.c b/SignedCapsulePkg/Universal/SystemFirmwareUpdate/SystemFirmwareUpdateDxe.c
> index bdb70bdb32cc..b4438ac6f55a 100644
> --- a/SignedCapsulePkg/Universal/SystemFirmwareUpdate/SystemFirmwareUpdateDxe.c
> +++ b/SignedCapsulePkg/Universal/SystemFirmwareUpdate/SystemFirmwareUpdateDxe.c
> @@ -579,7 +579,7 @@ GetFmpImageDescriptors (
> &PackageVersionName // PackageVersionName
> );
> if (Status != EFI_BUFFER_TOO_SMALL) {
> - DEBUG ((DEBUG_ERROR, "SystemFirmwareUpdateDxe: Unexpected Failure. Status = %r\n", Status));
> + DEBUG ((DEBUG_INFO, "SystemFirmwareUpdateDxe: Status = %r\n", Status));
> return NULL;
> }
>
> @@ -678,6 +678,9 @@ FindMatchingFmpHandles (
> &DescriptorSize
> );
>
> + if (OriginalFmpImageInfoBuf == NULL) {
> + continue;
> + }
> //
> // Loop through the set of EFI_FIRMWARE_IMAGE_DESCRIPTORs.
> //
>
prev parent reply other threads:[~2020-05-08 7:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-06 8:54 [PATCH 1/1] SignedCapsulePkg: Add handling of NULL returned from FMP Descriptor Gaurav Jain
2020-05-08 7:57 ` Ard Biesheuvel [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ea5f8b79-5ffa-de5a-3d20-aa00ac49dc9d@arm.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox