From nobody Tue May 7 01:13:26 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+78901+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+78901+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=posteo.de ARC-Seal: i=1; a=rsa-sha256; t=1628451646; cv=none; d=zohomail.com; s=zohoarc; b=B9z2hJfhyqfvyHeo5qQoJwRO43k8ALstujFoP5pCKG+msh13mVsXQQto9uWV1yD0gNNGZP33vNoyPUMXFkyVJLQ/y6TwTSiOBC7LA5+3jvZw3lmeLmDgpT4uYQXcrM9oDsWBmWiza92D3Va9s2sw5ujmBl7bQaLGdONcFAlwKeg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628451646; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=Z8pl5yIbdVebUWe5VKW26F+JIGnKQYDj7Lsg4EiGQE8=; b=Ake1rQjnA5UpKosyQ+1JVeH6dR/UYerMv19W7B7cJnTGugBm9j8B/ysMrkRZ2oVy18weH1thZ53U2WNA4UkyRl8ude1k3MpdUube0BM/CdpyQO/XHi8znC9z/7kPluIFx5qXf74U+ziVnwBWZcceTyo6ID6ncNFfp6dmayBNRuo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+78901+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1628451646044113.74094901380829; Sun, 8 Aug 2021 12:40:46 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id VkMwYY1788612xlO7kzGq8DI; Sun, 08 Aug 2021 12:40:45 -0700 X-Received: from mout02.posteo.de (mout02.posteo.de [185.67.36.66]) by mx.groups.io with SMTP id smtpd.web12.13821.1628451644553956410 for ; Sun, 08 Aug 2021 12:40:44 -0700 X-Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id A5AC1240112 for ; Sun, 8 Aug 2021 21:40:42 +0200 (CEST) X-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4GjV1k10ymz6tmD; Sun, 8 Aug 2021 21:40:42 +0200 (CEST) From: =?UTF-8?B?TWFydmluIEjDpHVzZXI=?= To: devel@edk2.groups.io Cc: Leif Lindholm , Ard Biesheuvel , Vitaly Cheptsov Subject: [edk2-devel] [PATCH] ArmPkg/DefaultExceptionHandlerLib: Check DebugImageInfoTable type safely Date: Sun, 8 Aug 2021 19:39:59 +0000 Message-Id: <961f3436a2b52a67aa6c8cd45c75c76835a3a5d8.1628443860.git.mhaeuser@posteo.de> In-Reply-To: <88816e99692b15cf61f3057ffab4d54455159c7c.1628443860.git.mhaeuser@posteo.de> References: <88816e99692b15cf61f3057ffab4d54455159c7c.1628443860.git.mhaeuser@posteo.de> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,mhaeuser@posteo.de X-Gm-Message-State: I10hhuBL63CJ2GXKuM67zcBNx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1628451645; bh=HFlcvDUq1y2gEqEdMRB6cz0vZlYc4oY/J3vUCvWH35s=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=BELoXjMUGaaMHGQBtmdgMdBVhDsY4IiMNmlIdubfT8TydbCWvNgahFre83j7FzntpbA mDhOXPSKz8DKJ8HxV/W6guPNjLMqz5eVSUM3VIiZzFz4isNoSoD2Mp/DL+546hZ9yMfAW to6UaMwGCu73U/eDxlt1XahOoEhMNwOBJrQ= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1628451648060100104 Content-Type: text/plain; charset="utf-8" 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 --- ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerUefi.c | = 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHand= lerUefi.c b/ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandl= erUefi.c index e9fea4038252..9befb6d4db9b 100644 --- a/ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerUefi= .c +++ b/ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerUefi= .c @@ -51,8 +51,8 @@ GetImageName ( =20 Address =3D (CHAR8 *)(UINTN)FaultAddress; for (Entry =3D 0; Entry < DebugTableHeader->TableSize; Entry++, DebugTab= le++) { - if (DebugTable->NormalImage !=3D NULL) { - if ((DebugTable->NormalImage->ImageInfoType =3D=3D EFI_DEBUG_IMAGE_I= NFO_TYPE_NORMAL) && + if (DebugTable->ImageInfoType !=3D NULL) { + if ((*DebugTable->ImageInfoType =3D=3D EFI_DEBUG_IMAGE_INFO_TYPE_NOR= MAL) && (DebugTable->NormalImage->LoadedImageProtocolInstance !=3D NULL)= ) { if ((Address >=3D (CHAR8 *)DebugTable->NormalImage->LoadedImagePro= tocolInstance->ImageBase) && (Address <=3D ((CHAR8 *)DebugTable->NormalImage->LoadedImagePr= otocolInstance->ImageBase + DebugTable->NormalImage->LoadedImageProtocolIns= tance->ImageSize))) { --=20 2.31.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#78901): https://edk2.groups.io/g/devel/message/78901 Mute This Topic: https://groups.io/mt/84754076/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-