28338 Commits
Author SHA1 Message Date
osy 9ad3607a5d ArmVirtPkg: enable VGA driver 2025-03-06 22:10:52 -06:00
osy 8e9f157887 ArmVirtPkg: re-enable ramfb device
Now that virtio-ramfb has its own entry, we can safely enable standalone
ramfb again.
2024-12-22 16:58:16 -08:00
osy 9021292fb5 OvmfPkg/VirtioGpuDxe: obtain ramfb from BAR
Windows requires a linear framebuffer to boot. We introduced virtio-ramfb
for this reason. Previously, when ramfb is activated, EDK2 will allocate
the framebuffer from system memory and pass the physical address to QEMU.
While this worked to boot Windows, upon installing the virtio-gpu
drivers, Windows does not unload the BDD driver for the POST display.
This led to various issues with a black display when Windows mistakingly
selects the ramfb display to target even after virtio-gpu is activated.

The cause of this issue is in dxgkrnl.sys. DpiFdoDetectPostDevice() is
called to check if the POST device can be retired after adding a new
minidisplay device. To determine if the POST display is owned by the
incoming device, its resource list is queried to see if the framebuffer
is located in any of the resource entries for this device. For a PCI
device, the resource list comes from the BARs.

On ARM systems, we cannot use the deviced mapped BAR directly because of
cache alignment issues. We need to re-map the pages as cachable so that
accelerated write functions do not cause a data abort.
2024-12-22 16:47:34 -08:00
osy 14542d6e91 Merge pull request #1 from conath/utm-logo
Replace default boot logo with UTM logo
2021-05-10 16:04:19 -07:00
Christoph Parstorfer 3aa3cc0692 Replace default boot logo with UTM logo 2021-04-26 22:51:18 +02:00
osy bca86ecf2e hack workaround for QEMU USB boot race 2021-03-22 23:05:54 -07:00
osy c8440e1ccc support virtio-ramfb 2020-12-19 16:17:52 -08:00
James Bottomley 872f953262 MdeModulePkg/VariablePolicyLib: Fix runtime panic in ValidateSetVariable()
The current variable policy is allocated by AllocatePool(), which is
boot time only.  This means that if you do any variable setting in the
runtime, the policy has been freed.  Ordinarily this isn't detected
because freed memory is still there, but when you boot the Linux
kernel, it's been remapped so the actual memory no longer exists in
the memory map causing a page fault.

Fix this by making it AllocateRuntimePool().  For SMM drivers, the
platform DSC is responsible for resolving the MemoryAllocationLib
class to the SmmMemoryAllocationLib instance. In the
SmmMemoryAllocationLib instance, AllocatePool() and
AllocateRuntimePool() are implemented identically. Therefore this
change is a no-op when the RegisterVariablePolicy() function is built
into an SMM driver. The fix affects runtime DXE drivers only.

Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3092
Signed-off-by: James Bottomley <[email protected]>
Reviewed-by: Laszlo Ersek <[email protected]>
Tested-by: Laszlo Ersek <[email protected]>
Reviewed-by: Liming Gao <[email protected]>
edk2-stable202011
2020-11-27 01:19:34 +00:00
Kun Qin 21f984cede CryptoPkg: BaseCryptLib: Fix buffer double free in CryptPkcs7VerifyEku
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2459

SignerCert is part of Pkcs7 instance when both have valid content. OpenSLL
PKCS7_free function will release the memory of SignerCert when applicable.
Freeing SignerCert with X509_free again might cause page fault if use-
after-free guard is enabled.

Cc: Jian J Wang <[email protected]>
Cc: Xiaoyu Lu <[email protected]>
Cc: Jiewen Yao <[email protected]>
Cc: Guomin Jiang <[email protected]>

Signed-off-by: Kun Qin <[email protected]>
Reviewed-by: Jiewen Yao <[email protected]>
2020-11-26 03:22:24 +00:00
gaoliming e9d62effa3 Revert "SecurityPkg: Add RPMC Index to the RpmcLib"
This reverts commit 6c8dd15c4a.

Based on the discussion https://edk2.groups.io/g/devel/message/67764,
this change is regarded as the feature request. But, it doesn't pass
reviewed before 202011 stable tag soft feature freeze. So, it should
not be merged into 202011 stable tag.

Cc: Jiewen Yao <[email protected]>
Cc: Jian J Wang <[email protected]>
Cc: Nishant C Mistry <[email protected]>
Signed-off-by: Liming Gao <[email protected]>
Acked-by: Jiewen Yao <[email protected]>
Reviewed-by: Jiewen Yao <[email protected]>
2020-11-26 01:22:29 +00:00
Michael D Kinney 388f9a9355 CryptoPkg/Test/UnitTest/Library/BaseCryptLib: Fix MD5 Hash tests
Only include MD5 unit tests if ENABLE_MD5_DEPRECATED_INTERFACES
is defined and define ENABLE_MD5_DEPRECATED_INTERFACES for host
based unit tests so MD5 services are always tested.

Cc: Jiewen Yao <[email protected]>
Cc: Jian J Wang <[email protected]>
Cc: Xiaoyu Lu <[email protected]>
Cc: Guomin Jiang <[email protected]>
Signed-off-by: Michael D Kinney <[email protected]>
Reviewed-by: Jiewen Yao <[email protected]>
Reviewed-by: Zhichao Gao <[email protected]>
2020-11-25 17:54:11 +00:00
Michael D Kinney 3ab9d60fcb OvmfPkg/PlatformCI/.azurepiplines: Use stable release of QEMU
Install the 2020.08.14 release of QEMU for Windows.

The QEMU release from 2020.11.20 is installed into the incorrect
directory and is causing EDK II CI failures in the run to shell
step.

Cc: Sean Brogan <[email protected]>
Cc: Bret Barkelew <[email protected]>
Cc: Liming Gao <[email protected]>
Cc: Jordan Justen <[email protected]>
Cc: Laszlo Ersek <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Signed-off-by: Michael D Kinney <[email protected]>
Acked-by: Laszlo Ersek <[email protected]>
Reviewed-by: Philippe Mathieu-Daude <[email protected]>
2020-11-25 17:54:11 +00:00
Sean Brogan 3d39107f2d .azurepipelines/templates/platform-build-run-steps.yml: Fetch target branch
Update Platform build steps process to fetch target branch

Cc: Bret Barkelew <[email protected]>
Cc: Michael D Kinney <[email protected]>
Cc: Liming Gao <[email protected]>
Signed-off-by: Sean Brogan <[email protected]>
Reviewed-by: Michael D Kinney <[email protected]>
2020-11-25 17:54:11 +00:00
Sean Brogan 391610903b .azurepipelines/templates/pr-gate-steps.yml: Fetch target branch
Add step to fetch target branch so that PR_EVAL can resolve diff

Cc: Bret Barkelew <[email protected]>
Cc: Michael D Kinney <[email protected]>
Cc: Liming Gao <[email protected]>
Signed-off-by: Sean Brogan <[email protected]>
Reviewed-by: Michael D Kinney <[email protected]>
2020-11-25 17:54:11 +00:00
Laszlo Ersek e7bd0dd26d MdeModulePkg/LzmaCustomDecompressLib: catch 4GB+ uncompressed buffer sizes
The LzmaUefiDecompressGetInfo() function
[MdeModulePkg/Library/LzmaCustomDecompressLib/LzmaDecompress.c] currently
silently truncates the UINT64 "DecodedSize" property of the compressed
blob to the UINT32 "DestinationSize" output parameter.

If "DecodedSize" is 0x1_0000_0100, for example, then the subsequent memory
allocation (for decompression) will likely succeed (allocating 0x100 bytes
only), but then the LzmaUefiDecompress() function (which re-fetches the
uncompressed buffer size from the same LZMA header into a "SizeT"
variable) will overwrite the buffer.

Catch (DecodedSize > MAX_UINT32) in LzmaUefiDecompressGetInfo() at once.
This should not be a practical limitation. (The issue cannot be fixed for
32-bit systems without spec modifications anyway, given that the
"OutputSize" output parameter of
EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL.ExtractSection() has type UINTN,
not UINT64.)

Cc: Dandan Bi <[email protected]>
Cc: Hao A Wu <[email protected]>
Cc: Jian J Wang <[email protected]>
Cc: Liming Gao <[email protected]>
Cc: Philippe Mathieu-Daudé <[email protected]>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1816
Signed-off-by: Laszlo Ersek <[email protected]>
Reviewed-by: Liming Gao <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-Id: <[email protected]>
2020-11-21 02:04:40 +00:00
Laszlo Ersek 47343af304 MdeModulePkg/Core/Dxe: limit FwVol encapsulation section recursion
The DXE Core sets up a protocol notify function in its entry point, for
instances of the Firmware Volume Block2 Protocol:

  DxeMain()           [DxeMain/DxeMain.c]
    FwVolDriverInit() [FwVol/FwVol.c]

Assume that a 3rd party UEFI driver or application installs an FVB
instance, with crafted contents. The notification function runs:

  NotifyFwVolBlock() [FwVol/FwVol.c]

installing an instance of the Firmware Volume 2 Protocol on the handle.

(Alternatively, assume that a 3rd party application calls
gDS->ProcessFirmwareVolume(), which may also produce a Firmware Volume 2
Protocol instance.)

