[coreboot-gerrit] Patch set updated for coreboot: bbc6832 amd/agesa/f16kb/Lib/amdlib.c: Integer overflow in loop construct
Edward O'Callaghan (eocallaghan@alterapraxis.com)
gerrit at coreboot.org
Tue Dec 9 09:05:56 CET 2014
Edward O'Callaghan (eocallaghan at alterapraxis.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/7676
-gerrit
commit bbc683200606ca49761023378f287939bc672cd7
Author: Edward O'Callaghan <eocallaghan at alterapraxis.com>
Date: Sun Dec 7 05:20:14 2014 +1100
amd/agesa/f16kb/Lib/amdlib.c: Integer overflow in loop construct
As is the case in commit:
3312ed7 amd/agesa/f1?/Lib/amdlib.c: Integer overflow in loop construct
The semantics of this loop relies on an integer overflow in Index >=0
that implies a return value of (UINT8)-1 which around wraps to 0xFF, or
VOLT_UNSUPPORTED.
Change-Id: Iced3eff3ae7b8935db3bdd6147372cf3b540883c
Signed-off-by: Edward O'Callaghan <eocallaghan at alterapraxis.com>
---
src/vendorcode/amd/agesa/f16kb/Lib/amdlib.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/vendorcode/amd/agesa/f16kb/Lib/amdlib.c b/src/vendorcode/amd/agesa/f16kb/Lib/amdlib.c
index d0e66b9..3a7ada8 100644
--- a/src/vendorcode/amd/agesa/f16kb/Lib/amdlib.c
+++ b/src/vendorcode/amd/agesa/f16kb/Lib/amdlib.c
@@ -360,11 +360,11 @@ LibAmdBitScanReverse (
IN UINT32 value
)
{
- UINTN Index;
+ UINT8 Index;
for (Index = 31; Index >= 0; Index--){
- if (value & (1 << Index)) break;
+ if (value & (1 << Index)) return Index;
}
- return (UINT8) Index;
+ return 0xFF;
}
VOID
LibAmdMsrRead (
More information about the coreboot-gerrit
mailing list