Граф коммитов

32699 Коммитов

Автор SHA1 Сообщение Дата
dependabot[bot] 228f338bf6
pip: bump regex from 2024.9.11 to 2024.11.6 (#254)
Bumps [regex](https://github.com/mrabarnett/mrab-regex) from 2024.9.11
to 2024.11.6.

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-13 09:26:02 -08:00
Project Mu UEFI Bot [bot] d62dcfa781
Repo File Sync: Add Release Branch Backport Workflow (#253)
synced local file(s) with
[microsoft/mu_devops](https://github.com/microsoft/mu_devops).

🤖: View the [Repo File Sync Configuration
File](https://github.com/microsoft/mu_devops/blob/main/.sync/Files.yml)
to see how files are synced.

---

This PR was created automatically by the
[repo-file-sync-action](https://github.com/BetaHuhn/repo-file-sync-action)
workflow run
[#11631955745](https://github.com/microsoft/mu_devops/actions/runs/11631955745)

Signed-off-by: Project Mu UEFI Bot <uefibot@microsoft.com>
2024-11-01 11:53:43 -04:00
kenlautner 7522aa1462
Convert line endings to CRLF (#246)
## Description

Convert line endings to CRLF so we are compliant with the
LineEndingCheck plugin.

For details on how to complete to complete these options and their
meaning refer to
[CONTRIBUTING.md](https://github.com/microsoft/mu/blob/HEAD/CONTRIBUTING.md).

- [ ] Impacts functionality?
- [ ] Impacts security?
- [ ] Breaking change?
- [ ] Includes tests?
- [ ] Includes documentation?

## How This Was Tested

N/A

## Integration Instructions

N/A
2024-10-29 15:41:07 -07:00
dependabot[bot] fea135cd7e
pip: update edk2-pytool-extensions requirement from ~=0.27.12 to ~=0.28.0 (#249)
Updates the requirements on
[edk2-pytool-extensions](https://github.com/tianocore/edk2-pytool-extensions)
to permit the latest version.

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-28 21:40:03 -07:00
dependabot[bot] 6fde7d9356
pip: bump edk2-pytool-library from 0.21.12 to 0.22.2 (#251)
Bumps
[edk2-pytool-library](https://github.com/tianocore/edk2-pytool-library)
from 0.21.12 to 0.22.2.

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Aaron <aaronpop@microsoft.com>
2024-10-28 19:55:49 -07:00
Project Mu UEFI Bot [bot] 526ea8485b
Repo File Sync: synced file(s) with microsoft/mu_devops (#252)
synced local file(s) with
[microsoft/mu_devops](https://github.com/microsoft/mu_devops).

🤖: View the [Repo File Sync Configuration
File](https://github.com/microsoft/mu_devops/blob/main/.sync/Files.yml)
to see how files are synced.



---

This PR was created automatically by the
[repo-file-sync-action](https://github.com/BetaHuhn/repo-file-sync-action)
workflow run
[#11550649555](https://github.com/microsoft/mu_devops/actions/runs/11550649555)

Signed-off-by: Project Mu UEFI Bot <uefibot@microsoft.com>
2024-10-28 09:33:38 -07:00
dependabot[bot] 9eb544f8ec
pip: bump edk2-pytool-library from 0.21.11 to 0.21.12 (#248)
Bumps
[edk2-pytool-library](https://github.com/tianocore/edk2-pytool-library)
from 0.21.11 to 0.21.12.

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-02 08:22:11 -07:00
dependabot[bot] c223c23921
pip: update edk2-pytool-extensions requirement from ~=0.27.11 to ~=0.27.12 (#245)
Updates the requirements on
[edk2-pytool-extensions](https://github.com/tianocore/edk2-pytool-extensions)
to permit the latest version.

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Michael Kubacki <michael.kubacki@microsoft.com>
2024-09-24 08:46:00 -07:00
dependabot[bot] 61ea59f50a
pip: bump edk2-pytool-library from 0.21.10 to 0.21.11 (#243)
Bumps
[edk2-pytool-library](https://github.com/tianocore/edk2-pytool-library)
from 0.21.10 to 0.21.11.

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-24 09:42:15 -04:00
Project Mu UEFI Bot [bot] 7652b9f7fc
Repo File Sync: synced file(s) with microsoft/mu_devops (#247)
synced local file(s) with
[microsoft/mu_devops](https://github.com/microsoft/mu_devops).

🤖: View the [Repo File Sync Configuration
File](https://github.com/microsoft/mu_devops/blob/main/.sync/Files.yml)
to see how files are synced.

---

This PR was created automatically by the
[repo-file-sync-action](https://github.com/BetaHuhn/repo-file-sync-action)
workflow run
[#11004666094](https://github.com/microsoft/mu_devops/actions/runs/11004666094)

Signed-off-by: Project Mu UEFI Bot <uefibot@microsoft.com>
2024-09-23 22:27:05 -04:00
dependabot[bot] e623847c5d
pip: bump regex from 2024.7.24 to 2024.9.11 (#244)
Bumps [regex](https://github.com/mrabarnett/mrab-regex) from 2024.7.24
to 2024.9.11.

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-23 22:21:48 -04:00
Aaron c9a59e8743
pip: Update all pip-requirements to latest (#236)
## Description

edk2-pytool-library from 0.21.8 to 0.21.10
edk2-pytool-extensions from 0.27.10 to 0.27.11
antlr4-python3-runtime from 4.13.1 to 4.13.2
regex from floating to 2024.7.24

- [ ] Impacts functionality?
- [ ] Impacts security?
- [ ] Breaking change?
- [ ] Includes tests?
- [ ] Includes documentation?

## How This Was Tested
CI.

## Integration Instructions
N/A
2024-08-23 20:00:44 -07:00
Project Mu UEFI Bot [bot] 693eef0833
Repo File Sync: 202405 Branch Transition Updates. (#235)
synced local file(s) with
[microsoft/mu_devops](https://github.com/microsoft/mu_devops).

🤖: View the [Repo File Sync Configuration
File](https://github.com/microsoft/mu_devops/blob/main/.sync/Files.yml)
to see how files are synced.



---

This PR was created automatically by the
[repo-file-sync-action](https://github.com/BetaHuhn/repo-file-sync-action)
workflow run
[#10532319094](https://github.com/microsoft/mu_devops/actions/runs/10532319094)

Signed-off-by: Project Mu UEFI Bot <uefibot@microsoft.com>
2024-08-23 19:30:13 -07:00
Michael Kubacki 94de8b6008 IntelSiliconPkg: CodeQL Fixes.
Makes integer width consistent in loop conditions and explicitly
checks for NULL pointers in some places.
2024-08-23 13:54:08 -07:00
Michael Kubacki 8a447c298c IntelFsp2WrapperPkg: CodeQL Fixes.
Makes integer width consistent in loop conditions and explicitly
checks for NULL pointers in some places.
2024-08-23 13:54:08 -07:00
Michael Kubacki 30ab8f388b SiltelFsp2Pkg: CodeQL Fixes.
Makes integer width consistent in loop conditions and explicitly
checks for NULL pointers in some places.
2024-08-23 13:54:08 -07:00
Aaron 33035d753e
Updated Release Notes. (#231)
## Description

Update release notes for 202405.

- [ ] Impacts functionality?
- [ ] Impacts security?
- [ ] Breaking change?
- [ ] Includes tests?
- [x] Includes documentation?

## How This Was Tested
N/A

## Integration Instructions
N/A
2024-08-22 12:58:46 -07:00
Aaron ba60b70512
IntelSiliconPkg: Add FitQueryLib. (#229)
## Description

Adding the FitQueryLib.

e745f2edef
81a13d34f7
4f818e32a6

- [ ] Impacts functionality?
- [ ] Impacts security?
- [ ] Breaking change?
- [x] Includes tests?
- [ ] Includes documentation?

## How This Was Tested
Local CI.

## Integration Instructions
N/A

Co-authored-by: Bret Barkelew <bret.barkelew@microsoft.com>
2024-08-13 17:24:24 +00:00
Michael Kubacki a116e056c5 IntelSiliconPkg: Add BaseSmmAccessLibNull
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3540

Adds a NULL instance of SmmAccessLib.

Cc: Ray Ni <ray.ni@intel.com>
Cc: Rangasai V Chaganty <rangasai.v.chaganty@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2024-08-12 10:27:09 -07:00
Aaron 24bbc74b68
Fixing CI break for new version of mu_tiano_plus. (#225)
## Description

MU_TIANO_PLUS modified Tpm2DeviceLibDTpm to require Tpm2DebugLib, and
created Tpm2DebugLib.

Initial CI could not bring in Tpm2DebugLib in IntelFsp2WrapperPkg
because it did not exist at that time.

828318308d

- [ ] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [ ] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

## How This Was Tested
Local CI on IntelFsp2WrapperPkg is passing after this change. Failing
prior with `Instance of library class [Tpm2DebugLib] is not found`.

## Integration Instructions
N/A
2024-08-01 11:35:56 -07:00
Aaron Antone b5a69029b9 Delay IOMMU Install until DMAR is available 2024-07-30 16:45:21 -07:00
John Schock ff5d34d8cd Add stuart path_env for FSP tools
Add a path_env descriptor for FSP tools, which allow FSP tools to be
used directly by the build.
2024-07-19 15:07:30 -07:00
Michael Kubacki 0beecf6171 IntelSiliconPkg/PeiSmmAccessLibSmramc: Use consistent integer width
Fixes #104

Updates the code in this library instance (`PeiSmmAccessLibSmramc`)
to have the same integer width fixes already in the other library
instance (`PeiSmmAccessLib`).

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2024-07-19 15:07:30 -07:00
Michael Kubacki 291fded76a Temporary: Disable CodeQL
Disables the CodeQL plugin to prevent results being sent to GitHub
prior to 2405 CodeQL changes being added.

This commit should be reverted when those changes are added.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2024-07-16 15:34:05 -04:00
Michael Kubacki e4035e0bc0 Enable CI
The minimal changes to get most feature agnostic CI enabled and
similar to the results that would have been produced in the
release/202311 branch.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2024-07-16 15:34:05 -04:00
Michael Kubacki 63c480a0bf Mu compiler fixes
Changes for building with supported toolchains.

Co-authored-by: Ken Lautner <klautner@microsoft.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2024-07-16 15:34:05 -04:00
Michael Kubacki 8db9edf829 Mu DSC Changes
Updates DSC files to build with current Mu changes to pass CI.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2024-07-16 15:34:05 -04:00
Michael Kubacki b93c7de068 Fix line endings in repo
Necessary to allow a comparison to the previous release branch.

Should be redone on each new release branch.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2024-07-16 15:34:05 -04:00
Michael Kubacki 860e639a5f IntelSiliconPkg: Apply Uncrustify
Since uncrustify is not run upstream, this change runs it to make
the changes comparable to the previous Mu branch.

This should be run again on new release branches.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2024-07-16 15:34:05 -04:00
Ken Lautner f5e2c6dd2b Updated readme for latest MU release and to match conventions 2024-07-15 09:15:08 -07:00
Bret Barkelew 63f06f6c95 TCMORPH: Remove unused packages from Tiano (command in comments).
1) Update .gitignore with an accurate list of files we don't want.
2) git ls-files -c -i --exclude-from=.gitignore | xargs git rm --cached
3) Above command must be issued from Git Bash, not PowerShell et al.
2024-07-15 08:42:48 -07:00
Ken Lautner e433c807fc Merge branch 'upstream-edk2-platforms' into upstream 2024-07-15 08:36:44 -07:00
Liqi Liu b95a4bc43b Silicon/Intel/FitGen:FIT change for FBM entry.
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=4621

1)Refer to FIT spec change, add a new entry in FIT table -
FSP Boot Manifest(Type 0xD) to store the location of FBM.
2)We found that 0xD was occupied by FIT_TABLE_TYPE_BIOS_DATA_AREA.
But all FIT specs in archive show record 0xD as reserved.After
confirming with architect,we will use 0xD for FBM and update
FitGen.c accordingly.

Reviewed-by: Yuwei Chen <yuwei.chen@intel.com>
Signed-off-by: Liqi Liu <liqi.liu@intel.com>
Cc: Chen Christine <yuwei.chen@intel.com>
Cc: Feng Bob C <bob.c.feng@intel.com>
Cc: Chagnanty Rangasai V <rangasai.v.chaganty@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
2024-07-15 08:35:20 -07:00
Sheng Wei 53b6bc93ed IntelSiliconPkg/VTd: Reset the one-shot bits before modifing GCMD_REG
Here is the process of modify GCMD_REG.
  Read GSTS_REG
  Reset the one-shot bits.
  Modify the target comamnd value.
  Write the command value to GCMD_REG.
  Wait until GSTS_REG indicates command is serviced.

Reviewed-by: Jenny Huang <jenny.huang@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Rangasai V Chaganty <rangasai.v.chaganty@intel.com>
Signed-off-by: Sheng Wei <w.sheng@intel.com>
2024-07-15 08:35:20 -07:00
Sheng Wei e582d0dd82 IntelSiliconPkg/VTd: Remove ASSERT in VTdSetAttribute
When PcdVTdPolicyPropertyMask BIT2 is set and ACPI DMAR table is not ready,
It is no need to hit an assert, and just returns EFI_NOT_READY.

Reviewed-by : Jenny Huang <jenny.huang@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Rangasai V Chaganty <rangasai.v.chaganty@intel.com>
Cc: Chiang Chris <chris.chiang@intel.com>
Signed-off-by: Sheng Wei <w.sheng@intel.com>
2024-07-15 08:35:20 -07:00
Ken Lautner c84eb9d4c1 Merge commit '3e722403cd16388a0e4044e705a2b34c841d76ca' into upstream 2024-07-15 08:31:09 -07:00
Ard Biesheuvel 3e722403cd ArmVirtPkg/ArmVirtQemu: Add RngDxe driver
Add the RngDxe driver to the build, backed by either RNDR or TRNG, one
of which is expected to be available in most cases:
- RNDR is implemented by the 'max' CPU that QEMU implements in TCG mode
- TRNG is implemented by the KVM hypervisor, which backs QEMU's 'host'
  CPU

Other TCG modes (e.g., the 'cortex-a*' CPUs) implement neither, which
should prevent the RngDxe driver from dispatching entirely, resulting
in the same situation as before.

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>

Committed-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Doug Flick [MSFT] <doug.edk2@gmail.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2024-05-24 15:48:52 +00:00
Ard Biesheuvel 66c69871e7 ArmVirtPkg: Reverse inclusion order of MdeLibs.inc and ArmVirt.dsc.inc
MdeLibs.inc sets default library class resolutions which are much more
general than the ones that might be specified in ArmVirt.dsc.inc. So the
latter should be included *after* MdeLibs.inc to ensure that its
definitions take precedence.

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>

Committed-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Doug Flick [MSFT] <doug.edk2@gmail.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2024-05-24 15:48:52 +00:00
Ard Biesheuvel c98f7f7550 ArmVirtPkg: Use dynamic PCD to set the SMCCC conduit
On ARM systems, whether SMC or HVC instructions need to be used to issue
monitor calls is typically dependent on the exception level, but there
are also cases where EL1 might use SMC instructions, so there is no hard
and fast rule.

For ArmVirtQemu, this does depend strictly on the exception level, so
set the default to HVC (for EL1 execution) and override it to SMC when
booted at EL2.

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>

Committed-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Doug Flick [MSFT] <doug.edk2@gmail.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2024-05-24 15:48:52 +00:00
Ard Biesheuvel 865229bcc8 ArmVirtPkg/ArmVirtQemu: Permit the use of dynamic PCDs in PEI
Currently, only TPM2 builds enable the PCD PEIM, which is a prerequisite
for being able to use dynamic PCDs already at the PEI stage. This
facility will be used for other reasons too so move those pieces out of
code block that are conditional on TPM2_ENABLE

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>

Committed-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Doug Flick [MSFT] <doug.edk2@gmail.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2024-05-24 15:48:52 +00:00
Ard Biesheuvel 4ddf2448ed MdePkg/BaseRngLib AARCH64: Remove overzealous ASSERT()
BaseRngLib on AARCH64 will discover whether or not RNDR instructions are
supported, by inspecting the ISAR0 identification register, and setting
a global boolean accordingly. This boolean is used in subsequent
execution to decide whether or not to issue the instruction.

The same discovery code also ASSERT()s that RNDR instructions are
implemented, which is unnecessary, and breaks execution on systems that
incorporate the library but don't implement the instruction (or fail to
expose it to the exception level that the firmware executes at).

So drop the ASSERT().

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>

Committed-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Doug Flick [MSFT] <doug.edk2@gmail.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2024-05-24 15:48:52 +00:00
Flickdm 9440986d4e ArmVirtPkg: Move PcdMonitorConduitHvc
This moves the PcdMonitorConduitHvc from PcdsFeatureFlag.Common to
PcdsFixedAtBuild.Common

This is a follow on to the previous commit:
ArmPkg: Allow SMC/HVC monitor conduit to be specified at runtime

ArmVirtQemu may execute at EL2, in which case monitor calls are
generally made using SMC instructions instead of HVC instructions.

Whether or not this is the case can only be decided at runtime, and so
the associated PCD needs to be settable at runtime, if the platform
definition chooses so. This implies a boolean PCD, given that a feature
PCD is build-time configurable only.

Cc: Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Sami Mujawar <sami.mujawar@arm.com>

Signed-off-by: Doug Flick [MSFT] <doug.edk2@gmail.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2024-05-24 15:48:52 +00:00
Ard Biesheuvel 32460bb5b1 ArmPkg: Allow SMC/HVC monitor conduit to be specified at runtime
ArmVirtQemu may execute at EL2, in which case monitor calls are
generally made using SMC instructions instead of HVC instructions.

Whether or not this is the case can only be decided at runtime, and so
the associated PCD needs to be settable at runtime, if the platform
definition chooses so. This implies a boolean PCD, given that a feature
PCD is build-time configurable only.

Cc: Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Sami Mujawar <sami.mujawar@arm.com>

Committed-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Doug Flick [MSFT] <doug.edk2@gmail.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2024-05-24 15:48:52 +00:00
Doug Flick 207b6d68a0 NetworkPkg: Update the PxeBcDhcp6GoogleTest due to underlying changes
This patch updates the PxeBcDhcp6GoogleTest due to the changes in the
underlying code. The changes are as follows:
 - Random now comes from the RngLib Protocol
 - The TCP ISN is now generated by the hash function

Cc: Saloni Kasbekar <saloni.kasbekar@intel.com>
Cc: Zachary Clark-williams <zachary.clark-williams@intel.com>

Signed-off-by: Doug Flick [MSFT] <doug.edk2@gmail.com>
Reviewed-by: Saloni Kasbekar <saloni.kasbekar@intel.com>
2024-05-24 15:48:52 +00:00
Doug Flick dff3d3811f MdePkg: Add MockHash2 Protocol for testing
This commit adds a new MockHash2 protocol to the MdePkg. This allows
the unit tests to pick up the new protocol and use it for testing.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>

Signed-off-by: Doug Flick [MSFT] <doug.edk2@gmail.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2024-05-24 15:48:52 +00:00
Doug Flick 4afb939531 MdePkg: Adds Protocol for MockRng
This patch adds a protocol for MockRng. This protocol is used to
mock the Rng protocol for testing purposes.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>

Signed-off-by: Doug Flick [MSFT] <doug.edk2@gmail.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2024-05-24 15:48:52 +00:00
Doug Flick 72a9ef1c8a MdePkg: Add MockUefiBootServicesTableLib
This commit adds a mock library for UefiBootServicesTableLib.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>

Signed-off-by: Doug Flick [MSFT] <doug.edk2@gmail.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2024-05-24 15:48:52 +00:00
Doug Flick 1904a64bcc NetworkPkg TcpDxe: SECURITY PATCH CVE-2023-45236
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4541
REF: https://www.rfc-editor.org/rfc/rfc1948.txt
REF: https://www.rfc-editor.org/rfc/rfc6528.txt
REF: https://www.rfc-editor.org/rfc/rfc9293.txt

Bug Overview:
PixieFail Bug #8
CVE-2023-45236
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:N/A:N
CWE-200 Exposure of Sensitive Information to an Unauthorized Actor

Updates TCP ISN generation to use a cryptographic hash of the
connection's identifying parameters and a secret key.
This prevents an attacker from guessing the ISN used for some other
connection.

This is follows the guidance in RFC 1948, RFC 6528, and RFC 9293.

RFC: 9293 Section 3.4.1.  Initial Sequence Number Selection

   A TCP implementation MUST use the above type of "clock" for clock-
   driven selection of initial sequence numbers (MUST-8), and SHOULD
   generate its initial sequence numbers with the expression:

   ISN = M + F(localip, localport, remoteip, remoteport, secretkey)

   where M is the 4 microsecond timer, and F() is a pseudorandom
   function (PRF) of the connection's identifying parameters ("localip,
   localport, remoteip, remoteport") and a secret key ("secretkey")
   (SHLD-1).  F() MUST NOT be computable from the outside (MUST-9), or
   an attacker could still guess at sequence numbers from the ISN used
   for some other connection.  The PRF could be implemented as a
   cryptographic hash of the concatenation of the TCP connection
   parameters and some secret data.  For discussion of the selection of
   a specific hash algorithm and management of the secret key data,
   please see Section 3 of [42].

   For each connection there is a send sequence number and a receive
   sequence number.  The initial send sequence number (ISS) is chosen by
   the data sending TCP peer, and the initial receive sequence number
   (IRS) is learned during the connection-establishing procedure.

   For a connection to be established or initialized, the two TCP peers
   must synchronize on each other's initial sequence numbers.  This is
   done in an exchange of connection-establishing segments carrying a
   control bit called "SYN" (for synchronize) and the initial sequence
   numbers.  As a shorthand, segments carrying the SYN bit are also
   called "SYNs".  Hence, the solution requires a suitable mechanism for
   picking an initial sequence number and a slightly involved handshake
   to exchange the ISNs.

Cc: Saloni Kasbekar <saloni.kasbekar@intel.com>
Cc: Zachary Clark-williams <zachary.clark-williams@intel.com>

Signed-off-by: Doug Flick [MSFT] <doug.edk2@gmail.com>
Reviewed-by: Saloni Kasbekar <saloni.kasbekar@intel.com>
2024-05-24 15:48:52 +00:00
Doug Flick 4c4ceb2ceb NetworkPkg: SECURITY PATCH CVE-2023-45237
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=4542

Bug Overview:
PixieFail Bug #9
CVE-2023-45237
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
CWE-338 Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG)

Use of a Weak PseudoRandom Number Generator

Change Overview:

Updates all Instances of NET_RANDOM (NetRandomInitSeed ()) to either

>
> EFI_STATUS
> EFIAPI
> PseudoRandomU32 (
>  OUT UINT32  *Output
>  );
>

or (depending on the use case)

>
> EFI_STATUS
> EFIAPI
> PseudoRandom (
>  OUT  VOID   *Output,
>  IN   UINTN  OutputLength
>  );
>

This is because the use of

Example:

The following code snippet PseudoRandomU32 () function is used:

>
> UINT32         Random;
>
> Status = PseudoRandomU32 (&Random);
> if (EFI_ERROR (Status)) {
>   DEBUG ((DEBUG_ERROR, "%a failed to generate random number: %r\n",
__func__, Status));
>   return Status;
> }
>

This also introduces a new PCD to enable/disable the use of the
secure implementation of algorithms for PseudoRandom () and
instead depend on the default implementation. This may be required for
some platforms where the UEFI Spec defined algorithms are not available.

>
> PcdEnforceSecureRngAlgorithms
>

If the platform does not have any one of the UEFI defined
secure RNG algorithms then the driver will assert.

Cc: Saloni Kasbekar <saloni.kasbekar@intel.com>
Cc: Zachary Clark-williams <zachary.clark-williams@intel.com>

Signed-off-by: Doug Flick [MSFT] <doug.edk2@gmail.com>
Reviewed-by: Saloni Kasbekar <saloni.kasbekar@intel.com>
2024-05-24 15:48:52 +00:00
Flickdm a85336531c SecurityPkg RngDxe: Remove incorrect limitation on GetRng
Removed from gEfiRngAlgorithmRaw an incorrect assumption that
Raw cannot return less than 256 bits. The DRNG Algorithms
should always use a 256 bit seed as per nist standards
however a caller is free to request less than 256 bits.
>
>     //
>    // When a DRBG is used on the output of a entropy source,
>    // its security level must be at least 256 bits according to UEFI
Spec.
>    //
>    if (RNGValueLength < 32) {
>      return EFI_INVALID_PARAMETER;
>    }
>

AARCH64 platforms do not have this limitation and this brings both
implementations into alignment with each other and the spec.

Cc: Jiewen Yao <jiewen.yao@intel.com>

Signed-off-by: Doug Flick [MSFT] <doug.edk2@gmail.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Pierre Gondois <pierre.gondois@arm.com>
Acked-by: Jiewe Yao <Jiewen.yao@intel.com>
2024-05-24 15:48:52 +00:00