The EFI_FIRMWARE_VOLUME2_PROTOCOL.ReadSection() member performs "a
depth-first, left-to-right search algorithm through all sections found in
the specified file" (quoting the PI spec), as follows:

  FvReadFileSection()   [FwVol/FwVolRead.c]
    GetSection()        [SectionExtraction/CoreSectionExtraction.c]
      FindChildNode()   [SectionExtraction/CoreSectionExtraction.c]
        FindChildNode() // recursive call

FindChildNode() is called recursively for encapsulation sections.

Currently this recursion is not limited. Introduce a new PCD
(fixed-at-build, or patchable-in-module), and make FindChildNode() track
the section nesting depth against that PCD.

Cc: Dandan Bi <[email protected]>
Cc: Hao A Wu <[email protected]>
Cc: Jian J Wang <[email protected]>
Cc: Liming Gao <[email protected]>
Cc: Philippe Mathieu-Daudé <[email protected]>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1743
Signed-off-by: Laszlo Ersek <[email protected]>
Reviewed-by: Liming Gao <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-Id: <[email protected]>
2020-11-21 01:40:53 +00:00
Laszlo Ersek b9bdfc7285 MdeModulePkg/Core/Dxe: assert SectionInstance invariant in FindChildNode()
FindChildNode() has two callers: GetSection(), and FindChildNode() itself.

- At the GetSection() call site, a positive (i.e., nonzero)
  SectionInstance is passed. This is because GetSection() takes a
  zero-based (UINTN) SectionInstance, and then passes
  Instance=(SectionInstance+1) to FindChildNode().

- For reaching the recursive FindChildNode() call site, a section type
  mismatch, or a section instance mismatch, is necessary. This means,
  respectively, that SectionInstance will either not have been decreased,
  or not to zero anyway, at the recursive FindChildNode() call site.

Add two ASSERT()s to FindChildNode(), for expressing the (SectionSize>0)
invariant.

In turn, the invariant provides the explanation why, after the recursive
call, a zero SectionInstance implies success. Capture it in a comment.

Cc: Dandan Bi <[email protected]>
Cc: Hao A Wu <[email protected]>
Cc: Jian J Wang <[email protected]>
Cc: Liming Gao <[email protected]>
Cc: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Laszlo Ersek <[email protected]>
Reviewed-by: Liming Gao <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-Id: <[email protected]>
2020-11-21 01:40:53 +00:00
Nishant Mistry 6c8dd15c4a SecurityPkg: Add RPMC Index to the RpmcLib
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2594

The re-design requires multiple RPMC counter usages.
The consumer will be capable of selecting amongst multiple counters.

Signed-off-by: Nishant C Mistry <[email protected]>
Reviewed-by: Jian J Wang <[email protected]>
2020-11-19 08:18:03 +00:00
Bob Feng 098af8b408 IntelFsp2Pkg/Tools: Fixed PatchFv.py to parse new Fv map file format
The commit 76e8aac158 changed Fv map format.
It added the image type to better support source level debug. But it broke
the function of PatchFv.py because PatchFv.py also consume Fv map file.

This patch is to update PatchFv.py to make it work again.

Signed-off-by: Bob Feng <[email protected]>
Cc: Chasel Chiu <[email protected]>
Cc: Nate DeSimone <[email protected]>
Cc: Star Zeng <[email protected]>
Cc: Yunhua Feng <[email protected]>
Cc: Zhiguang Liu <[email protected]>

Reviewed-by: Chasel Chiu <[email protected]>
Reviewed-by: Star Zeng <[email protected]>
Reviewed-by: Liming Gao <[email protected]>
2020-11-19 07:35:23 +00:00
Mingyue Liang 6c4efc0509 BaseTools: Resolve index out of range errors.
This problem is generated by solving bz2972's
patch, and the commit ID is
0af7f8e6a9.

This is a problem when updating the DEPs file.
The code does not consider that there is only
one line of content in the file, so the filter
condition is added to prevent the index from
exceeding the range.

Signed-off-by: Mingyue Liang <[email protected]>
Cc: Bob Feng <[email protected]>
Cc: Liming Gao <[email protected]>
Cc: Yuwei Chen <[email protected]>
Reviewed-by: Yuwei Chen <[email protected]>
Reviewed-by: Bob Feng <[email protected]>
Reviewed-by: Liming Gao <[email protected]>
2020-11-19 02:22:57 +00:00
Sheng Wei 404250c8f7 UefiCpuPkg/PiSmmCpuDxeSmm: Reflect page table depth with page table address
When trying to get page table base, if mInternalCr3 is zero, it will use
 the page table from CR3, and reflect the page table depth by CR4 LA57 bit.
If mInternalCr3 is non zero, it will use the page table from mInternalCr3
 and reflect the page table depth of mInternalCr3 at same time.
