From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 355BB780091 for ; Thu, 30 Nov 2023 02:13:30 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=+KGvRuM2KirDXJ1DPcM7k4M4kGUBGF9PVdY4W33Dl7Q=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:msip_labels:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type; s=20140610; t=1701310408; v=1; b=eeUy6MSRYljJG6CXriNUSTdtRuP6OIkJFPkOM3oq1hyQeUCJ1PI//1Ma9cITjtoQu7R9CSRl bRKvbQHN7JNdhhhbIhpVcQwZdrLK08h7icJyzsOFngy7IQUIEiasaXsbeKcyylAENXpPJezvDQZ UgwxhWy9OhVI/y2Ia/nyzKvU= X-Received: by 127.0.0.2 with SMTP id CyjKYY7687511x58WUCnha6S; Wed, 29 Nov 2023 18:13:28 -0800 X-Received: from NAM10-DM6-obe.outbound.protection.outlook.com (NAM10-DM6-obe.outbound.protection.outlook.com [40.107.93.52]) by mx.groups.io with SMTP id smtpd.web11.62748.1701310407968284535 for ; Wed, 29 Nov 2023 18:13:28 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MPJujO+Pj6p9ugO0FIsNohuAOjpEARYGHgPVm0Nei2ul8bdxCH2pfKWZaWiSJha+/5tIuk9sA7Xe/w6a8KhpnxBZwbIhHoMAluUQd+p0i3cxqRQ+FNMfY22ae1zJfASTBq3804hzaAJwMhfBAFot61vaMzIZKs52lDxt6Mm3eFZZWz43hg2fEaOCK+XnFuOap3+FDPQUp4a3Lyr7Zhf/9TXPwj+JyxTMUBK57C4TP3IT0AtouMd0uHEAdhnFoPU1+7PotrwRuS1l+wCI07ULPNQdTi3hBuV+EI7TSATR2Vku4ZzID3C8EZODYAbFNZzOOh+7qT5NOWb1kUMPxTRbKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=qucWfIAR3LfIpnzVby0ZOxC7g20fbzutC4zSFqDhwMo=; b=F2+a/HWi6xwn4FjQdq08wtHo5cC0JenrY+Nk24AN3LRZrtgwieIeuHpD2E1n62+jTq6+6AA+datdgtW2DPjMLg4g7L98XIhnubDpr1qz0GNmHhkfCgne++SYuiNr4NpZARiUQYHcKDC6G3J2e9QiT3oQBj9bs7+lXRrLSHdQFo28EtULgCbR7t26YsOpgJ5RquSKWecX4Dpd0mBZgLNv/r5nczdhSaR4Q/ixshbfzajkAOaENtvCldCtkJ3ols3Y8bigzfMoZUd60/ExoJBrG1WW1+wmLKE/nwQyvaVN3YGntbQ4P1e7k+AR+iViTu6Ji24c5Jp5hgyzTA5/LjxCig== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none X-Received: from MN2PR12MB3966.namprd12.prod.outlook.com (2603:10b6:208:165::18) by CY8PR12MB7633.namprd12.prod.outlook.com (2603:10b6:930:9c::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.29; Thu, 30 Nov 2023 02:13:24 +0000 X-Received: from MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::91d9:e679:32a3:dd05]) by MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::91d9:e679:32a3:dd05%5]) with mapi id 15.20.7046.015; Thu, 30 Nov 2023 02:13:24 +0000 From: "Chang, Abner via groups.io" To: Ashish Singhal , "devel@edk2.groups.io" , "quic_llindhol@quicinc.com" , "ardb+tianocore@kernel.org" , "git@danielschaefer.me" , Jeff Brasen Subject: Re: [edk2-devel] [PATCH v2 1/2] EmbeddedPkg: Fix Android Boot Command Line Length Bug Thread-Topic: [PATCH v2 1/2] EmbeddedPkg: Fix Android Boot Command Line Length Bug Thread-Index: AQHaF3GYlWbIQ8+McEGjG/g0U9xKYLCDJb1QgAB8SACAAGqn4IANiQiAgACgopA= Date: Thu, 30 Nov 2023 02:13:24 +0000 Message-ID: References: <3ab879ada6d9f2b01496ecc05102510564888044.1700008662.git.ashishsingha@nvidia.com> In-Reply-To: Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ActionId=74420a64-4491-43ab-8ad2-466d2ac8796a;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ContentBits=0;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Enabled=true;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Method=Standard;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Name=General;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SetDate=2023-11-20T12:08:47Z;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN2PR12MB3966:EE_|CY8PR12MB7633:EE_ x-ms-office365-filtering-correlation-id: 78263c93-ffcc-4485-4444-08dbf149eeed x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: bxq2jhwilYdyqmvy31HAkHTLf8vq3aO0fJwXyPXA191X2q9vD0VpQFjSFdEeFYX+/somaxUmt5jcPlkAujZ9T3OI6Ta284FDFo+kJ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Z8kMA1pIBR?= =?us-ascii?Q?L2R1RK1ld/sVBDlJRezN/rXa7KYTQ2wWkpcQvjwvuZG+xB8BVkPcaTsZncQt?= =?us-ascii?Q?LnddbMgtvEqDVjQ0fCBv71eC2Jol6K25foSh0BY27fOFQ3ypLCPVHuyPQsMp?= =?us-ascii?Q?saG5zkIWq9veHCQCHuR9Sdag162cXjVbp04FBpd52emN1CaF9rjHDiHGowxQ?= =?us-ascii?Q?j/MZcsqvvWCUspkQSdp4IcrFBYMmzMib4qmAQlIvM3GOzUKj9yiZDBFP4Lg9?= =?us-ascii?Q?dIAv30F9nefkQS3jJ1rXTd3L5sp47TRb2B+eJ5PjZ5eGkuA/4r2B/lYAvWB7?= =?us-ascii?Q?vr1KG8taztXwj0CNrozU2cYvK9gxgM0dgndTdZ5Yme5Uf3b5QPX7ZY74UZQM?= =?us-ascii?Q?/a8vEPr6L7nTIdll9Uav4SAS42Z+09wcjo9QYmAV?= MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB3966.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 78263c93-ffcc-4485-4444-08dbf149eeed X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Nov 2023 02:13:24.5927 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: ajmKSWw/CNqJe4sjRkUA3EG5kq+zL9/ex+0slDHZDEClUQH/viRqHus1mFqAuJEuU5rD+bEDXWoev8z7sbFAJQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7633 Precedence: Bulk List-Subscribe: List-Help: 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,abner.chang@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: VU55GvQEIBSZAjxCktqR6ZXnx7686176AA= Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_MN2PR12MB396641564F4A22935B0C4357EA82AMN2PR12MB3966namp_" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=eeUy6MSR; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io --_000_MN2PR12MB396641564F4A22935B0C4357EA82AMN2PR12MB3966namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable [AMD Official Use Only - General] Ah sure. I can do it at anytime. Could you please create a PR for this cha= nge and let me know? Abner From: Ashish Singhal Sent: Thursday, November 30, 2023 12:37 AM To: Chang, Abner ; devel@edk2.groups.io; quic_llindhol= @quicinc.com; ardb+tianocore@kernel.org; git@danielschaefer.me; Jeff Brasen= Subject: Re: [PATCH v2 1/2] EmbeddedPkg: Fix Android Boot Command Line Leng= th Bug [AMD Official Use Only - General] Caution: This message originated from an External Source. Use proper cautio= n when opening attachments, clicking links, or responding. Hello, Checking if there is a timeline for this patchset to be merged. Thanks Ashish ________________________________ From: Chang, Abner > Sent: Monday, November 20, 2023 6:57 PM To: Ashish Singhal = >; devel@edk2.groups.io >; quic_llindhol@quicinc.com >; ardb+tianocore@kernel.org >; git@danielschaefer.me >; Jeff Brasen > Subject: RE: [PATCH v2 1/2] EmbeddedPkg: Fix Android Boot Command Line Leng= th Bug External email: Use caution opening links or attachments [AMD Official Use Only - General] >I did not add this intentionally and even sent out an email asking the sam= e on edk2-rfc if this should be done by maintainers unless you want me to d= o it as a ??separate patch set. >Link to the message is https://nam11.safelinks.protection.outlook.com/?url= =3Dhttps%3A%2F%2Fedk2.groups.io%2Fg%2Frfc%2Fmessage%2F827&data=3D05%7C01%7C= ashishsingha%40nvidia.com%7C772572ba91f04cdfdf0108dbea352cbb%7C43083d157273= 40c1b7db39efd9ccc17a%7C0%7C0%7C638361286344293715%7CUnknown%7CTWFpbGZsb3d8e= yJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C= %7C%7C&sdata=3DwWhH%2BkdVGcCCs5uAWz0mwJ9ROrZ6OZ0lWkdHHnXcaMc%3D&reserved=3D= 0 That's fine. > String comes in from the https://nam11.safelinks.protection.outlook.com/?= url=3Dhttps%3A%2F%2Fgithub.com%2Ftianocore%2Fedk2%2Fblob%2Fmaster%2FEmbedde= dPkg%2FInclude%2FLibrary%2FAndroidBootImgLib.h%23L43&data=3D05%7C01%7Cashis= hsingha%40nvidia.com%7C772572ba91f04cdfdf0108dbea352cbb%7C43083d15727340c1b= 7db39efd9ccc17a%7C0%7C0%7C638361286344293715%7CUnknown%7CTWFpbGZsb3d8eyJWIj= oiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7= C&sdata=3DQZqBxMHLxQRlMNWVAqGTOq1pwtsQf6LYQG8UwTkEjmE%3D&reserved=3D0 header so it should ideally be self-contained. If you st= ill think we should check for it, I can add a separate patch while keeping = this one unaffected. Reviewed-by: Abner Chang > Abner From: Ashish Singhal > Sent: Tuesday, November 21, 2023 3:34 AM To: Chang, Abner >; devel@e= dk2.groups.io; quic_llindhol@quicinc.com; ardb+tianocore@kernel.org; git@danielschaefer.me; Jeff B= rasen > Subject: Re: [PATCH v2 1/2] EmbeddedPkg: Fix Android Boot Command Line Leng= th Bug [AMD Official Use Only - General] Caution: This message originated from an External Source. Use proper cautio= n when opening attachments, clicking links, or responding. ________________________________________ From: Chang, Abner Sent: Monday, November 20, 2023 5:13 AM To: Ashish Singhal ; mailto:devel@edk2.grou= ps.io ; mailto:quic_llindhol@quicinc.com ; mailto:ardb+tianocore@kernel.org ; mailto:git@danielschaefer.me ; Jeff Brasen Subject: RE: [PATCH v2 1/2] EmbeddedPkg: Fix Android Boot Command Line Leng= th Bug External email: Use caution opening links or attachments [AMD Official Use Only - General] Thanks for this update and two more comments, > -----Original Message----- > From: Ashish Singhal > Sent: Wednesday, November 15, 2023 11:12 AM > To: mailto:devel@edk2.groups.io; mailto:quic_llindhol@quicinc.com; > mailto:ardb+tianocore@kernel.org; Chang, Abner ; > mailto:git@danielschaefer.me; mailto:jbrasen@nvidia.com > Cc: Ashish Singhal > Subject: [PATCH v2 1/2] EmbeddedPkg: Fix Android Boot Command Line > Length Bug > > Caution: This message originated from an External Source. Use proper caut= ion > when opening attachments, clicking links, or responding. > > > Curently, AndroidBootImgLib expects input kernel command line > to never exceed 256 unicode characters where the image header > allows for 512 ascii characters. If image header allows 512 > ascii characters, similar number of unicode characters should be > allowed at the minimum. > > Signed-off-by: Ashish Singhal > --- > .../AndroidBootImgLib/AndroidBootImgLib.c | 31 +++++++++++-------- > 1 file changed, 18 insertions(+), 13 deletions(-) > > diff --git a/EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.c > b/EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.c > index 1359a66db2..f63648e60d 100644 > --- a/EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.c > +++ b/EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.c > @@ -322,11 +322,12 @@ AndroidBootImgGetFdt ( > EFI_STATUS > AndroidBootImgUpdateArgs ( > IN VOID *BootImg, > - OUT VOID *KernelArgs > + OUT VOID **KernelArgs > ) I know the original code doesn't have the function header. Would you mind t= o add it as we change the prototype of this function? Or you probably would like to keep it as it for the consistence, as no func= tion header for any of functions in this file. I did not add this intentionally and even sent out an email asking the same= on edk2-rfc if this should be done by maintainers unless you want me to do= it as a separate patch set. Link to the message is https://nam11.safelinks.protection.outlook.com/?url= =3Dhttps%3A%2F%2Fedk2.groups.io%2Fg%2Frfc%2Fmessage%2F827&data=3D05%7C01%7C= ashishsingha%40nvidia.com%7C772572ba91f04cdfdf0108dbea352cbb%7C43083d157273= 40c1b7db39efd9ccc17a%7C0%7C0%7C638361286344293715%7CUnknown%7CTWFpbGZsb3d8e= yJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C= %7C%7C&sdata=3DwWhH%2BkdVGcCCs5uAWz0mwJ9ROrZ6OZ0lWkdHHnXcaMc%3D&reserved=3D= 0 > { > CHAR8 ImageKernelArgs[ANDROID_BOOTIMG_KERNEL_ARGS_SIZE]; > EFI_STATUS Status; > + UINT32 NewKernelArgSize; > > // Get kernel arguments from Android boot image > Status =3D AndroidBootImgGetKernelArgs (BootImg, ImageKernelArgs); > @@ -334,16 +335,23 @@ AndroidBootImgUpdateArgs ( > return Status; > } > Do you think we have to check if the ASCII string size in ImageKernelArgs g= reater than ANDROID_BOOTIMG_KERNEL_ARGS_SIZE? Thanks Abner String comes in from the https://nam11.safelinks.protection.outlook.com/?ur= l=3Dhttps%3A%2F%2Fgithub.com%2Ftianocore%2Fedk2%2Fblob%2Fmaster%2FEmbeddedP= kg%2FInclude%2FLibrary%2FAndroidBootImgLib.h%23L43&data=3D05%7C01%7Cashishs= ingha%40nvidia.com%7C772572ba91f04cdfdf0108dbea352cbb%7C43083d15727340c1b7d= b39efd9ccc17a%7C0%7C0%7C638361286344293715%7CUnknown%7CTWFpbGZsb3d8eyJWIjoi= MC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&= sdata=3DQZqBxMHLxQRlMNWVAqGTOq1pwtsQf6LYQG8UwTkEjmE%3D&reserved=3D0 header so it should ideally be self-contained. If you stil= l think we should check for it, I can add a separate patch while keeping th= is one unaffected. Thanks Ashish > + NewKernelArgSize =3D ANDROID_BOOTIMG_KERNEL_ARGS_SIZE; > + *KernelArgs =3D AllocateZeroPool (sizeof (CHAR16) * NewKernelArgS= ize); > + if (*KernelArgs =3D=3D NULL) { > + DEBUG ((DEBUG_ERROR, "Fail to allocate memory\n")); > + return EFI_OUT_OF_RESOURCES; > + } > + > AsciiStrToUnicodeStrS ( > ImageKernelArgs, > - KernelArgs, > - ANDROID_BOOTIMG_KERNEL_ARGS_SIZE >> 1 > + *KernelArgs, > + NewKernelArgSize > ); > // Append platform kernel arguments > if (mAndroidBootImg->AppendArgs) { > Status =3D mAndroidBootImg->AppendArgs ( > - KernelArgs, > - ANDROID_BOOTIMG_KERNEL_ARGS_SIZE > + *KernelArgs, > + NewKernelArgSize > ); > } > > @@ -616,6 +624,10 @@ AndroidBootImgBoot ( > UINTN RamdiskSize; > IN VOID *FdtBase; > > + if ((Buffer =3D=3D NULL) || (BufferSize =3D=3D 0)) { > + return EFI_INVALID_PARAMETER; > + } > + > NewKernelArg =3D NULL; > ImageHandle =3D NULL; > > @@ -637,14 +649,7 @@ AndroidBootImgBoot ( > goto Exit; > } > > - NewKernelArg =3D AllocateZeroPool > (ANDROID_BOOTIMG_KERNEL_ARGS_SIZE); > - if (NewKernelArg =3D=3D NULL) { > - DEBUG ((DEBUG_ERROR, "Fail to allocate memory\n")); > - Status =3D EFI_OUT_OF_RESOURCES; > - goto Exit; > - } > - > - Status =3D AndroidBootImgUpdateArgs (Buffer, NewKernelArg); > + Status =3D AndroidBootImgUpdateArgs (Buffer, &NewKernelArg); > if (EFI_ERROR (Status)) { > goto Exit; > } > -- > 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 (#111879): https://edk2.groups.io/g/devel/message/111879 Mute This Topic: https://groups.io/mt/102598724/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- --_000_MN2PR12MB396641564F4A22935B0C4357EA82AMN2PR12MB3966namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

