From: "Laszlo Ersek" <lersek@redhat.com>
To: devel@edk2.groups.io, dovmurik@linux.ibm.com
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>,
Jordan Justen <jordan.l.justen@intel.com>,
James Bottomley <jejb@linux.ibm.com>,
Tobin Feldman-Fitzthum <tobin@linux.ibm.com>
Subject: Re: [edk2-devel] [PATCH v3 3/5] Revert "OvmfPkg/QemuKernelLoaderFsDxe: don't expose kernel command line"
Date: Tue, 29 Jun 2021 11:32:52 +0200 [thread overview]
Message-ID: <bd95baa3-096f-5fd2-a24f-89d8b9bfad45@redhat.com> (raw)
In-Reply-To: <20210628105110.379951-4-dovmurik@linux.ibm.com>
On 06/28/21 12:51, Dov Murik wrote:
> This reverts commit efc52d67e1573ce174d301b52fa1577d552c8441.
>
> Manually fixed conflicts in:
> OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c
>
> Note that besides re-exposing the kernel command line as a file in the
> synthetic filesystem, we also revert back to AllocatePool instead of
> AllocatePages.
>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Jordan Justen <jordan.l.justen@intel.com>
> Cc: James Bottomley <jejb@linux.ibm.com>
> Cc: Tobin Feldman-Fitzthum <tobin@linux.ibm.com>
> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3457
> Signed-off-by: Dov Murik <dovmurik@linux.ibm.com>
> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
> ---
> OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c | 11 ++++++++---
> 1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c b/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c
> index b09ff6a3590d..c7ddd86f5c75 100644
> --- a/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c
> +++ b/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c
> @@ -33,6 +33,7 @@
> typedef enum {
> KernelBlobTypeKernel,
> KernelBlobTypeInitrd,
> + KernelBlobTypeCommandLine,
> KernelBlobTypeMax
> } KERNEL_BLOB_TYPE;
>
> @@ -59,6 +60,11 @@ STATIC KERNEL_BLOB mKernelBlob[KernelBlobTypeMax] = {
> {
> { QemuFwCfgItemInitrdSize, QemuFwCfgItemInitrdData, },
> }
> + }, {
> + L"cmdline",
> + {
> + { QemuFwCfgItemCommandLineSize, QemuFwCfgItemCommandLineData, },
> + }
> }
> };
>
> @@ -948,7 +954,7 @@ FetchBlob (
> //
> // Read blob.
> //
> - Blob->Data = AllocatePages (EFI_SIZE_TO_PAGES ((UINTN)Blob->Size));
> + Blob->Data = AllocatePool (Blob->Size);
> if (Blob->Data == NULL) {
> DEBUG ((DEBUG_ERROR, "%a: failed to allocate %Ld bytes for \"%s\"\n",
> __FUNCTION__, (INT64)Blob->Size, Blob->Name));
> @@ -1083,8 +1089,7 @@ FreeBlobs:
> while (BlobType > 0) {
> CurrentBlob = &mKernelBlob[--BlobType];
> if (CurrentBlob->Data != NULL) {
> - FreePages (CurrentBlob->Data,
> - EFI_SIZE_TO_PAGES ((UINTN)CurrentBlob->Size));
> + FreePool (CurrentBlob->Data);
> CurrentBlob->Size = 0;
> CurrentBlob->Data = NULL;
> }
>
Thanks for the updates.
next prev parent reply other threads:[~2021-06-29 9:33 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-28 10:51 [PATCH v3 0/5] OvmfPkg: Use QemuKernelLoaderFs to read cmdline/initrd Dov Murik
2021-06-28 10:51 ` [PATCH v3 1/5] OvmfPkg/GenericQemuLoadImageLib: plug cmdline blob leak on success Dov Murik
2021-06-29 9:27 ` [edk2-devel] " Laszlo Ersek
2021-06-29 10:23 ` Laszlo Ersek
2021-06-28 10:51 ` [PATCH v3 2/5] OvmfPkg/X86QemuLoadImageLib: " Dov Murik
2021-06-29 9:31 ` [edk2-devel] " Laszlo Ersek
2021-06-29 11:18 ` Laszlo Ersek
2021-06-28 10:51 ` [PATCH v3 3/5] Revert "OvmfPkg/QemuKernelLoaderFsDxe: don't expose kernel command line" Dov Murik
2021-06-29 9:32 ` Laszlo Ersek [this message]
2021-06-29 10:23 ` [edk2-devel] " Laszlo Ersek
2021-06-28 10:51 ` [PATCH v3 4/5] OvmfPkg/GenericQemuLoadImageLib: Read cmdline from QemuKernelLoaderFs Dov Murik
2021-06-29 9:44 ` [edk2-devel] " Laszlo Ersek
2021-06-29 10:23 ` Laszlo Ersek
2021-06-28 10:51 ` [PATCH v3 5/5] OvmfPkg/X86QemuLoadImageLib: State fw_cfg dependency in file header Dov Murik
2021-06-29 9:45 ` [edk2-devel] " Laszlo Ersek
2021-06-29 12:54 ` [edk2-devel] [PATCH v3 0/5] OvmfPkg: Use QemuKernelLoaderFs to read cmdline/initrd Laszlo Ersek
2021-06-29 13:03 ` Dov Murik
2021-06-29 13:30 ` Laszlo Ersek
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=bd95baa3-096f-5fd2-a24f-89d8b9bfad45@redhat.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