In the case of X64, we use m5LevelPagingNeeded to reflect the depth of
 the page table. And in the case of IA32, it will not the page table depth
 information.

This patch is a bug fix when enable CET feature with 5 level paging.
The SMM page tables are allocated / initialized in PiCpuSmmEntry().
When CET is enabled, PiCpuSmmEntry() must further modify the attribute of
 shadow stack pages. This page table is not set to CR3 in PiCpuSmmEntry().
 So the page table base address is set to mInternalCr3 for modifty the
 page table attribute. It could not use CR4 LA57 bit to reflect the
 page table depth for mInternalCr3.
So we create a architecture-specific implementation GetPageTable() with
 2 output parameters. One parameter is used to output the page table
 address. Another parameter is used to reflect if it is 5 level paging
 or not.

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3015

Signed-off-by: Sheng Wei <[email protected]>
Cc: Eric Dong <[email protected]>
Cc: Ray Ni <[email protected]>
Cc: Laszlo Ersek <[email protected]>
Cc: Rahul Kumar <[email protected]>
Cc: Jiewen Yao <[email protected]>
Reviewed-by: Laszlo Ersek <[email protected]>
Reviewed-by: Eric Dong <[email protected]>
2020-11-18 04:52:26 +00:00
Sheng Wei 1a110fcd4e UefiCpuPkg/PiSmmCpuDxeSmm: Correct the Cr3 typo
Change the variable name from mInternalGr3 to mInternalCr3.

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3015

Signed-off-by: Sheng Wei <[email protected]>
Cc: Eric Dong <[email protected]>
Cc: Ray Ni <[email protected]>
Cc: Laszlo Ersek <[email protected]>
Cc: Rahul Kumar <[email protected]>
Cc: Jiewen Yao <[email protected]>
Reviewed-by: Laszlo Ersek <[email protected]>
Reviewed-by: Ray Ni <[email protected]>
Reviewed-by: Eric Dong <[email protected]>
2020-11-18 04:52:26 +00:00
Gao, Zhichao e6a12a0fc8 CryptoPkg: Make the MD5 disable as default for security
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3021

Make the deprecated MD5 disable as default setting for
security.

Cc: Jiewen Yao <[email protected]>
Cc: Jian J Wang <[email protected]>
Cc: Xiaoyu Lu <[email protected]>
Cc: Guomin Jiang <[email protected]>
Signed-off-by: Zhichao Gao <[email protected]>
Reviewed-by: Jiewen Yao <[email protected]>
Message-Id: <[email protected]>
2020-11-17 19:26:50 +00:00
Gao, Zhichao 4ecb1ba5ef NetworkPkg/Defines: Make iSCSI disable as default
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3003

iSCSI is using the deprecated function MD5. It is
better to make the default setting secure. If the platforms
want to use the iSCSI, they should enable it in the platforms'
dsc file and be aware they are using an function with weak
cryptography.

Enable iSCSI in NetworkPkg.dsc for build.

Cc: Jordan Justen <[email protected]>
Cc: Laszlo Ersek <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Sami Mujawar <[email protected]>
Cc: Leif Lindholm <[email protected]>
Cc: Jiewen Yao <[email protected]>
Cc: Jian J Wang <[email protected]>
Cc: Xiaoyu Lu <[email protected]>
Cc: Guomin Jiang <[email protected]>
Cc: Michael D Kinney <[email protected]>
Cc: Kelly Steele <[email protected]>
Cc: Zailiang Sun <[email protected]>
Cc: Yi Qian <[email protected]>
Cc: Liming Gao <[email protected]>
Cc: Maciej Rabeda <[email protected]>
Cc: Jiaxin Wu <[email protected]>
Cc: Siyuan Fu <[email protected]>
Signed-off-by: Zhichao Gao <[email protected]>
Message-Id: <[email protected]>
Reviewed-by: Laszlo Ersek <[email protected]>
Reviewed-by: Siyuan Fu <[email protected]>
Reviewed-by: Maciej Rabeda <[email protected]>
2020-11-17 19:26:50 +00:00
Gao, Zhichao c8b94334ca OvmfPkg/BhyveX64.dsc: Enable MD5 while enable iSCSI
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3003

There is a plan to make MD5 disable as default.
The new MACRO ENABLE_MD5_DEPRECATED_INTERFACES
would be introduced to enable MD5. Make the
definition ahead of the change to avoid build
error after the MACRO changed.

Enable iSCSI.

Signed-off-by: Zhichao Gao <[email protected]>
Cc: Laszlo Ersek <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Leif Lindholm <[email protected]>
Message-Id: <[email protected]>
Reviewed-by: Laszlo Ersek <[email protected]>
Build-tested-by: Laszlo Ersek <[email protected]>
2020-11-17 19:26:50 +00:00
Gao, Zhichao 4e56034b5e OvmfPkg/OvmfXen.dsc: Enable MD5 while enable iSCSI
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3003