[AMD Official Use Only - General]


Ah sure.  I can do it at anytime. Could you ple= ase create a PR for this change and let me know?

 

Abner

 

From: Ashish Singhal <ashishsingha@nvidia.= com>
Sent: Thursday, November 30, 2023 12:37 AM
To: Chang, Abner <Abner.Chang@amd.com>; devel@edk2.groups.io; = quic_llindhol@quicinc.com; ardb+tianocore@kernel.org; git@danielschaefer.me= ; Jeff Brasen <jbrasen@nvidia.com>
Subject: Re: [PATCH v2 1/2] EmbeddedPkg: Fix Android Boot Command Li= ne Length Bug

 

[AMD Official Use Only - General]<= /o:p>

 

Caution: This message originated from an External Source. Use proper caution= when opening attachments, clicking links, or responding.

 

Hello,

 

Checking if there is a timeline for this patchset to be me= rged.

 

Thanks

Ashish

 


From: Chang, Abner <Abner.Chang@amd.com>
Sent: Monday, November 20, 2023 6:57 PM
To: Ashish Singhal <ashishsingha@nvidia.com>; devel@edk2.groups.io <devel@edk2.groups.io>; quic_llindhol@quicinc.com = <quic_llindhol@quicinc.com<= /a>>; ardb+tianocore@kernel.org = <ardb+tianocore@kernel.org<= /a>>; git@danielschaefer.me <git@danielschaefer.me>; Jeff Br= asen <jbrasen@nvidia.com> Subject: RE: [PATCH v2 1/2] EmbeddedPkg: Fix Android Boot Comma= nd Line Length Bug

 

