From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mout02.posteo.de (mout02.posteo.de [185.67.36.66]) by mx.groups.io with SMTP id smtpd.web12.20844.1628502716522816136 for ; Mon, 09 Aug 2021 02:51:56 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@posteo.de header.s=2017 header.b=d36nr5Xw; spf=pass (domain: posteo.de, ip: 185.67.36.66, mailfrom: mhaeuser@posteo.de) Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 8BD66240101 for ; Mon, 9 Aug 2021 11:51:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1628502714; bh=PFEqNdwl3+6FxRAZfpKHpI/4JlcmjtmsEPb4ffcJniE=; h=From:To:Cc:Subject:Date:From; b=d36nr5Xw3AnjQ3k4kE14SNYFRYfwHZJFBUkXI+kwLkgIOrsyKC8bdjKalLs/49y3x AAAA7v20BKl0AivHgj5ds02mZBrC+pjZ4jF8kpUXAP+iLfMjkkX4ZM2Cl+dDm0mufO ChAjiAapE4FQG80q5O6bcWFzEn6IJjc4gvrUlZmQnpeSmyhiDuDmhaq3U3fLprkSr7 gR0T41Hc0QmrZ+3gcvwSnl8aRlQspIsRUPEoUHcveFRvVpWi+1Ydac88nbeMMSsPXg 9pbrA5XTcYxl3GXQSdfDkllzsHYvKO1vktb/2ubyuNqcOq6NL9/0VZycYzQiCajClq a4fPx+Tt3r/Lw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Gjrvt0xNYz6tmN; Mon, 9 Aug 2021 11:51:54 +0200 (CEST) From: =?UTF-8?B?TWFydmluIEjDpHVzZXI=?= To: devel@edk2.groups.io Cc: Leif Lindholm , Ard Biesheuvel , Vitaly Cheptsov Subject: [PATCH v2 7/7] ArmPkg/DefaultExceptionHandlerLib: Mandatory LoadedImage for DebugImageInfoTable Date: Mon, 9 Aug 2021 09:51:32 +0000 Message-Id: <87b3d2de23505feb627506a008f9713fda7fd65a.1628502345.git.mhaeuser@posteo.de> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable To make parsing DebugImageInfoTable easier and safer, require the LoadedImage protocol instance to be valid for every NormalImage entry. Cc: Leif Lindholm Cc: Ard Biesheuvel Cc: Vitaly Cheptsov Signed-off-by: Marvin H=C3=A4user --- ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerUefi.c | = 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHand= lerUefi.c b/ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandl= erUefi.c index 9befb6d4db9b..d442b5d358b2 100644 --- a/ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerUefi= .c +++ b/ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerUefi= .c @@ -52,8 +52,9 @@ GetImageName ( Address =3D (CHAR8 *)(UINTN)FaultAddress;=0D for (Entry =3D 0; Entry < DebugTableHeader->TableSize; Entry++, DebugTab= le++) {=0D if (DebugTable->ImageInfoType !=3D NULL) {=0D - if ((*DebugTable->ImageInfoType =3D=3D EFI_DEBUG_IMAGE_INFO_TYPE_NOR= MAL) &&=0D - (DebugTable->NormalImage->LoadedImageProtocolInstance !=3D NULL)= ) {=0D + if (*DebugTable->ImageInfoType =3D=3D EFI_DEBUG_IMAGE_INFO_TYPE_NORM= AL) {=0D + ASSERT (gDebugTable->NormalImage->LoadedImageProtocolInstance !=3D= NULL);=0D +=0D if ((Address >=3D (CHAR8 *)DebugTable->NormalImage->LoadedImagePro= tocolInstance->ImageBase) &&=0D (Address <=3D ((CHAR8 *)DebugTable->NormalImage->LoadedImagePr= otocolInstance->ImageBase + DebugTable->NormalImage->LoadedImageProtocolIns= tance->ImageSize))) {=0D *ImageBase =3D (UINTN)DebugTable->NormalImage->LoadedImageProtoc= olInstance->ImageBase;=0D --=20 2.31.1