There is a plan to make MD5 disable as default.
The new MACRO ENABLE_MD5_DEPRECATED_INTERFACES
would be introduced to enable MD5. Make the
definition ahead of the change to avoid build
error after the MACRO changed.

Enable iSCSI.

Signed-off-by: Zhichao Gao <[email protected]>
Cc: Laszlo Ersek <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Leif Lindholm <[email protected]>
Message-Id: <[email protected]>
Reviewed-by: Laszlo Ersek <[email protected]>
Build-tested-by: Laszlo Ersek <[email protected]>
2020-11-17 19:26:50 +00:00
Gao, Zhichao 0cbf1b772b OvmfPkg/OvmfPkgX64.dsc: Enable MD5 while enable iSCSI
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3003

There is a plan to make MD5 disable as default.
The new MACRO ENABLE_MD5_DEPRECATED_INTERFACES
would be introduced to enable MD5. Make the
definition ahead of the change to avoid build
error after the MACRO changed.

Enable iSCSI.

Signed-off-by: Zhichao Gao <[email protected]>
Cc: Laszlo Ersek <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Leif Lindholm <[email protected]>
Message-Id: <[email protected]>
Reviewed-by: Laszlo Ersek <[email protected]>
Build-tested-by: Laszlo Ersek <[email protected]>
2020-11-17 19:26:50 +00:00
Gao, Zhichao 397f1f4138 OvmfPkg/OvmfPkgIa32X64.dsc: Enable MD5 while enable iSCSI
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3003

There is a plan to make MD5 disable as default.
The new MACRO ENABLE_MD5_DEPRECATED_INTERFACES
would be introduced to enable MD5. Make the
definition ahead of the change to avoid build
error after the MACRO changed.

Enable iSCSI.

Signed-off-by: Zhichao Gao <[email protected]>
Cc: Laszlo Ersek <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Leif Lindholm <[email protected]>
Message-Id: <[email protected]>
Reviewed-by: Laszlo Ersek <[email protected]>
Build-tested-by: Laszlo Ersek <[email protected]>
2020-11-17 19:26:50 +00:00
Gao, Zhichao a2dd544f85 OvmfPkg/OvmfPkgIa32.dsc: Enable MD5 while enable iSCSI
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3003

There is a plan to make MD5 disable as default.
The new MACRO ENABLE_MD5_DEPRECATED_INTERFACES
would be introduced to enable MD5. Make the
definition ahead of the change to avoid build
error after the MACRO changed.

Enable iSCSI.

Signed-off-by: Zhichao Gao <[email protected]>
Cc: Laszlo Ersek <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Leif Lindholm <[email protected]>
Message-Id: <[email protected]>
Reviewed-by: Laszlo Ersek <[email protected]>
Build-tested-by: Laszlo Ersek <[email protected]>
2020-11-17 19:26:50 +00:00
Gao, Zhichao 99e5cf5574 ArmVirtPkg/ArmVirtQemuKernel.dsc: Enable MD5 while enable iSCSI
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3003

There is a plan to make MD5 disable as default.
The new MACRO ENABLE_MD5_DEPRECATED_INTERFACES
would be introduced to enable MD5. Make the
definition ahead of the change to avoid build
error after the MACRO changed.

Enable iSCSI.

Signed-off-by: Zhichao Gao <[email protected]>
Cc: Laszlo Ersek <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Leif Lindholm <[email protected]>
Message-Id: <[email protected]>
Reviewed-by: Laszlo Ersek <[email protected]>
2020-11-17 19:26:50 +00:00
Gao, Zhichao be7dc48727 ArmVirtPkg/ArmVirtQemu.dsc: Enable MD5 while enable iSCSI
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3003

There is a plan to make MD5 disable as default.
The new MACRO ENABLE_MD5_DEPRECATED_INTERFACES
would be introduced to enable MD5. Make the
definition ahead of the change to avoid build
error after the MACRO changed.

Enable iSCSI.

Signed-off-by: Zhichao Gao <[email protected]>
Cc: Laszlo Ersek <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Leif Lindholm <[email protected]>
Message-Id: <[email protected]>
Reviewed-by: Laszlo Ersek <[email protected]>
Build-tested-by: Laszlo Ersek <[email protected]>
2020-11-17 19:26:50 +00:00
Gao, Zhichao 1aa2cf0521 NetworkPkg: Enable MD5 while enable iSCSI
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3003

There is a plan to make MD5 disable as default.
The new MACRO ENABLE_MD5_DEPRECATED_INTERFACES
would be introduced to enable MD5. Make the
definition ahead of the change to avoid build
error after the MACRO changed.
1. Add the NetworkBuildOptions.dsc.inc to define
the MACRO for build (support: GCC, INTEL, MSFT and
RVCT)
2. Add the BuildOption file to Network.dsc.inc

Cc: Maciej Rabeda <[email protected]>
Cc: Jiaxin Wu <[email protected]>
Cc: Siyuan Fu <[email protected]>
Signed-off-by: Zhichao Gao <[email protected]>
Message-Id: <[email protected]>
[[email protected]: clean up comments in "NetworkBuildOptions.dsc.inc"]
[[email protected]: hoist "BuildOptions" above "Components" in
 "Network.dsc.inc" for bug compat with edk2-platforms]
Reviewed-by: Laszlo Ersek <[email protected]>
Reviewed-by: Siyuan Fu <[email protected]>
2020-11-17 19:26:50 +00:00
Gao, Zhichao d3d560e0f0 CryptoPkg/dsc: Enable MD5 when CRYPTO_SERVICES enable MD5
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3021

CRYPTO_SERVICES PACKAGES and ALL config would enable MD5
function. So explicitly enable MD5 while CRYPTO_SERVICES
are set PACKAGES and ALL.

Cc: Jiewen Yao <[email protected]>
Cc: Jian J Wang <[email protected]>
Cc: Xiaoyu Lu <[email protected]>
Cc: Guomin Jiang <[email protected]>
Cc: Laszlo Ersek <[email protected]>
Signed-off-by: Zhichao Gao <[email protected]>
Message-Id: <[email protected]>
Reviewed-by: Laszlo Ersek <[email protected]>
2020-11-17 19:26:50 +00:00
Gao, Zhichao fedd32d82f SecurityPkg/Hash2DxeCrypto: Remove SHA1 support
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3027

Remove the deprecated SHA1 support of Hash2DxeCrypto
driver.

Cc: Jiewen Yao <[email protected]>
Cc: Jian J Wang <[email protected]>
Signed-off-by: Zhichao Gao <[email protected]>
Reviewed-by: Jiewen Yao <[email protected]>
Message-Id: <[email protected]>
2020-11-17 19:26:50 +00:00
Gao, Zhichao 0a1b6d0be3 SecurityPkg/Hash2DxeCrypto: Remove MD5 support
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3027

Remove the deprecated MD5 support of Hash2DxeCrypto
driver.

Cc: Jiewen Yao <[email protected]>
Cc: Jian J Wang <[email protected]>
Signed-off-by: Zhichao Gao <[email protected]>
Reviewed-by: Jiewen Yao <[email protected]>
Message-Id: <[email protected]>
2020-11-17 19:26:50 +00:00
Michael D Kinney 29d59baa39 MdePkg/IndustryStandard: Fix CXL 1.1 structure layout issues
https://bugzilla.tianocore.org/show_bug.cgi?id=3074

* Fix offset of LinkLayerControlAndStatus in the
  CXL_1_1_LINK_CAPABILITY_STRUCTURE structure
* Fix offset of LinkLayerAckTimerControl in the
  CXL_1_1_LINK_CAPABILITY_STRUCTURE structure
* Fix offset of LinkLayerDefeature in
  the CXL_1_1_LINK_CAPABILITY_STRUCTURE structure
* Add CXL_11_SIZE_ASSERT() macro to verify the size of
  a register layout structure at compile time and use
  it to verify the sizes of the CXL 1.1 register structures.
* Add CXL_11_OFFSET_ASSERT() macro to verify the offset of
  fields in a register layout structure at compiler time and
  use it to verify the offset of fields in CXL 1.1
  register structures.

Cc: Liming Gao <[email protected]>
Cc: Zhiguang Liu <[email protected]>
Cc: Ashraf Javeed <[email protected]>
Signed-off-by: Michael D Kinney <[email protected]>
Reviewed-by: Zhiguang Liu <[email protected]>
Reviewed-by: Ashraf Javeed <[email protected]>
2020-11-17 01:57:22 +00:00
Bret Barkelew 124b3f9289 MdeModulePkg: Drop VarLock from RuntimeDxe variable driver
https://bugzilla.tianocore.org/show_bug.cgi?id=2522

Now that everything should be moved to
VariablePolicy, drop support for the
deprecated VarLock SMI interface and
associated functions from variable RuntimeDxe.

Cc: Jian J Wang <[email protected]>
Cc: Hao A Wu <[email protected]>
Cc: Liming Gao <[email protected]>
Cc: Bret Barkelew <[email protected]>
Signed-off-by: Bret Barkelew <[email protected]>
Reviewed-by: Dandan Bi <[email protected]>
Acked-by: Jian J Wang <[email protected]>
2020-11-17 01:03:43 +00:00
Bret Barkelew 98ee0c68a2 MdeModulePkg: Change TCG MOR variables to use VariablePolicy
https://bugzilla.tianocore.org/show_bug.cgi?id=2522

