public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Laszlo Ersek" <lersek@redhat.com>
To: devel@edk2.groups.io, weihao.cai@intel.com
Cc: "Dong, Jun Z" <jun.z.dong@intel.com>
Subject: Re: [edk2-devel] NULL Pointer Check is needed for InternalImageHandleToFvHandle of DxeServicesLib
Date: Fri, 13 Nov 2020 23:12:08 +0100	[thread overview]
Message-ID: <ca35f1bc-8c20-e60b-b96a-ba9a903940aa@redhat.com> (raw)
In-Reply-To: <DM6PR11MB3401F1B63AE765508F73A71697E60@DM6PR11MB3401.namprd11.prod.outlook.com>

On 11/13/20 10:08, Cai, Weihao wrote:
> Hi EDK2 Dev,
> 
> We met a system hang issue recently and after investigation, it was caused by invalid data returned by "InternalImageHandleToFvHandle" of DxeServicesLib.
> 
> We call GetSectionFromAnyFv-> InternalImageHandleToFvHandle to get handle.
> But InternalImageHandleToFvHandle cannot locate LoadedImageProtocol (This is expected). The returned status is "Invalid Parameter" and "LoadedImage" pointer is NULL.
> The problem is InternalImageHandleToFvHandle does not check returned status or "LoadedImage" pointer, just return "LoadedImage->DeviceHandle".
> Since "LoadedImage" pointer is NULL, "LoadedImage->DeviceHandle" is invalid handle (random data, but not NULL) which cause system hang.
> 
> I think InternalImageHandleToFvHandle should check returned status or "LoadedImage" pointer. If it is failed, just return NULL, not any random data.
> [cid:image001.jpg@01D6B9DF.9634B310]
> 
> Best Regards
> Rick Cai

Please file a new ticket at <https://bugzilla.tianocore.org/> with this
information, and please consider submitting a patch to the mailing list
for review.

Please talk to your colleagues about the expected git settings in your
edk2 clone, and the patch submission process.

Thanks
Laszlo


      reply	other threads:[~2020-11-13 22:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-13  9:08 NULL Pointer Check is needed for InternalImageHandleToFvHandle of DxeServicesLib Cai, Weihao
2020-11-13 22:12 ` Laszlo Ersek [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=ca35f1bc-8c20-e60b-b96a-ba9a903940aa@redhat.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