External email: Use caution opening links or attachm= ents


[AMD Official Use Only - General]

>I did not add this intentionally and even sent out an email asking the = same on edk2-rfc if this should be done by maintainers unless you want me t= o do it as a ??separate patch set.
>Link to the message is https://nam11.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fed= k2.groups.io%2Fg%2Frfc%2Fmessage%2F827&data=3D05%7C01%7Cashishsingha%40= nvidia.com%7C772572ba91f04cdfdf0108dbea352cbb%7C43083d15727340c1b7db39efd9c= cc17a%7C0%7C0%7C638361286344293715%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAw= MDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdat= a=3DwWhH%2BkdVGcCCs5uAWz0mwJ9ROrZ6OZ0lWkdHHnXcaMc%3D&reserved=3D0 That's fine.

> String comes in from the https://nam11.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fgithub.= com%2Ftianocore%2Fedk2%2Fblob%2Fmaster%2FEmbeddedPkg%2FInclude%2FLibrary%2F= AndroidBootImgLib.h%23L43&data=3D05%7C01%7Cashishsingha%40nvidia.com%7C= 772572ba91f04cdfdf0108dbea352cbb%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0= %7C638361286344293715%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV= 2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3DQZqBxMHLx= QRlMNWVAqGTOq1pwtsQf6LYQG8UwTkEjmE%3D&reserved=3D0 header so it should ideally be self-contained. If you still think we should check= for it, I can add a separate patch while keeping this one unaffected.