These were previously using VarLock, which is
being deprecated.

Cc: Jian J Wang <[email protected]>
Cc: Hao A Wu <[email protected]>
Cc: Liming Gao <[email protected]>
Cc: Bret Barkelew <[email protected]>
Signed-off-by: Bret Barkelew <[email protected]>
Reviewed-by: Dandan Bi <[email protected]>
Acked-by: Jian J Wang <[email protected]>
2020-11-17 01:03:43 +00:00
Bret Barkelew 28f4616fde SecurityPkg: Allow VariablePolicy state to delete authenticated variables
https://bugzilla.tianocore.org/show_bug.cgi?id=2522

Causes AuthService to check
IsVariablePolicyEnabled() before enforcing
write protections to allow variable deletion
when policy engine is disabled.

Only allows deletion, not modification.

Cc: Jiewen Yao <[email protected]>
Cc: Jian J Wang <[email protected]>
Cc: Chao Zhang <[email protected]>
Cc: Bret Barkelew <[email protected]>
Signed-off-by: Bret Barkelew <[email protected]>
Reviewed-by: Dandan Bi <[email protected]>
Acked-by: Jian J Wang <[email protected]>
2020-11-17 01:03:43 +00:00
Bret Barkelew e176bafc9d MdeModulePkg: Allow VariablePolicy state to delete protected variables
https://bugzilla.tianocore.org/show_bug.cgi?id=2522

TcgMorLockSmm provides special protections for
the TCG MOR variables. This will check
IsVariablePolicyEnabled() before enforcing
them to allow variable deletion when policy
engine is disabled.

Only allows deletion, not modification.

Cc: Jian J Wang <[email protected]>
Cc: Hao A Wu <[email protected]>
Cc: Liming Gao <[email protected]>
Cc: Bret Barkelew <[email protected]>
Signed-off-by: Bret Barkelew <[email protected]>
Reviewed-by: Dandan Bi <[email protected]>
Acked-by: Jian J Wang <[email protected]>
2020-11-17 01:03:43 +00:00
Bret Barkelew b6490426e3 MdeModulePkg: Connect VariablePolicy business logic to VariableServices
https://bugzilla.tianocore.org/show_bug.cgi?id=2522

VariablePolicy is an updated interface to
replace VarLock and VarCheckProtocol.

Add connective code to publish the VariablePolicy protocol
and wire it to either the SMM communication interface
or directly into the VariablePolicyLib business logic.

Cc: Jian J Wang <[email protected]>
Cc: Hao A Wu <[email protected]>
Cc: Liming Gao <[email protected]>
Cc: Bret Barkelew <[email protected]>
Signed-off-by: Bret Barkelew <[email protected]>
Reviewed-by: Dandan Bi <[email protected]>
Acked-by: Jian J Wang <[email protected]>
Reviewed-by: Liming Gao <[email protected]>
2020-11-17 01:03:43 +00:00
Bret Barkelew d49fe0ca20 UefiPayloadPkg: Add VariablePolicy engine to UefiPayloadPkg platform
https://bugzilla.tianocore.org/show_bug.cgi?id=2522

Cc: Maurice Ma <[email protected]>
Cc: Guo Dong <[email protected]>
Cc: Benjamin You <[email protected]>
Cc: Bret Barkelew <[email protected]>
Signed-off-by: Bret Barkelew <[email protected]>
Reviewed-by: Maurice Ma <[email protected]>
2020-11-17 01:03:43 +00:00
Bret Barkelew e691d80e37 ArmVirtPkg: Add VariablePolicy engine to ArmVirtPkg platform
https://bugzilla.tianocore.org/show_bug.cgi?id=2522

Cc: Laszlo Ersek <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Leif Lindholm <[email protected]>
Cc: Bret Barkelew <[email protected]>
Signed-off-by: Bret Barkelew <[email protected]>
Reviewed-by: Laszlo Ersek <[email protected]>
2020-11-17 01:03:43 +00:00
Bret Barkelew 61a85646eb EmulatorPkg: Add VariablePolicy engine to EmulatorPkg platform
https://bugzilla.tianocore.org/show_bug.cgi?id=2522

Cc: Jordan Justen <[email protected]>
Cc: Andrew Fish <[email protected]>
Cc: Ray Ni <[email protected]>
Cc: Bret Barkelew <[email protected]>
Signed-off-by: Bret Barkelew <[email protected]>
Reviewed-by: Ray Ni <[email protected]>
2020-11-17 01:03:43 +00:00
Bret Barkelew 435a05aff5 OvmfPkg: Add VariablePolicy engine to OvmfPkg platform
https://bugzilla.tianocore.org/show_bug.cgi?id=2522

