From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.158.5]) by mx.groups.io with SMTP id smtpd.web09.9385.1624877477426257646 for ; Mon, 28 Jun 2021 03:51:17 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@ibm.com header.s=pp1 header.b=BNiRiq04; spf=pass (domain: linux.ibm.com, ip: 148.163.158.5, mailfrom: dovmurik@linux.ibm.com) Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 15SAYDhE084969; Mon, 28 Jun 2021 06:51:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : mime-version; s=pp1; bh=n7/j2UuA7lWMdjHEuX6jPTkKgVEs6E8fz/BPqUDEMIo=; b=BNiRiq04xdrIo9PNNPGINOA9C4cTrd7xNFSH+0ZAgVmeDIidtXcdu/3jScrUmGw+pGOS e6M/VtTgMBCG5fqSeKJroDQyqFIHsPlcpuUWljYfyT1bp3odr5ndyc0GECNJKs2sal0m IYLTV45MiySs1n2oMak9XQWzw5HA0gfGwWlVy2bHSsquRMp22OnavY1BI70u8xOCxY+G fTvOxX9viNBtgwhXdzReB1Ne3wDa3ZXDrhEIKeRttcz/0ukyKqlCk3RWZk9kbyCLMlWz 7gZtKrggOWtQSDCB4PKhhZPoHP/l9ODTDU15/48lX3H/IMrQDUukpF4LXwNNcxJkNgTl GQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 39fcjegngn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 28 Jun 2021 06:51:16 -0400 Received: from m0098413.ppops.net (m0098413.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 15SAZX61088985; Mon, 28 Jun 2021 06:51:16 -0400 Received: from ppma03dal.us.ibm.com (b.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.11]) by mx0b-001b2d01.pphosted.com with ESMTP id 39fcjegngd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 28 Jun 2021 06:51:16 -0400 Received: from pps.filterd (ppma03dal.us.ibm.com [127.0.0.1]) by ppma03dal.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 15SAgW0O017849; Mon, 28 Jun 2021 10:51:15 GMT Received: from b01cxnp22036.gho.pok.ibm.com (b01cxnp22036.gho.pok.ibm.com [9.57.198.26]) by ppma03dal.us.ibm.com with ESMTP id 39duvabfnt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 28 Jun 2021 10:51:15 +0000 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 15SApE5Q12059014 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 28 Jun 2021 10:51:14 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A7F44AC05B; Mon, 28 Jun 2021 10:51:14 +0000 (GMT) Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 80F2DAC05E; Mon, 28 Jun 2021 10:51:14 +0000 (GMT) Received: from localhost.localdomain (unknown [9.2.130.16]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP; Mon, 28 Jun 2021 10:51:14 +0000 (GMT) From: "Dov Murik" To: devel@edk2.groups.io Cc: Dov Murik , Laszlo Ersek , Ard Biesheuvel , Jordan Justen , James Bottomley , Tobin Feldman-Fitzthum Subject: [PATCH v3 3/5] Revert "OvmfPkg/QemuKernelLoaderFsDxe: don't expose kernel command line" Date: Mon, 28 Jun 2021 10:51:08 +0000 Message-Id: <20210628105110.379951-4-dovmurik@linux.ibm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210628105110.379951-1-dovmurik@linux.ibm.com> References: <20210628105110.379951-1-dovmurik@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: UEdURu--vOEDOrsqzLKyeLO5lwD54lKn X-Proofpoint-GUID: WTjNVUhyrc_Yoo-7L-Hr1WZhsRV6NM7u X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.790 definitions=2021-06-28_09:2021-06-25,2021-06-28 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 suspectscore=0 clxscore=1015 malwarescore=0 spamscore=0 mlxlogscore=999 bulkscore=0 phishscore=0 impostorscore=0 lowpriorityscore=0 priorityscore=1501 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106280074 Content-Transfer-Encoding: quoted-printable 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 Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3457 Signed-off-by: Dov Murik Reviewed-by: Laszlo Ersek --- OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c b/OvmfPk= g/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c index b09ff6a3590d..c7ddd86f5c75 100644 --- a/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c +++ b/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c @@ -33,6 +33,7 @@ typedef enum {=0D KernelBlobTypeKernel,=0D KernelBlobTypeInitrd,=0D + KernelBlobTypeCommandLine,=0D KernelBlobTypeMax=0D } KERNEL_BLOB_TYPE;=0D =0D @@ -59,6 +60,11 @@ STATIC KERNEL_BLOB mKernelBlob[KernelBlobTypeMax] =3D { {=0D { QemuFwCfgItemInitrdSize, QemuFwCfgItemInitrdData, },=0D }=0D + }, {=0D + L"cmdline",=0D + {=0D + { QemuFwCfgItemCommandLineSize, QemuFwCfgItemCommandLineData, },=0D + }=0D }=0D };=0D =0D @@ -948,7 +954,7 @@ FetchBlob ( //=0D // Read blob.=0D //=0D - Blob->Data =3D AllocatePages (EFI_SIZE_TO_PAGES ((UINTN)Blob->Size));=0D + Blob->Data =3D AllocatePool (Blob->Size);=0D if (Blob->Data =3D=3D NULL) {=0D DEBUG ((DEBUG_ERROR, "%a: failed to allocate %Ld bytes for \"%s\"\n",= =0D __FUNCTION__, (INT64)Blob->Size, Blob->Name));=0D @@ -1083,8 +1089,7 @@ FreeBlobs: while (BlobType > 0) {=0D CurrentBlob =3D &mKernelBlob[--BlobType];=0D if (CurrentBlob->Data !=3D NULL) {=0D - FreePages (CurrentBlob->Data,=0D - EFI_SIZE_TO_PAGES ((UINTN)CurrentBlob->Size));=0D + FreePool (CurrentBlob->Data);=0D CurrentBlob->Size =3D 0;=0D CurrentBlob->Data =3D NULL;=0D }=0D --=20 2.25.1