From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web10.7745.1624542398787933397 for ; Thu, 24 Jun 2021 06:46:39 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=AED2MQlC; spf=pass (domain: redhat.com, ip: 216.205.24.124, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624542398; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7GKGtmZQF6t+ZtR+C5/bWqXIcXaFzjbI72B+8tBVB4U=; b=AED2MQlC3U7KprS+58eJy8qsgEprLlHbKoGGZ/yaWCwZRiD2QLkTgtmqzVylErihd4S2vm xouWU2iAcZ4bSFbnxgUb9ATn+YK/VqPVcJWuu3euN5iP2vgRt0TyFviSXTmmbJS0edSGM5 TZ2CqPoYXeMN5E66Qz/Xk3JQ8x/TEe4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-479-18KZSoSHNVCdwS65p619Tg-1; Thu, 24 Jun 2021 09:46:34 -0400 X-MC-Unique: 18KZSoSHNVCdwS65p619Tg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6B589100C612; Thu, 24 Jun 2021 13:46:33 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-106.ams2.redhat.com [10.36.114.106]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F0F50421F; Thu, 24 Jun 2021 13:46:31 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH v2 1/3] Revert "OvmfPkg/QemuKernelLoaderFsDxe: don't expose kernel command line" To: devel@edk2.groups.io, dovmurik@linux.ibm.com Cc: Ard Biesheuvel , Jordan Justen , James Bottomley , Tobin Feldman-Fitzthum References: <20210617121700.2883073-1-dovmurik@linux.ibm.com> <20210617121700.2883073-2-dovmurik@linux.ibm.com> From: "Laszlo Ersek" Message-ID: <833fb66f-fa38-c8d0-ffef-d4115cf6a2b5@redhat.com> Date: Thu, 24 Jun 2021 15:46:30 +0200 MIME-Version: 1.0 In-Reply-To: <20210617121700.2883073-2-dovmurik@linux.ibm.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lersek@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 06/17/21 14:16, 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 > Cc: Ard Biesheuvel > Cc: Jordan Justen > Cc: James Bottomley > Cc: Tobin Feldman-Fitzthum > Signed-off-by: Dov Murik > --- > OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c | 11 ++++++++--- > 1 file changed, 8 insertions(+), 3 deletions(-) (1) The bugzilla ticket should be referenced in the commit message, above your signoff: Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3457 With that update: Reviewed-by: Laszlo Ersek Thanks, Laszlo > > 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; > } >