From nobody Mon Feb 9 05:45:20 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+55530+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+55530+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1583415981; cv=none; d=zohomail.com; s=zohoarc; b=K2MbK3+qDKxSivqx9ekaHAHPb5JxwJRvJwpLWE/zeHOGg5eZYx2g3K/oetdWYsl67o+U26UCuL1XHwY/2OLCMp31ujM9PkSETpfmmUHKEo9vGkNIbTfrZ531OPExlAhAs1A2dAyAdhy+QcOey9E0eF/58qGr+BSrvFmaQw4Uebo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583415981; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=hWvdVukoVuyjkGf2Ujb3/z5RLQjS8HNLBAONynMoJZ8=; b=Mc85MPAiTHWBOJEE8EiPC4y1jlhWERi3Wfd5ak2FTCkMxqHFr5yo7nKYZZNmvvMlDaXN0wzNU5IdevWyIznFC90rvo+DHP+cXDYzIuq2BKmQRMCUyk/e2VqAGe2fdyp3jQnJ4i1IJqfIXjJsXmCNUWs0LoP9v/zyOyzkx8a5COM= 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+55530+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 1583415981819344.19010638996997; Thu, 5 Mar 2020 05:46:21 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id PzYwYY1788612xE3ViP09pN5; Thu, 05 Mar 2020 05:46:21 -0800 X-Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by mx.groups.io with SMTP id smtpd.web10.12695.1583415980443440111 for ; Thu, 05 Mar 2020 05:46:20 -0800 X-Received: by mail-wr1-f67.google.com with SMTP id 6so1664127wre.4 for ; Thu, 05 Mar 2020 05:46:20 -0800 (PST) X-Gm-Message-State: yiiuAvf2R70SOQL5k3SxGMBix1787277AA= X-Google-Smtp-Source: ADFU+vsjOyWKELbvKbfRfzhTEuueP0+okyNqHGhQVXOqB73HRds8WbBEPaegxfgH47WCF0paNH06AA== X-Received: by 2002:adf:b345:: with SMTP id k5mr10912101wrd.55.1583415978697; Thu, 05 Mar 2020 05:46:18 -0800 (PST) X-Received: from e123331-lin.home ([2a01:cb1d:112:6f00:816e:ff0d:fb69:f613]) by smtp.gmail.com with ESMTPSA id m19sm9278701wmc.34.2020.03.05.05.46.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Mar 2020 05:46:17 -0800 (PST) From: "Ard Biesheuvel" To: devel@edk2.groups.io Cc: lersek@redhat.com, Ard Biesheuvel Subject: [edk2-devel] [PATCH v3 07/14] OvmfPkg/QemuKernelLoaderFsDxe: don't expose kernel command line Date: Thu, 5 Mar 2020 14:46:00 +0100 Message-Id: <20200305134607.20125-8-ard.biesheuvel@linaro.org> In-Reply-To: <20200305134607.20125-1-ard.biesheuvel@linaro.org> References: <20200305134607.20125-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=1583415981; bh=/IfUowI5H2oUySAg1hKksmmGSOC2Vwaz8wr1NB1xE38=; h=Cc:Date:From:Reply-To:Subject:To; b=BVE/ZB56IsiTJOG7QM1Evik7jFfb1+JAZ+kTSdCHbFlmNLvnKliepx/pnK0Le7iVYst /O2Ig9O4rLo6VrhXvQCZz9Dv4eJifnZxy3vZG+TPxwO2hNyBC9h0cFf4RD0IKW1CHGYLm WgERtUGFryIn6g25fq/ly1YL0FEXYZ+wRw4= 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 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c b/OvmfPk= g/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c index e4539ec2fbe5..dc86a48af378 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 ((UINTN)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,8 @@ QemuKernelLoaderFsDxeEntrypoint ( while (BlobType > 0) { CurrentBlob =3D &mKernelBlob[--BlobType]; if (CurrentBlob->Data !=3D NULL) { - FreePool (CurrentBlob->Data); + FreePages (CurrentBlob->Data, + EFI_SIZE_TO_PAGES ((UINTN)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 (#55530): https://edk2.groups.io/g/devel/message/55530 Mute This Topic: https://groups.io/mt/71749520/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-