From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=17.171.2.31; helo=mail-in21.apple.com; envelope-from=afish@apple.com; receiver=edk2-devel@lists.01.org Received: from mail-in21.apple.com (mail-out21.apple.com [17.171.2.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 004B721F6A6D3 for ; Fri, 23 Feb 2018 11:39:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; d=apple.com; s=mailout2048s; c=relaxed/simple; q=dns/txt; i=@apple.com; t=1519415133; x=2383328733; h=From:Sender:Reply-To:Subject:Date:Message-id:To:Cc:MIME-version:Content-type: Content-transfer-encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-reply-to:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=7NgbnMjgvUit0RIeUH4NKc1YiRiBwR+ZEOfUmvGYiLQ=; b=sokUAJFnKR/cV6w5+/4sf1dDWbAdqT9+Rz+LOi3mBIXoCWcAt2ZJV4EcXiwGngLW GiZG0TUgO4pYwcT6Rj6Z4CkiLz0xpn0vJXKCwcll6/9SbmXrrRuS8N8KBbYvDlVL /dsroBCTXP00qU9hdC+0bpfOF7qcV+0M5STUQa8fQk6ew3o+fRVJmhAWMWlTgya3 CY4WggFf9SR6Fgoh5ov0mZtj6cjQ1uUAVuEItK1uwbfdp+26W6QfWG1vmBzIYcAX 8uHRlvgS69ooHaNej9OP9826cvEjAcI/U0CpspnUwfbvY5P1aA3UCF8/uwNkx7s7 ozwPgR5jLAz/R3gBWjsCMw==; Received: from relay21.apple.com (relay21.apple.com [17.171.128.102]) (using TLS with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mail-in21.apple.com (Apple Secure Mail Relay) with SMTP id F5.B8.03684.D5F609A5; Fri, 23 Feb 2018 11:45:33 -0800 (PST) X-AuditID: 11ab0215-4d5ff70000000e64-42-5a906f5d1a97 Received: from ma1-mmpp-sz08.apple.com (ma1-mmpp-sz08.apple.com [17.171.128.176]) by relay21.apple.com (Apple SCV relay) with SMTP id 9E.CD.19484.D5F609A5; Fri, 23 Feb 2018 11:45:33 -0800 (PST) MIME-version: 1.0 Received: from [17.234.251.180] by ma1-mmpp-sz08.apple.com (Oracle Communications Messaging Server 8.0.2.2.20180130 64bit (built Jan 30 2018)) with ESMTPSA id <0P4M000W4C7S4B20@ma1-mmpp-sz08.apple.com>; Fri, 23 Feb 2018 11:45:33 -0800 (PST) Sender: afish@apple.com From: Andrew Fish In-reply-to: <20180223132311.26555-4-marcandre.lureau@redhat.com> Date: Fri, 23 Feb 2018 11:45:28 -0800 Cc: edk2-devel@lists.01.org, qemu-devel@nongnu.org, javierm@redhat.com, pjones@redhat.com, jiewen.yao@intel.com, lersek@redhat.com Message-id: <91D51528-C2CA-41DF-921F-DBD5C2EC028C@apple.com> References: <20180223132311.26555-1-marcandre.lureau@redhat.com> <20180223132311.26555-4-marcandre.lureau@redhat.com> To: marcandre.lureau@redhat.com X-Mailer: Apple Mail (2.3445.5.20) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrLLMWRmVeSWpSXmKPExsUiuLohTTc2f0KUwb4WTos9h44yWyyctpzR Yt1HD4tlx3awWCxoa2e16Fp4g93ieO8OFgd2j8V7XjJ5dM/+x+Lx5NpmJo/3+66yBbBEcdmk pOZklqUW6dslcGX82i5c8ICn4sKzU8wNjDu5uhg5OSQETCQWv5zL0sXIxSEksJ5J4sH3BhaY xIYnz5kgEocZJVb1XGUGSfAKCEr8mHwPqIiDg1lAXWLKlFyImm+MEj0nv4HVCAuIS7w7swnK dpOY9f07G4jNJqAssWL+B3YQm1PAUWLx8R1gNSwCqhIn761jBxnELNDCKNFyfgYjSIJZQFvi ybsLrBCLbSSm3/nJCLJYSKBc4sX9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7koXmrzKxOHTMYPnNqNPOLR4b71ewsUkdb3oZb3pmtxKDQGX1z/q8 Ov7y/w339pbIde26/8Frg4cSS3FGoqEWc1FxIgC9cQ+uYwIAAA== Subject: Re: [PATCH 3/7] HACK: HobLib: workaround infinite loop X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Feb 2018 19:39:32 -0000 Content-type: text/plain; charset=utf-8 Content-transfer-encoding: quoted-printable > On Feb 23, 2018, at 5:23 AM, marcandre.lureau@redhat.com wrote: >=20 > From: Marc-Andr=C3=A9 Lureau >=20 > Without this hack, GetNextHob() loops infinitely with the next patch. > I don't understand the reason. >=20 > The loop is triggered by the GetFirstGuidHob (&gTpmErrorHobGuid) call. >=20 > CC: Laszlo Ersek > CC: Stefan Berger > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Marc-Andr=C3=A9 Lureau > --- > MdePkg/Library/PeiHobLib/HobLib.c | 4 ++++ > 1 file changed, 4 insertions(+) >=20 > diff --git a/MdePkg/Library/PeiHobLib/HobLib.c = b/MdePkg/Library/PeiHobLib/HobLib.c > index 5c0eeb992f..ed3c5fbd6d 100644 > --- a/MdePkg/Library/PeiHobLib/HobLib.c > +++ b/MdePkg/Library/PeiHobLib/HobLib.c > @@ -89,6 +89,10 @@ GetNextHob ( > if (Hob.Header->HobType =3D=3D Type) { > return Hob.Raw; > } > + if (GET_HOB_LENGTH (HobStart) =3D=3D 0) { As Laszlo points out this error condition is likely memory corruption. = Thus it would be better to check for all know illegal values?=20 if (GET_HOB_LENGTH(HobStart) < sizeof (EFI_HOB_GENERIC_HEADER) Thanks, Andrew Fish > + DEBUG ((DEBUG_INFO, "FIXME: GetNextHob length =3D=3D 0")); > + return NULL; > + } > Hob.Raw =3D GET_NEXT_HOB (Hob); > } > return NULL; > --=20 > 2.16.1.73.g5832b7e9f2 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel