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.web08.20681.1628502711081833823 for ; Mon, 09 Aug 2021 02:51:52 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@posteo.de header.s=2017 header.b=LyRl2np0; 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 26655240101 for ; Mon, 9 Aug 2021 11:51:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1628502709; bh=sKwvbYIYOHMgurQm5vOSxM1XhZsIYUcwZkLx3s+ds8U=; h=From:To:Subject:Date:From; b=LyRl2np0aVNogD704wqWzwLQ3X6UtRjVYDPuxkj3hg98mAtsyqyPrC+ItHOMbW7oO qqcxjjaKM2pGJ1+T92pskfEYZcWvY2zgmbmlAMbBdKDr0MJ8CG1VeRZXL9LzmbofPY q+kPUojbD+wZxH9tKQx+PKhLMy+tzzB7m/Sag3d/xFHzXjo5e6pnL1RlM3uA6JQro0 JqgMwccCCvSPIHriIZE/7hUOLyVFa2JVzM2udBgIoYFPsUOzKgS/3V2AX0NZg5M0zg mn+33vDE98BX5Zr+2wapiubvJMzPJ1sAAb1RcE1bFLno7j0Lsi/++0Vp1ud8bg34Q5 AP1UBfcNG4UCw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Gjrvm3cXwz6tm6 for ; Mon, 9 Aug 2021 11:51:48 +0200 (CEST) From: =?UTF-8?B?TWFydmluIEjDpHVzZXI=?= To: devel@edk2.groups.io Subject: [PATCH v2 0/7] Fix various issues regarding DebugImageInfoTable Date: Mon, 9 Aug 2021 09:51:19 +0000 Message-Id: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable There are various issues regarding DebugImageInfoTable: 1) Interrupting the table updates (e.g. an exception occured) may leave the table in an inconsistent state. 2) Deleting an entry from the table may hide a different entry. 3) The type of image entries is not checked before accessing them as NormalImage. This is practically safe now, because there is only one type, but it adding more types would cause the accesses to potentially invoke Undefined Behaviour. 4) The guarantees the table gives are not clear. For example, the LoadedImage protocol instance can never be NULL (and wouldn't make sense to be either), yet it is checked in some places, but not in others. This patch series addresses all of these issues. Marvin H=C3=A4user (7): MdeModulePkg/DxeCore: Consistent DebugImageInfoTable updates MdeModulePkg/DxeCore: Fix DebugImageInfoTable size report EmbeddedPkg/GdbStub: Check DebugImageInfoTable type safely ArmPkg/DefaultExceptionHandlerLib: Check DebugImageInfoTable type safely MdeModulePkg/CoreDxe: Mandatory LoadedImage for DebugImageInfoTable EmbeddedPkg/GdbStub: Mandatory LoadedImage for DebugImageInfoTable ArmPkg/DefaultExceptionHandlerLib: Mandatory LoadedImage for DebugImageInfoTable ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerUefi.c = | 7 +- EmbeddedPkg/GdbStub/GdbStub.c = | 7 +- MdeModulePkg/Core/Dxe/Misc/DebugImageInfo.c = | 82 +++++++++++++------- 3 files changed, 60 insertions(+), 36 deletions(-) --=20 2.31.1