From nobody Tue Feb 10 01:33:21 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+55146+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55146+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1583134192; cv=none; d=zohomail.com; s=zohoarc; b=AgBP6qZZ36KoU3ywzoMnUNwFA8Q0HPBiBbITF3WajzpJUrzOLQqQ3pb6ZfE5uZ4GCUFxsPkDMUuDn75PU8JyOlZLka2kBviqloMpElARH4phQ73ZfNh1mtimJoOmJqO8Sb49/QHgZbFJpBWuqEtNG8zMZng7lGLf9dBjU4gIg/A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583134192; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=d5Cv0Sy7QH2+TrOvRCgooCMIXqhv+d7u1RvmxTP/ec0=; b=lR+1ISEACxzz5lddGb27PD0DkSs+5U/ckNQL53iifQ/h5QZvXP87FvKBH2ZM0NLUluKpD/cV/0QvddjAVlEr9byI57Zl1jhCsEKP98vy1y+aziulsVGJh6L7MwEDeQzoeD7ScW7T4FHxwZjvlvmT7AeqwklffFAqFuS6jgwwJzw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55146+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1583134192752473.7671265487086; Sun, 1 Mar 2020 23:29:52 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id V5SzYY1788612xTBBxij5WeS; Sun, 01 Mar 2020 23:29:51 -0800 X-Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by mx.groups.io with SMTP id smtpd.web10.11204.1583134190931675799 for ; Sun, 01 Mar 2020 23:29:51 -0800 X-Received: by mail-wr1-f65.google.com with SMTP id z15so11190427wrl.1 for ; Sun, 01 Mar 2020 23:29:50 -0800 (PST) X-Gm-Message-State: Junqj0jXdAVo46zJRHWSYC8Sx1787277AA= X-Google-Smtp-Source: APXvYqz9ZOedV2ZvJZllqgQQiDtvK1k2pnMcwI8vXMGtpXbVRbuOCDNdFSObllYTchFqEqWCnYuYtA== X-Received: by 2002:a05:6000:ca:: with SMTP id q10mr20382123wrx.78.1583134189100; Sun, 01 Mar 2020 23:29:49 -0800 (PST) X-Received: from e123331-lin.home ([2a01:cb1d:112:6f00:816e:ff0d:fb69:f613]) by smtp.gmail.com with ESMTPSA id z131sm6347153wmg.25.2020.03.01.23.29.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Mar 2020 23:29:48 -0800 (PST) From: "Ard Biesheuvel" To: devel@edk2.groups.io Cc: lersek@redhat.com, Ard Biesheuvel Subject: [edk2-devel] [PATCH 07/13] OvmfPkg/QemuKernelLoaderFsDxe: don't expose kernel command line Date: Mon, 2 Mar 2020 08:29:30 +0100 Message-Id: <20200302072936.29221-8-ard.biesheuvel@linaro.org> In-Reply-To: <20200302072936.29221-1-ard.biesheuvel@linaro.org> References: <20200302072936.29221-1-ard.biesheuvel@linaro.org> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,ard.biesheuvel@linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1583134191; bh=S3A8qCKuAE+SfyR88FFm6Zt946yUM2lvmyp3V4qKLE8=; h=Cc:Date:From:Reply-To:Subject:To; b=mB91NwPNubnS1aAQWEGeNKuv9hODRCBIDqDbeCihGrYACAvW7kR6+4D+3Y3IqJ5NStJ ixFZeCPkKCuAKt0pprhXHpRh2Rj3K/iBDi5VZ2RUjMtOCqc6oD5YMJf3OP9jZHY+D6gcn mQmUZXhanBv75WqRoK8P6CjqZnDkyE630pU= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" We have no need for exposing the kernel command line as a file, so remove support for that. Since the remaining blobs (kernel and initrd) are typically much larger than a page, switch to the page based allocator for blobs at the same time. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2566 Signed-off-by: Ard Biesheuvel Reviewed-by: Laszlo Ersek --- OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c b/OvmfPk= g/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c index efecbd817da1..b8d64e2781fc 100644 --- a/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c +++ b/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c @@ -30,7 +30,6 @@ typedef enum { KernelBlobTypeKernel, KernelBlobTypeInitrd, - KernelBlobTypeCommandLine, KernelBlobTypeMax } KERNEL_BLOB_TYPE; =20 @@ -45,7 +44,6 @@ typedef struct { STATIC KERNEL_BLOB mKernelBlob[KernelBlobTypeMax] =3D { { QemuFwCfgItemKernelSize, QemuFwCfgItemKernelData, L"kernel" = }, { QemuFwCfgItemInitrdSize, QemuFwCfgItemInitrdData, L"initrd" = }, - { QemuFwCfgItemCommandLineSize, QemuFwCfgItemCommandLineData, L"cmdline"= } }; =20 STATIC UINT64 mTotalBlobBytes; @@ -865,7 +863,7 @@ FetchBlob ( // // Read blob. // - Blob->Data =3D AllocatePool (Blob->Size); + Blob->Data =3D AllocatePages (EFI_SIZE_TO_PAGES (Blob->Size)); if (Blob->Data =3D=3D NULL) { DEBUG ((DEBUG_ERROR, "%a: failed to allocate %Ld bytes for \"%s\"\n", __FUNCTION__, (INT64)Blob->Size, Blob->Name)); @@ -969,7 +967,7 @@ QemuKernelLoaderFsDxeEntrypoint ( while (BlobType > 0) { CurrentBlob =3D &mKernelBlob[--BlobType]; if (CurrentBlob->Data !=3D NULL) { - FreePool (CurrentBlob->Data); + FreePages (CurrentBlob->Data, EFI_SIZE_TO_PAGES (CurrentBlob->Size)); CurrentBlob->Size =3D 0; CurrentBlob->Data =3D NULL; } --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#55146): https://edk2.groups.io/g/devel/message/55146 Mute This Topic: https://groups.io/mt/71669020/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-