From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mout01.posteo.de (mout01.posteo.de [185.67.36.65]) by mx.groups.io with SMTP id smtpd.web08.29248.1628543980877249178 for ; Mon, 09 Aug 2021 14:19:41 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@posteo.de header.s=2017 header.b=hhuV2Wpw; spf=pass (domain: posteo.de, ip: 185.67.36.65, mailfrom: mhaeuser@posteo.de) Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 15DCF240026 for ; Mon, 9 Aug 2021 23:19:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1628543979; bh=XlpLml6qJ8e3BPbRX/KAvJBnRYoOy6chmC5P15YCGDA=; h=Subject:From:To:Cc:Date:From; b=hhuV2WpwHua4M1CbsurTr3S7hhPQ1apncntusnArVerWyPZH9h2H3qFxqSECU4eFU g8xPb2UkwJaerFgHDLN/zJKr38yytzgw3arnh0GXmo8Oh8dN8Zgi1wWyJy532qjrFE 2qDaxRhnrKenrkJKrM/HBqsVfH8FBUp9wOFmqOud8Q3O/QKdacsmGS5lpM8p+wvzrI qJ1nDttgjYHCU0evv6nUDQtGX0IuEP1cW66dEk5HkY+sd3/CrI7iVW8Zbvk7OUajEf DrzOfwhdalTvfGJxtwAcnXuh/8VVc2cIBVSYet3yj6FUXD5cSxyoD9xwkc1zFdzMyu kkZai/CZSlpQQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Gk89P6gp1z9rxH; Mon, 9 Aug 2021 23:19:37 +0200 (CEST) Subject: Re: [edk2-devel] [PATCH v2 4/7] ArmPkg/DefaultExceptionHandlerLib: Check DebugImageInfoTable type safely From: =?UTF-8?B?TWFydmluIEjDpHVzZXI=?= To: devel@edk2.groups.io, ardb@kernel.org Cc: Leif Lindholm , Ard Biesheuvel , Vitaly Cheptsov References: <961f3436a2b52a67aa6c8cd45c75c76835a3a5d8.1628502345.git.mhaeuser@posteo.de> Message-ID: <2fd17277-575c-7a33-3c8c-bc986ebf62c0@posteo.de> Date: Mon, 9 Aug 2021 21:19:37 +0000 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: quoted-printable On 09/08/2021 14:40, Marvin H=C3=A4user wrote: > On 09/08/2021 13:55, Ard Biesheuvel wrote: >> On Mon, 9 Aug 2021 at 11:51, Marvin H=C3=A4user wro= te: >>> C does not allow casting to or dereferencing incompatible pointer >>> types. Use the ImageInfoType member of the union first to determine >>> the data type before dereferencing NormalImage. >>> >>> Cc: Leif Lindholm >>> Cc: Ard Biesheuvel >>> Cc: Vitaly Cheptsov >>> Signed-off-by: Marvin H=C3=A4user >> Hi Marvin, >> >> Could you please organize your patches into a consistent series, >> include a cover letter and cc me on everything? > > Hey Ard, > > It's a series and there is a cover letter at:=20 > https://edk2.groups.io/g/devel/topic/patch_v2_0_7_fix_various/84764899?p= =3D,,,20,0,0,0::recentpostdate%2Fsticky,,,20,2,0,84764899 > The mails from yesterday can certainly be discarded, for some reason=20 > format-patch did not number the patches without the argument. > The mails from today are numbered and there is a cover letter, but for=20 > some reason the threading is all wrong in Thunderbird for me. All=20 > subsequent patches have the "In-Reply-To" header in the patch files, I=20 > think it is supposed to work off of that? Is threading broken for you=20 > as well? Any idea what could have gone wrong? Today I learned two things. 1) Both format-patch and send-email support threading individually, and=20 they don't cooperate [1]. 2) Groups.io does not like patch sets [2]. *Sigh*. Sorry. Best regards, Marvin [1] "It is up to the user to ensure that no In-Reply-To header already=20 exists when git send-email is asked to add it (especially note that git=20 format-patch can be configured to do the threading itself). Failure to=20 do so may not produce the expected result in the recipient=E2=80=99s MUA.",= =20 https://git-scm.com/docs/git-send-email [2] "Note: This checkbox is selected by default in new Groups.io=20 accounts. If you do not want to see copies of your own messages, clear=20 this checkbox. [...] (For those interested in the technical details:=20 When this checkbox is selected, Groups.io replaces the Message-Id header=20 with a new, system-generated one and renames the original Message-Id=20 header to X-Orig-Message-Id.)",=20 https://groups.io/helpcenter/membersmanual?single=3Dtrue > > I will create a V3 with you CC'd on all patches once I understand=20 > everything that went wrong. Is it normal to CC all people from each=20 > patch on all patches of a series? > > Thanks and so sorry for the hassle! > > Best regards, > Marvin > >> I am going to disregard anything you sent yesterday and today, as it >> is a bit of a jumble. >> >> Thanks, >> Ard. >> >> >>> --- >>> ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerUefi.c= =20 >>> | 4 ++-- >>> =C2=A0 1 file changed, 2 insertions(+), 2 deletions(-) >>> >>> diff --git=20 >>> a/ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerUefi= .c=20 >>> b/ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerUefi= .c=20 >>> >>> index e9fea4038252..9befb6d4db9b 100644 >>> ---=20 >>> a/ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerUefi= .c >>> +++=20 >>> b/ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerUefi= .c >>> @@ -51,8 +51,8 @@ GetImageName ( >>> >>> =C2=A0=C2=A0=C2=A0 Address =3D (CHAR8 *)(UINTN)FaultAddress; >>> =C2=A0=C2=A0=C2=A0 for (Entry =3D 0; Entry < DebugTableHeader->TableSiz= e; Entry++,=20 >>> DebugTable++) { >>> -=C2=A0=C2=A0=C2=A0 if (DebugTable->NormalImage !=3D NULL) { >>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ((DebugTable->NormalImage->ImageInfo= Type =3D=3D=20 >>> EFI_DEBUG_IMAGE_INFO_TYPE_NORMAL) && >>> +=C2=A0=C2=A0=C2=A0 if (DebugTable->ImageInfoType !=3D NULL) { >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ((*DebugTable->ImageInfoType =3D=3D= =20 >>> EFI_DEBUG_IMAGE_INFO_TYPE_NORMAL) && >>> (DebugTable->NormalImage->LoadedImageProtocolInstance !=3D NULL)) { >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ((Address >= =3D (CHAR8=20 >>> *)DebugTable->NormalImage->LoadedImageProtocolInstance->ImageBase) && >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 (Address <=3D ((CHAR8=20 >>> *)DebugTable->NormalImage->LoadedImageProtocolInstance->ImageBase +=20 >>> DebugTable->NormalImage->LoadedImageProtocolInstance->ImageSize))) { >>> --=20 >>> 2.31.1 >>> >> >>=20 >> >> >