From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by mx.groups.io with SMTP id smtpd.web08.6761.1623932232167734440 for ; Thu, 17 Jun 2021 05:17:12 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@ibm.com header.s=pp1 header.b=b1YEy9js; spf=pass (domain: linux.ibm.com, ip: 148.163.158.5, mailfrom: dovmurik@linux.ibm.com) Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 15HC31kQ130147; Thu, 17 Jun 2021 08:17:11 -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=b1YEy9jsHzd5Yw/caq0BRPKPZez+PIx9GNv2eOAwxz1MwoOAFVHxk40dVWR4RULRKa/c TXmGom/FjjbcnVWCV2WCelKBDtTwoDuqXcvUO/02jANpX6ntRA7f+4OH4g9nhmJww1nS 2RdVnZKgnK7VjQW+8WhpGx3ecdZj65TU8f+4l+TiOIQfniaMaIa6+CumQp4cw3vsd3yq MCxo5GoESotdaCFvUaaDpmXNoBCXaKx9pl7c117yCVxUdEg5q1aE9V8f+tHq5bbEJdN+ XomFXAGqhZq9SXITvDALgZVPknmjW3XI3pbOPDcrCu5yjj3lOwuI6BjCg/ZX/mAg28nN eg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3980yatvvu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 17 Jun 2021 08:17:11 -0400 Received: from m0098421.ppops.net (m0098421.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 15HC3j5a135168; Thu, 17 Jun 2021 08:17:10 -0400 Received: from ppma01dal.us.ibm.com (83.d6.3fa9.ip4.static.sl-reverse.com [169.63.214.131]) by mx0a-001b2d01.pphosted.com with ESMTP id 3980yatvvg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 17 Jun 2021 08:17:10 -0400 Received: from pps.filterd (ppma01dal.us.ibm.com [127.0.0.1]) by ppma01dal.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 15HCC40c009843; Thu, 17 Jun 2021 12:17:09 GMT Received: from b03cxnp08026.gho.boulder.ibm.com (b03cxnp08026.gho.boulder.ibm.com [9.17.130.18]) by ppma01dal.us.ibm.com with ESMTP id 394mjatnwy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 17 Jun 2021 12:17:09 +0000 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 15HCH7tB21430594 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 17 Jun 2021 12:17:08 GMT Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DBC7EC605D; Thu, 17 Jun 2021 12:17:07 +0000 (GMT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6A6D4C605A; Thu, 17 Jun 2021 12:17:07 +0000 (GMT) Received: from localhost.localdomain (unknown [9.2.130.16]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP; Thu, 17 Jun 2021 12:17:07 +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 v2 1/3] Revert "OvmfPkg/QemuKernelLoaderFsDxe: don't expose kernel command line" Date: Thu, 17 Jun 2021 12:16:58 +0000 Message-Id: <20210617121700.2883073-2-dovmurik@linux.ibm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210617121700.2883073-1-dovmurik@linux.ibm.com> References: <20210617121700.2883073-1-dovmurik@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 4GBEhsSQ0vEPMsjdRN2j9Xt52tmaIkYM X-Proofpoint-ORIG-GUID: yZ5C7DEMfJgSHJsjC9H4K0hyQOMo4Osw X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.790 definitions=2021-06-17_10:2021-06-15,2021-06-17 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 malwarescore=0 mlxscore=0 phishscore=0 impostorscore=0 bulkscore=0 mlxlogscore=999 suspectscore=0 priorityscore=1501 adultscore=0 lowpriorityscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106170079 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