Hi,

Please find the latest report on new defect(s) introduced to coreboot found 
with Coverity Scan.

2 new defect(s) introduced to coreboot found with Coverity Scan.
1 defect(s), reported by Coverity Scan earlier, were marked fixed in the recent 
build analyzed by Coverity Scan.

New defect(s) Reported-by: Coverity Scan
Showing 2 of 2 defect(s)


** CID 1443794:  Integer handling issues  (OVERFLOW_BEFORE_WIDEN)
/src/soc/amd/picasso/agesa_acpi.c: 555 in gen_crat_memory_entries()


________________________________________________________________________________________________________
*** CID 1443794:  Integer handling issues  (OVERFLOW_BEFORE_WIDEN)
/src/soc/amd/picasso/agesa_acpi.c: 555 in gen_crat_memory_entries()
549                             dram_limit_reg = data_fabric_read_reg32(0, 
DF_DRAM_LIMIT(dram_map_idx),
550                                                                     
IOMS0_FABRIC_ID);
551                             memory_length =
552                                     ((dram_limit_reg & DRAM_LIMIT_ADDR) >> 
DRAM_LIMIT_ADDR_SHFT) + 1
553                                     - ((dram_base_reg & DRAM_BASE_ADDR) >> 
DRAM_BASE_ADDR_SHFT);
554                             memory_length = memory_length << 28;
>>>     CID 1443794:  Integer handling issues  (OVERFLOW_BEFORE_WIDEN)
>>>     Potentially overflowing expression "(dram_base_reg & 0xfffff000U) << 
>>> 16" with type "unsigned int" (32 bits, unsigned) is evaluated using 32-bit 
>>> arithmetic, and then used in a context that expects an expression of type 
>>> "uint64_t" (64 bits, unsigned).
555                             memory_base = (dram_base_reg & DRAM_BASE_ADDR)
556                                           << (28 - DRAM_BASE_ADDR_SHFT);
557     
558                             if (memory_base == 0) {
559                                     current =
560                                             create_crat_memory_entry(0, 
0ull, 0xa0000ull, current);

** CID 1443793:  Integer handling issues  (OVERFLOW_BEFORE_WIDEN)
/src/soc/amd/picasso/agesa_acpi.c: 573 in gen_crat_memory_entries()


________________________________________________________________________________________________________
*** CID 1443793:  Integer handling issues  (OVERFLOW_BEFORE_WIDEN)
/src/soc/amd/picasso/agesa_acpi.c: 573 in gen_crat_memory_entries()
567                                     dram_hole_ctl = 
data_fabric_read_reg32(0, D18F0_DRAM_HOLE_CTL,
568                                                                            
IOMS0_FABRIC_ID);
569                                     hole_base = (dram_hole_ctl & 
DRAM_HOLE_CTL_BASE);
570                                     size_below_hole = hole_base - 
memory_base;
571                                     current = create_crat_memory_entry(0, 
memory_base,
572                                                                        
size_below_hole, current);
>>>     CID 1443793:  Integer handling issues  (OVERFLOW_BEFORE_WIDEN)
>>>     Potentially overflowing expression "((dram_limit_reg & 0xfffff000U) >> 
>>> 12) + 1U - 16U << 28" with type "unsigned int" (32 bits, unsigned) is 
>>> evaluated using 32-bit arithmetic, and then used in a context that expects 
>>> an expression of type "uint64_t" (64 bits, unsigned).
573                                     memory_length = (((dram_limit_reg & 
DRAM_LIMIT_ADDR)
574                                                       >> 
DRAM_LIMIT_ADDR_SHFT)
575                                                      + 1 - 0x10)
576                                                     << 28;
577                                     memory_base = 0x100000000;
578                                     new_entries++;


________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, 
https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50yq2SfQfrHt3Prsn4qSLrYIrajINpiFX8l0vrlNSf8iCrS27qY0Cr0DkycwNUgGZJj8-3DKxKX_L-2FDzr14mnrsJO5b1wX1hp9b1MAQygl7x-2B74RAaH2cn27IwyrWRBntMPX62SZmuTrS8UqRE0E-2FpeaP1cjX1EdgyiMfa-2Fs4oO-2FuJIxNgJLL2a-2Bq3PLDuRH6rHP46vYe-2Bn9F4j2x-2Be2BZSnpkdHzXcYVxf0oBdVw8ykvTEG8-2BKou7Qze2DYHTN6jRc5zh7IFWVAtL81g3GKsZbWc2B2nnL2UM0r4TDt0-2BbUNT-2FwAqEKtQM-3D
_______________________________________________
coreboot mailing list -- coreboot@coreboot.org
To unsubscribe send an email to coreboot-le...@coreboot.org

Reply via email to