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.6864.1623241120025464018 for ; Wed, 09 Jun 2021 05:18:40 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@ibm.com header.s=pp1 header.b=mkwRisNz; 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 159CChHS022943; Wed, 9 Jun 2021 08:18:39 -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 : mime-version : content-transfer-encoding; s=pp1; bh=WJmpBnHCIB2e9r7brCeTeMZQ3UCiCLplwaotC6ntsrs=; b=mkwRisNz5uu+8A84obL2i/x1Fe1eKKfuQ2kO++JbhfTsdNEl2nNbVCO4osSQjEC6blkH LOW5giX6a1cwNl5R9sMigaBGEVvxdpppgVeDVVaI8LbDEsTZn0+vS1h602JbR0a6loRm cyQCAhsu04MfBT/oqs/d07pGvZbXdxNkYnMUenLWhJF6cA119dbX+wAYzXVjVU2+5HnG 0EnsXDMnkJM3PqhfwP9HwgBqWaJezH8KwGoOPkcrb6YnfBL0S0f2/FG8kGASVhGxyZxR QtJET9ZuCWvPPAh1MzcrJIEIRC2TnhkDu5byV2zBIe3owpYsgW+pOAk68a109YVBRqE4 eg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 392w1q8w5f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 09 Jun 2021 08:18:39 -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 159CDUoY026135; Wed, 9 Jun 2021 08:18:38 -0400 Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0b-001b2d01.pphosted.com with ESMTP id 392w1q8w57-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 09 Jun 2021 08:18:38 -0400 Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 159CDd7l025473; Wed, 9 Jun 2021 12:18:38 GMT Received: from b01cxnp22035.gho.pok.ibm.com (b01cxnp22035.gho.pok.ibm.com [9.57.198.25]) by ppma02dal.us.ibm.com with ESMTP id 3900way3vr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 09 Jun 2021 12:18:38 +0000 Received: from b01ledav002.gho.pok.ibm.com (b01ledav002.gho.pok.ibm.com [9.57.199.107]) by b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 159CIbI715663408 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 9 Jun 2021 12:18:37 GMT Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6927D124054; Wed, 9 Jun 2021 12:18:37 +0000 (GMT) Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 43FF512405A; Wed, 9 Jun 2021 12:18:37 +0000 (GMT) Received: from localhost.localdomain (unknown [9.2.130.16]) by b01ledav002.gho.pok.ibm.com (Postfix) with ESMTP; Wed, 9 Jun 2021 12:18:37 +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 v1 1/3] Revert "OvmfPkg/QemuKernelLoaderFsDxe: don't expose kernel command line" Date: Wed, 9 Jun 2021 12:18:26 +0000 Message-Id: <20210609121828.1884825-2-dovmurik@linux.ibm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210609121828.1884825-1-dovmurik@linux.ibm.com> References: <20210609121828.1884825-1-dovmurik@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: b3NRNDAeDLxxpC4MoQxSAjVgSOaMj1f6 X-Proofpoint-GUID: 3BBL3pnwfzGhZHTonWoBu4giefncIEmh X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.761 definitions=2021-06-09_04:2021-06-04,2021-06-09 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 bulkscore=0 suspectscore=0 adultscore=0 clxscore=1015 lowpriorityscore=0 mlxlogscore=999 spamscore=0 impostorscore=0 malwarescore=0 priorityscore=1501 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106090059 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 Signed-off-by: Dov Murik --- 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