Hi Mike,
Since LocalityCount is 64-bit wide the SLIT validation code could possibly end
up in an infinite loop. I am not aware of a platform that has a large enough
LocalityCount to hit this condition. However, would it be good to have a check
that limits the validation to MAX_UINT32?
e.g. Something like
if (LocalityCount < MAX_UINT32) {
// Validate
for (Count = 0; Count < LocalityCount; Count++) {
for (Index = 0; Index < LocalityCount; Index++) {
...
} else {
Print (L"INFO: Skipping validation of System Localities as locality count is
> MAX_UINT32\n");
}
Regards,
Sami Mujawar
-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of Michael D Kinney
via Groups.Io
Sent: 10 July 2019 11:35 PM
To: [email protected]
Cc: Jaben Carsey <[email protected]>; Ray Ni <[email protected]>; Zhichao
Gao <[email protected]>
Subject: [edk2-devel] [Patch] ShellPkg/AcpiView: Fix IA32 link error
https://bugzilla.tianocore.org/show_bug.cgi?id=1970
Update local variable in ParseAcpiSlot() to be UINT32 instead of UINT64 to
avoid 64-bit multiply operation in the SLIT_ELEMENT() macro.
Cc: Jaben Carsey <[email protected]>
Cc: Ray Ni <[email protected]>
Cc: Zhichao Gao <[email protected]>
Signed-off-by: Michael D Kinney <[email protected]>
---
.../UefiShellAcpiViewCommandLib/Parsers/Slit/SlitParser.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git
a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Slit/SlitParser.c
b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Slit/SlitParser.c
index 1f9dac66ee..af85c9aa1c 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Slit/SlitParser.c
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Slit/SlitPars
+++ er.c
@@ -57,8 +57,8 @@ ParseAcpiSlit (
)
{
UINT32 Offset;
- UINT64 Count;
- UINT64 Index;
+ UINT32 Count;
+ UINT32 Index;
UINT64 LocalityCount;
UINT8* LocalityPtr;
CHAR16 Buffer[80]; // Used for AsciiName param of ParseAcpi
--
2.21.0.windows.1
IMPORTANT NOTICE: The contents of this email and any attachments are
confidential and may also be privileged. If you are not the intended recipient,
please notify the sender immediately and do not disclose the contents to any
other person, use it for any purpose, or store or copy the information in any
medium. Thank you.
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#43585): https://edk2.groups.io/g/devel/message/43585
Mute This Topic: https://groups.io/mt/32421790/21656
Group Owner: [email protected]
Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-