Paul Menzel has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/51284 )
Change subject: vc/amd/sb800: Cast to UINT32 for shift out of bounds fix ......................................................................
vc/amd/sb800: Cast to UINT32 for shift out of bounds fix
It’s defined as `unsigned char`.
SB800: sb_Before_Pci_Init shift out of bounds src/vendorcode/amd/cimx/sb800/SBCMN.c:643:53 ubsan: unrecoverable error.
Change-Id: I0c5fa16bce5b68ed3b48bb17eae6d81af894b688 Found-by: UBSAN Signed-off-by: Paul Menzel pmenzel@molgen.mpg.de --- M src/vendorcode/amd/cimx/sb800/SBCMN.c 1 file changed, 3 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/84/51284/1
diff --git a/src/vendorcode/amd/cimx/sb800/SBCMN.c b/src/vendorcode/amd/cimx/sb800/SBCMN.c index ab203a1..0a62d0e 100644 --- a/src/vendorcode/amd/cimx/sb800/SBCMN.c +++ b/src/vendorcode/amd/cimx/sb800/SBCMN.c @@ -640,12 +640,12 @@
while ( (pABTbl->regType) != 0xFF ) { if ( pABTbl->regType > AXINDC ) { - ddValue = pABTbl->regIndex | (pABTbl->regType << 29); + ddValue = pABTbl->regIndex | ((UINT32) pABTbl->regType << 29); writeAlink (ddValue, ((readAlink (ddValue)) & (0xFFFFFFFF^ (pABTbl->regMask))) | pABTbl->regData); } else { - ddValue = 0x30 | (pABTbl->regType << 29); + ddValue = 0x30 | ((UINT32) pABTbl->regType << 29); writeAlink (ddValue, pABTbl->regIndex); - ddValue = 0x34 | (pABTbl->regType << 29); + ddValue = 0x34 | ((UINT32) pABTbl->regType << 29); writeAlink (ddValue, ((readAlink (ddValue)) & (0xFFFFFFFF^ (pABTbl->regMask))) | pABTbl->regData); } ++pABTbl;