Cc: Jordan Justen <[email protected]>
Cc: Laszlo Ersek <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Bret Barkelew <[email protected]>
Signed-off-by: Bret Barkelew <[email protected]>
Reviewed-by: Laszlo Ersek <[email protected]>
2020-11-17 01:03:43 +00:00
Bret Barkelew 483449c9da MdeModulePkg: Define the VarCheckPolicyLib and SMM interface
https://bugzilla.tianocore.org/show_bug.cgi?id=2522

VariablePolicy is an updated interface to
replace VarLock and VarCheckProtocol.

This is an instance of a VarCheckLib that is backed by the
VariablePolicyLib business logic. It also publishes the SMM
calling interface for messages from the DXE protocol.

Cc: Jian J Wang <[email protected]>
Cc: Hao A Wu <[email protected]>
Cc: Liming Gao <[email protected]>
Cc: Bret Barkelew <[email protected]>
Signed-off-by: Bret Barkelew <[email protected]>
Reviewed-by: Dandan Bi <[email protected]>
Acked-by: Jian J Wang <[email protected]>
2020-11-17 01:03:43 +00:00
Bret Barkelew b6104becb9 MdeModulePkg: Define the VariablePolicyHelperLib
https://bugzilla.tianocore.org/show_bug.cgi?id=2522

VariablePolicy is an updated interface to
replace VarLock and VarCheckProtocol.

Add the VariablePolicyHelperLib library, containing
several functions to help with the repetitive process
of creating a correctly structured and packed
VariablePolicy entry.

Cc: Jian J Wang <[email protected]>
Cc: Hao A Wu <[email protected]>
Cc: Liming Gao <[email protected]>
Cc: Bret Barkelew <[email protected]>
Signed-off-by: Bret Barkelew <[email protected]>
Reviewed-by: Dandan Bi <[email protected]>
Acked-by: Jian J Wang <[email protected]>
2020-11-17 01:03:43 +00:00
Bret Barkelew 355b181f74 MdeModulePkg: Define the VariablePolicyLib
https://bugzilla.tianocore.org/show_bug.cgi?id=2522

VariablePolicy is an updated interface to
replace VarLock and VarCheckProtocol.

Add the VariablePolicyLib library that implements
the portable business logic for the VariablePolicy
engine.

Also add host-based CI test cases for the lib.

Cc: Jian J Wang <[email protected]>
Cc: Hao A Wu <[email protected]>
Cc: Liming Gao <[email protected]>
Cc: Bret Barkelew <[email protected]>
Signed-off-by: Bret Barkelew <[email protected]>
Reviewed-by: Dandan Bi <[email protected]>
Acked-by: Jian J Wang <[email protected]>
2020-11-17 01:03:43 +00:00
Bret Barkelew d11e235976 MdeModulePkg: Define the VariablePolicy protocol interface
https://bugzilla.tianocore.org/show_bug.cgi?id=2522

VariablePolicy is an updated interface to
replace VarLock and VarCheckProtocol.

Add the VariablePolicy protocol interface
header and add to the MdeModulePkg.dec file.

Cc: Jian J Wang <[email protected]>
Cc: Hao A Wu <[email protected]>
Cc: Liming Gao <[email protected]>
Cc: Bret Barkelew <[email protected]>
Signed-off-by: Bret Barkelew <[email protected]>
Reviewed-by: Dandan Bi <[email protected]>
Acked-by: Jian J Wang <[email protected]>
2020-11-17 01:03:43 +00:00
Maurice Ma d448574e73 IntelFsp2Pkg: Fix FSP binary rebasing issue for PE32+ image
Current FSP rebasing script SplitFspBin.py has support for both
PE32 and PE32+ image formats. However, while updating the ImageBase
field in the image header, it always assumed the ImageBase field is
32bit long. Since PE32+ image format defined ImageBase as 64bit,
the current script will only update the lower 32bit value and leave
the upper 32bit untouched. It does not work well for PE32+ image
that requires update in the upper 32bit ImageBase field. The
expected behavior is to update the full 64bit field. This patch
implemented this fix.

Signed-off-by: Maurice Ma <[email protected]>

Cc: Chasel Chiu <[email protected]>
Cc: Nate DeSimone <[email protected]>
Cc: Star Zeng <[email protected]>
Reviewed-by: Chasel Chiu <[email protected]>
Reviewed-by: Star Zeng <[email protected]>
Reviewed-by: Nate DeSimone <[email protected]>
2020-11-15 00:17:18 +00:00