Reviewed-by: Abner Chang <abner.c= hang@amd.com>

Abner


From: Ashish Singhal <ashishs= ingha@nvidia.com>
Sent: Tuesday, November 21, 2023 3:34 AM
To: Chang, Abner <Abner.Chang@amd= .com>; devel@edk2.groups.io; quic= _llindhol@quicinc.com; ardb+tianocore@kernel.org;= git@danielschaefer.me; Jeff Brasen <jbrasen@nvidia.com>
Subject: Re: [PATCH v2 1/2] EmbeddedPkg: Fix Android Boot Command Line Leng= th Bug

[AMD Official Use Only - General]


Caution: This message originated from an External Source. Use proper cautio= n when opening attachments, clicking links, or responding.



________________________________________
From: Chang, Abner <mailto:Abner.= Chang@amd.com>
Sent: Monday, November 20, 2023 5:13 AM
To: Ashish Singhal <mailto:as= hishsingha@nvidia.com>; mailto:devel@edk2.groups.io&nbs= p;<mailto:devel@edk2.groups.io>; mailto:quic_llindhol@quicinc.c= om <mailto:quic_ll= indhol@quicinc.com>; mailto:ardb+tianocore@kernel.o= rg <mailto:ardb+ti= anocore@kernel.org>; mailto:git@danielschaefer.me&n= bsp;<mailto:git@danielschaefer.= me>; Jeff Brasen <mailto:jb= rasen@nvidia.com>
Subject: RE: [PATCH v2 1/2] EmbeddedPkg: Fix Android Boot Command Line Leng= th Bug

