Commit Graph
367 Commits
Author SHA1 Message Date
Bejean Mosher 028087e30d fix: Container header parsing failure in some cases.
GetContainerHeaderSize() parses header component entries to find the
offset of the end of the last component entry and checks this against
ContainerHdr->DataOffset. However, there is a valid case where this can
exactly equal to ContainerHdr->DataOffset, when the component alignment is
small enough and there is no component auth data (AuthType is none). This
check is changed to fail on greater than instead of greater or equal to
cover this case.

Signed-off-by: Bejean Mosher <bejean.mosher@intel.com>
2023-11-02 14:47:36 -07:00
Guo Dong b4c1b6b36c Add "acpi" shell command (#2041)
It could help debug ACPI related issues.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2023-10-07 23:14:39 -07:00
randylintw df1f7b8c58 fix: IsElfFormat doesn't correctly check the ELF header (#2036) (#2038)
Verify on booting with universal payload.

Signed-off-by: Randy <randy.lin@intel.com>
2023-10-03 12:15:12 -04:00
Jiaqing Zhao 338ba840bf OsLoader: Print misc image info in Shell
Add support to print misc image info in shell. Misc image will only be
printed when BOOT_FLAGS_MISC is set.

Also fixes some minor bugs in 5968cfa919 ("OsLoader: Print all extra
images")

Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
2023-09-19 17:58:18 -07:00
Jiaqing Zhao c65cd572d2 OsLoader: Print all extra images
Currently only PreOs and Extra0 image info is printed in boot options
list, this patch prints all of them.

Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
2023-09-12 13:55:06 -07:00
Jiaqing Zhao 5968cfa919 OsLoader: Shell support for FILE_IMAGE_LOCATION
Support printing and modifying boot file info in FILE_IMAGE_LOCATION
struct in OsLoader shell.

Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
2023-09-12 13:55:06 -07:00
Jiaqing Zhao b17d6f8c2f Fix typo EnumImageTypeAdroid
"Adroid" should be "Android".

Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
2023-09-05 20:36:54 -07:00
Jiaqing Zhao 68da867e71 ShellLib: Allow editing ImageType in boot command
Allow ImageType to be edited in boot command in shell.

Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
2023-09-05 20:36:54 -07:00
Stanley Chang ca071fd9e3 feat: [EHL] add EfiResetShutdown in ResetSystemLib
The patch handles EfiResetShutdown. With the patch, one can
test "reset off" under OS Loader.

The patch also
 - fixes a wrong reference error in ResetSystemLib.inf.
 - add shutdown text in CmdReset.c

Signed-off-by: Stanley Chang <stanley.chang@intel.com>
2023-08-22 21:25:00 -07:00
Stanley Chang 0fb2616396 fix: multiboot bound check
LoadMultibootModString shall check the index before using it.

Signed-off-by: Stanley Chang <stanley.chang@intel.com>
2023-08-18 08:14:05 -07:00
Jiaqing Zhao 27d0c05bd1 MultibootLib: Fix unable to load multiboot image with modules
LoadMultibootModString() checks the module index against MultiBoot->
MbModuleNumber, which value has not been assigned when called, causing
failure when loading multiboot image with modules. Remove the check to
fix it.

Fixes c9d70e74dc ("fix: multiboot mod string in zero-terminated ASCII
format #1913")

Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
2023-08-17 08:45:29 -07:00
Aakash Panwar 6b560992a3 fix: [Common] Fix coverity issue (#1994)
Fixed Untrusted loop bound (CWE 606)

Signed-off-by: Aakash Panwar <aakash.panwar@intel.com>
2023-08-16 15:47:27 -07:00
Sean McGinn 0131ed6cbd Remove assert in ContainerLib
Convert assert in ContainerLib's GetContainerHeaderSize
to if statement as it breaks firmware update functionality

Signed-off-by: Sean McGinn <sean.mcginn@intel.com>
2023-08-16 12:00:11 -07:00
tsaikevin 462a0c32ea fix: [Common] Fix coverity issues (#1989)
Addressed coverity issues
- Untrusted loop bound (CWE 606)
- Uninitialized pointer read (CWE 457)
Defined Elf file max section, program numbers and size

Signed-off-by: Kevin Tsai <kevin.tsai@intel.com>
2023-08-10 17:46:46 -07:00
Kevin Tsai 9cbad7f916 fix: [Common] Fix Coverity issues
Identical code for different branches (CWE 398)
Untrusted loop bound (CWE 606)

Signed-off-by: Kevin Tsai <kevin.tsai@intel.com>
2023-08-10 10:25:15 -07:00
Sean McGinn 081ce1e947 [RPL] Fix uninitialized scalar value (Coverity issue)
Initialize array with 0's as it can currently be read
before it is written

Signed-off-by: Sean McGinn <sean.mcginn@intel.com>
2023-08-01 17:14:23 -07:00
Sean McGinn 6688436d7c [RPL] Fix array compared against 0 (Coverity issue)
Remove array comparison with NULL as it always
evaluates to true

Signed-off-by: Sean McGinn <sean.mcginn@intel.com>
2023-08-01 17:14:23 -07:00
Sean McGinn 3b39174b1f [RPL] Fix bad bit shift operation (Coverity issue)
Prevent bit shifts over 31 as that is undefined beahvior

Signed-off-by: Sean McGinn <sean.mcginn@intel.com>
2023-08-01 17:14:23 -07:00
tsaikevin d952b1487c fix: [Common] Fix Coverity issues (#1978)
Fixed Untrusted loop bound (CWE 606)

Signed-off-by: Kevin Tsai <kevin.tsai@intel.com>
2023-07-31 16:06:00 -07:00
Jiaqing Zhao b1bf6bf6d6 ShellLib: Fix type mismatch warning in MmRead()
Change the data type of Width to UINT32 of MmRead() declared in
CmdPci.h to match its definition in CmdMm.c.

Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
2023-07-31 14:47:43 -07:00
Jiaqing Zhao 97a5d4df70 IppCryptoLib: Add missing EFIAPI in HmacSha256()
Add missing EFIAPI in HmacSha256() definition to fix type mismatch
compiler warning.

Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
2023-07-31 14:47:43 -07:00
Kevin Tsai 877ac9ffc9 fix: [Common] Fix Coverity issues
Resolved below issues.
Untrusted pointer read(CWE 129)
Operands don't affect result(CWE 569)
Unchecked return value(CWE 252)
Logically dead code(CWE 561)
Unused value(CWE 563)
Unintended sign extension(CWE 194)
Out-of-bounds access(CWE 119)

Signed-off-by: Kevin Tsai <kevin.tsai@intel.com>
2023-07-27 15:51:26 -07:00
Guo Dong 90748b5f82 feat: Fix device enumerate in NVMe library (#1973)
There is a NVMe regression caused by https://github.com/slimbootloader/slimbootloader/pull/1958.
The NVMe device enumerated should not be freed since it will be used in other APIs.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2023-07-20 13:45:53 -04:00
Kevin Tsai a845cf2527 fix: [Common] Fix Coverity issues
Addressed unsigned compared against 0 (CWE 570)

Signed-off-by: Kevin Tsai <kevin.tsai@intel.com>
2023-07-19 14:18:37 -07:00
tsaikevin 0d45c3e60a fix: [Common] Fix Coverity issues (#1958)
Fixed dead default in switch and logically dead code (CWE 561)

Signed-off-by: Kevin Tsai <kevin.tsai@intel.com>
2023-07-19 14:03:41 -07:00