public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Stefano Garzarella <sgarzare@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: Oliver Steffen <osteffen@redhat.com>,
	devel@edk2.groups.io,  Jiewen Yao <jiewen.yao@intel.com>,
	 Zachary Clark-williams <zachary.clark-williams@intel.com>,
	 Saloni Kasbekar <saloni.kasbekar@intel.com>,
	Doug Flick <dougflick@microsoft.com>,
	 Daniel Berrange <berrange@redhat.com>, Cong Li <coli@redhat.com>
Subject: Re: [edk2-devel] OVMF Issue with Netboot, VirtioRng, and both COM1/COM2 configured
Date: Mon, 4 Nov 2024 14:36:55 +0100	[thread overview]
Message-ID: <CAGxU2F6__V=ME0OD7_RhU3pFf60GxafU-keiO77PYr8Lskbk2g@mail.gmail.com> (raw)
In-Reply-To: <r35jv77lyozax4lljsdxnm3x5kamm32bu5kknu7nsmzswbcmfr@h5fapnatjgnk>

On Mon, Nov 4, 2024 at 10:41 AM Gerd Hoffmann <kraxel@redhat.com> wrote:
>
> On Mon, Nov 04, 2024 at 10:14:47AM +0100, Stefano Garzarella wrote:
> > Hi Gerd,
> >
> > On Fri, Nov 1, 2024 at 10:31 AM Gerd Hoffmann <kraxel@redhat.com> wrote:
> > >
> > >   Hi,
> > >
> > > > By analyzing the calls to the dispatcher (`gDS->Dispatch ()`) I found
> > > > that when we only have COM1, EfiBootManagerConnectDevicePath() at some
> > > > point invokes `gDS->Dispatch ()` after VirtioRng has started. This call
> > > > will then get DxeNetLib loaded.
> > >
> > > Ok, so it is probably a good idea to explicitly request a dispatch after
> > > activating virtio-rng, so we do not depend on this happening by pure
> > > luck for other reasons:
> > >
> > > --- a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c
> > > +++ b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c
> > > @@ -670,6 +670,7 @@ ConnectVirtioPciRng (
> > >      if (EFI_ERROR (Status)) {
> > >        goto Error;
> > >      }
> > > +    gDS->Dispatch ();
> > >    }
> > >
> > >    return EFI_SUCCESS;
> > >
> > > [ untested patch, and we probably should do something similar for ArmVirt,
> > >   /me goes continue walking through my email backlog now ]
> > >
> >
> > Yep, that should work.

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

> >
> > Last week I went a little deeper into the problem and basically
> > starting with commit 4c4ceb2ceb ("NetworkPkg: SECURITY PATCH
> > CVE-2023-45237") the network stack is no longer initialized during
> > DXE, but in BDS (see
> > https://issues.redhat.com/browse/RHEL-58631?focusedId=25981655&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-25981655).
> >
> > Is this intentional? Could there be other problems besides this one we just had?
>
> A lot of the more important stuff for network booting happens in the
> BDS phase anyway, i.e. OVMF checking the qemu boot order, connecting
> the devices configured as bootable devices (including the NICs),
> creating (if needed) and sorting the BootNNNN entries.
>
> So I don't expect any bad side effects from initializing the core
> network modules in the (early) BDS phase.

I see, thanks!
Stefano



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#120710): https://edk2.groups.io/g/devel/message/120710
Mute This Topic: https://groups.io/mt/109008158/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



      reply	other threads:[~2024-11-04 14:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-14 19:07 [edk2-devel] OVMF Issue with Netboot, VirtioRng, and both COM1/COM2 configured Oliver Steffen
2024-10-15 13:07 ` Stefano Garzarella
2024-11-01  9:30   ` Gerd Hoffmann
2024-11-03 13:37     ` Oliver Steffen
2024-11-04  9:14     ` Stefano Garzarella
2024-11-04  9:40       ` Gerd Hoffmann
2024-11-04 13:36         ` Stefano Garzarella [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAGxU2F6__V=ME0OD7_RhU3pFf60GxafU-keiO77PYr8Lskbk2g@mail.gmail.com' \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox