Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OvmfPkg: Rerun dispatcher after initializing virtio-rng #6403

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

osteffenrh
Copy link
Contributor

Description

Since the pixiefail CVE fix the network stack requires a hardware random number generator. This can currently be a modern CPU supporting the RDRAND instruction or a virtio-rng device.
The latter is initialized during the BDS phase.
To ensure all depending (network) modules are also started, we need to run the dispatcher once more.
Without this, network boot is not available under certain hardware configurations.

  • Breaking change?
    • Breaking change - Does this PR cause a break in build or boot behavior?
    • Examples: Does it add a new library class or move a module to a different repo.
  • Impacts security?
    • Security - Does this PR have a direct security impact?
    • Examples: Crypto algorithm change or buffer overflow fix.
  • Includes tests?
    • Tests - Does this PR include any explicit test code?
    • Examples: Unit tests or integration tests.

How This Was Tested

Run Ovmf in Qemu with a core2duo vCPU, a virtio-rng-pci device and a varying number of isa serial ports. Observe if the network stack is loaded (presence of HTTP/PXE boot entries, for example). With 2 serial ports the netboot is not available.

Integration Instructions

N/A

@osteffenrh
Copy link
Contributor Author

^ @kraxel @stefano-garzarella

@osteffenrh
Copy link
Contributor Author

@@ -539,6 +539,8 @@ PlatformBootManagerBeforeConsole (
ConnectVirtioPciRng,
NULL
);

gDS->Dispatch ();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we include this fix also in ConnectVirtioPciRng() in OvmfPkg/Library/PlatformBootManagerLibBhyve/BdsPlatform.c ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably a good idea. I'll open a separate PR for that later.

Since the pixiefail CVE fix the network stack requires a hardware
random number generator. This can currently be a modern CPU supporting
the RDRAND instruction or a virtio-rng device.
The latter is initialized during the BDS phase.
To ensure all depending (network) modules are also started, we need to
run the dispatcher once more after the device was initialized.
Without this, network boot is not available under certain hardware
configurations.

Analysed-by: Stefano Garzarella <[email protected]>
Suggested-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Oliver Steffen <[email protected]>
@osteffenrh osteffenrh changed the title OvmfPkg: Rerun dispatcher at the end of BDS hardware init OvmfPkg: Rerun dispatcher after initializing virtio-rng Nov 11, 2024
@stefano-garzarella
Copy link

What about adding Fixes: 4c4ceb2ceb ("NetworkPkg: SECURITY PATCH CVE-2023-45237") in the commit description?
Not sure if it's usual in edk2, but it looks like there is some use of it. I think it will help backports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants