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.
2 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 1435893:  Integer handling issues  (BAD_SHIFT)
/tests/lib/imd-test.c: 30 in align_up_pow2()


________________________________________________________________________________________________________
*** CID 1435893:  Integer handling issues  (BAD_SHIFT)
/tests/lib/imd-test.c: 30 in align_up_pow2()
24     #define SM_ENTRY_ID 0xB001
25     
26     #define INVALID_REGION_ID 0xC001
27     
28     static uint32_t align_up_pow2(uint32_t x)
29     {
>>>     CID 1435893:  Integer handling issues  (BAD_SHIFT)
>>>     In expression "1 << log2_ceil(x)", shifting by a negative amount has 
>>> undefined behavior.  The shift amount, "log2_ceil(x)", is -1.
30      return (1 << log2_ceil(x));
31     }
32     
33     static size_t max_entries(size_t root_size)
34     {
35      return (root_size - sizeof(struct imd_root_pointer) - sizeof(struct 
imd_root))

** CID 1435892:  Null pointer dereferences  (FORWARD_NULL)


________________________________________________________________________________________________________
*** CID 1435892:  Null pointer dereferences  (FORWARD_NULL)
/tests/lib/imd-test.c: 605 in test_imd_entry_at()
599                     fail_msg("Cannot allocate enough memory - fail test");
600             imd_handle_init(&imd, (void *)(LIMIT_ALIGN + (uintptr_t)base));
601     
602             assert_int_equal(0, imd_create_empty(&imd, LG_ROOT_SIZE, 
LG_ENTRY_ALIGN));
603     
604             /* Fail when entry is NULL */
>>>     CID 1435892:  Null pointer dereferences  (FORWARD_NULL)
>>>     Passing null pointer "e" to "imd_entry_at", which dereferences it.
605             assert_null(imd_entry_at(&imd, e));
606     
607             entry = imd_entry_add(&imd, LG_ENTRY_ID, LG_ENTRY_SIZE);
608             assert_non_null(entry);
609     
610             r = (struct imd_root *)imd.lg.r;


________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, 
https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50yq2SfQfrHt3Prsn4qSLrYIrajINpiFX8l0vrlNSf8iCrS27qY0Cr0DkycwNUgGZJj8-3DA4SQ_L-2FDzr14mnrsJO5b1wX1hp9b1MAQygl7x-2B74RAaH2cn2ma22GtF7SE75PlEeWNJIPEArxJvbckbeqR14X6IevJr9McNFRUQeDwHi05iKwLZhHIsg4JEi8T-2BqUcb4Ep0DVeBsdxeJgmVjgJH4HHOiQRECxX6b9I9fGGaIwzI9MdZHhYRW8nOa7nOAT1KhN-2FrjHd-2FAOjr6CFUoqLtPHgYpHOYniW1z3CR8hRKrHvJIv6-2B8-3D
_______________________________________________
coreboot mailing list -- coreboot@coreboot.org
To unsubscribe send an email to coreboot-le...@coreboot.org

Reply via email to