External email: Use caution opening links or attachments


[AMD Official Use Only - General]

Thanks for this update and two more comments,

> -----Original Message-----
> From: Ashish Singhal <ma= ilto:ashishsingha@nvidia.com>
> Sent: Wednesday, November 15, 2023 11:12 AM
> To: mailto:devel@edk2.groups.i= o; mailto:quic_llindhol@quicinc.com;
> mailto:ardb+tianocore@ker= nel.org; Chang, Abner <mailto= :Abner.Chang@amd.com>;
> mailto:git@danielschaefer.me<= /a>; mailto:jbrasen@nvidia.com
> Cc: Ashish Singhal <mail= to:ashishsingha@nvidia.com>
> Subject: [PATCH v2 1/2] EmbeddedPkg: Fix Android Boot Command Line
> Length Bug
>
> Caution: This message originated from an External Source. Use proper c= aution
> when opening attachments, clicking links, or responding.
>
>
> Curently, AndroidBootImgLib expects input kernel command line
> to never exceed 256 unicode characters where the image header
> allows for 512 ascii characters. If image header allows 512
> ascii characters, similar number of unicode characters should be
> allowed at the minimum.
>
> Signed-off-by: Ashish Singhal <mailto:ashishsingha@nvidia.com>
> ---
>  .../AndroidBootImgLib/AndroidBootImgLib.c    = ; | 31 +++++++++++--------
>  1 file changed, 18 insertions(+), 13 deletions(-)
>
> diff --git a/EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.c=
> b/EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.c
> index 1359a66db2..f63648e60d 100644
> --- a/EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.c
> +++ b/EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.c
> @@ -322,11 +322,12 @@ AndroidBootImgGetFdt (
>  EFI_STATUS
>  AndroidBootImgUpdateArgs (
>    IN  VOID  *BootImg,
> -  OUT VOID  *KernelArgs
> +  OUT VOID  **KernelArgs
>    )
I know the original code doesn't have the function header. Would you mind t= o add it as we change the prototype of this function?
Or you probably would like to keep it as it for the consistence, as no func= tion header for any of functions in this file.

I did not add this intentionally and even sent out an email asking the same= on edk2-rfc if this should be done by maintainers unless you want me to do= it as a separate patch set.

Link to the message is https://nam11.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fedk2.g= roups.io%2Fg%2Frfc%2Fmessage%2F827&data=3D05%7C01%7Cashishsingha%40nvid= ia.com%7C772572ba91f04cdfdf0108dbea352cbb%7C43083d15727340c1b7db39efd9ccc17= a%7C0%7C0%7C638361286344293715%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAi= LCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3D= wWhH%2BkdVGcCCs5uAWz0mwJ9ROrZ6OZ0lWkdHHnXcaMc%3D&reserved=3D0


>  {
>    CHAR8       ImageKerne= lArgs[ANDROID_BOOTIMG_KERNEL_ARGS_SIZE];
>    EFI_STATUS  Status;
> +  UINT32      NewKernelArgSize;
>
>    // Get kernel arguments from Android boot image
>    Status =3D AndroidBootImgGetKernelArgs (BootImg, Ima= geKernelArgs);
> @@ -334,16 +335,23 @@ AndroidBootImgUpdateArgs (
>      return Status;
>    }
>
Do you think we have to check if the ASCII string size in ImageKernelArgs g= reater than ANDROID_BOOTIMG_KERNEL_ARGS_SIZE?

Thanks
Abner

String comes in from the https://nam11.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fgithub.= com%2Ftianocore%2Fedk2%2Fblob%2Fmaster%2FEmbeddedPkg%2FInclude%2FLibrary%2F= AndroidBootImgLib.h%23L43&data=3D05%7C01%7Cashishsingha%40nvidia.com%7C= 772572ba91f04cdfdf0108dbea352cbb%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0= %7C638361286344293715%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV= 2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3DQZqBxMHLx= QRlMNWVAqGTOq1pwtsQf6LYQG8UwTkEjmE%3D&reserved=3D0 header so it should ideally be self-contained. If you still think we should check= for it, I can add a separate patch while keeping this one unaffected.

Thanks
Ashish


> +  NewKernelArgSize =3D ANDROID_BOOTIMG_KERNEL_ARGS_SIZE;
> +  *KernelArgs      =3D AllocateZeroPool= (sizeof (CHAR16) * NewKernelArgSize);
> +  if (*KernelArgs =3D=3D NULL) {
> +    DEBUG ((DEBUG_ERROR, "Fail to allocate memory= \n"));
> +    return EFI_OUT_OF_RESOURCES;
> +  }
> +
>    AsciiStrToUnicodeStrS (
>      ImageKernelArgs,
> -    KernelArgs,
> -    ANDROID_BOOTIMG_KERNEL_ARGS_SIZE >> 1
> +    *KernelArgs,
> +    NewKernelArgSize
>      );
>    // Append platform kernel arguments
>    if (mAndroidBootImg->AppendArgs) {
>      Status =3D mAndroidBootImg->AppendArg= s (
> -           &nb= sp;            =         KernelArgs,
> -           &nb= sp;            =         ANDROID_BOOTIMG_KERNEL_ARGS_SIZE=
> +           &nb= sp;            =         *KernelArgs,
> +           &nb= sp;            =         NewKernelArgSize
>            = ;            &n= bsp;         );
>    }
>
> @@ -616,6 +624,10 @@ AndroidBootImgBoot (
>    UINTN        = ;            &n= bsp; RamdiskSize;
>    IN  VOID      &nb= sp;            *FdtB= ase;
>
> +  if ((Buffer =3D=3D NULL) || (BufferSize =3D=3D 0)) {
> +    return EFI_INVALID_PARAMETER;
> +  }
> +
>    NewKernelArg =3D NULL;
>    ImageHandle  =3D NULL;
>
> @@ -637,14 +649,7 @@ AndroidBootImgBoot (
>      goto Exit;
>    }
>
> -  NewKernelArg =3D AllocateZeroPool
> (ANDROID_BOOTIMG_KERNEL_ARGS_SIZE);
> -  if (NewKernelArg =3D=3D NULL) {
> -    DEBUG ((DEBUG_ERROR, "Fail to allocate memory= \n"));
> -    Status =3D EFI_OUT_OF_RESOURCES;
> -    goto Exit;
> -  }
> -
> -  Status =3D AndroidBootImgUpdateArgs (Buffer, NewKernelArg); > +  Status =3D AndroidBootImgUpdateArgs (Buffer, &NewKernelArg= );
>    if (EFI_ERROR (Status)) {
>      goto Exit;
>    }
> --
> 2.17.1

_._,_._,_

Groups.io Links:

=20 You receive all messages sent to this group. =20 =20

View/Reply Online (#111879) | =20 | Mute= This Topic | New Topic
Your Subscriptio= n | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_
--_000_MN2PR12MB396641564F4A22935B0C4357EA82AMN2PR12MB3966namp_--