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 084DAAC186F for ; Wed, 29 Nov 2023 16:37:14 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=CizI7045vphPUycEyt/QgDDnbAfLUed70EFtlK9z/GQ=; 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=1701275833; v=1; b=ctAaheo1eUdW+AE2q9+aXEW3gcyvcRs5BQCBo+qhutHqmc+Mt2rUT+w7EfIs25Vw3TKICFWz w/NQTpsCp23UMp+AuP6OWhzMFuMXXumKH8k+NpVmBU4iF0r/BS8Tus6QebKqoyfGnodBNFlIpS9 lz3pFvsTBKN9dbawCo3GAjB4= X-Received: by 127.0.0.2 with SMTP id RhDEYY7687511x44z697BtUP; Wed, 29 Nov 2023 08:37:13 -0800 X-Received: from NAM12-DM6-obe.outbound.protection.outlook.com (NAM12-DM6-obe.outbound.protection.outlook.com [40.107.243.59]) by mx.groups.io with SMTP id smtpd.web11.41864.1701275833026860158 for ; Wed, 29 Nov 2023 08:37:13 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Eb86THOTpplcbwBvC2hj2wpx6WiGyWUbeM7fzSsPNnBGaBUdgHPuRmvJF5HCPy/niW+9TrRRA/Dgq1LfyE+2vnMoAjPid4E/NWJbBVgH5y+cariqCcpo3oPlQcyby1cFLDIoZCs4I6iAlyFFZ+/vUdnuVrMrfo0+rLiiFOHriRm6RGoqpBimndQKfmdADMWgejArL4mY9QE3R/4vogc6kGPP6os/PEUE7tQeTZDOOE59UBP8rgKtMBeFjdhtpU4vSQtL+nySj9i8sUU1hwApU46WvC5csmkI0zejMRRPp/vAdrW9EHOiosqayHYhp7Umq1vS1A3GSSMpxJCDaBRo8Q== 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=1rAICqnuGMF/avnGxU+aelpSUnO/tJSoSSDqal2PUoU=; b=Yo+8uk1uqlpQpqXYe5qqiHBYzDzstLrxCJAsSx5iAhI5V9LO2DtraOU4imdmLbgS9IyAcj8b2B47DR95B1Nz/mI1czLJY6HMyVBFUq5MCY9XP3fxvV1WZlxYiRRWDNwwuYXCyokpV0WOXJY/59KbBWkPYCqdgfIyrNIIkNln+WdvOW1+17yLlB9u7UNWz9rxrMQ1IsqihdTI8OdGkONyepTbH8QxScMKtrhXckqSJdn5AgEOFfGT9Hh8La0KfwuHaATtgKXbr5zI/YgM+PFTstLJrqjUxnvb/bVSbfi0HTCtho1KoRtx+7EmHdi9Om9UmtYg+KnnpFwLZV/q+JoBsA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none X-Received: from BY5PR12MB5544.namprd12.prod.outlook.com (2603:10b6:a03:1d9::22) by DM4PR12MB6447.namprd12.prod.outlook.com (2603:10b6:8:bf::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.27; Wed, 29 Nov 2023 16:37:09 +0000 X-Received: from BY5PR12MB5544.namprd12.prod.outlook.com ([fe80::108e:2378:282b:6d89]) by BY5PR12MB5544.namprd12.prod.outlook.com ([fe80::108e:2378:282b:6d89%4]) with mapi id 15.20.7025.022; Wed, 29 Nov 2023 16:37:09 +0000 From: "Ashish Singhal via groups.io" To: "Chang, Abner" , "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: AQHaF3GVaLL9rqM9m0WkO4ZgZ9RIwLCDJvcAgAB5hWeAAGyvAIANiEVM Date: Wed, 29 Nov 2023 16:37:09 +0000 Message-ID: References: <3ab879ada6d9f2b01496ecc05102510564888044.1700008662.git.ashishsingha@nvidia.com> In-Reply-To: Accept-Language: en-US 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: BY5PR12MB5544:EE_|DM4PR12MB6447:EE_ x-ms-office365-filtering-correlation-id: 8957992c-82ce-4bc4-b5e4-08dbf0f96e4b x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: YaC6QCku4pm7HnPW8XMI1d888TJP9UfkqLShNCKBhl12SJMcZt7ZB6xWtfM5BjUSEUOfdmG2SzPoffOmoT02FOe33+E1l8Pwo9j1iX47BfimnueGUNVOUf7mRyktunVC51agdLFmGnwK8P3M12TUw59B+htcXBMA4X+OOHlmyLuCfRbQ3SSPwyUjZg1GeqRu1ix6qhERSImdbjk3gaFesQZMiUyZnmpBsObw1cdlQ6wvh92notjrofGqurpCwWbEHJyc9jloCupfE1eZ+sItEPn7yW50A42OV6lhG/8BhmIsedNW44qdVxRTemXlR1Pgucm65BYg4TNNVxA5s1mKyYnW5EhScQec/0MLL5j+XZi3nfcSTt2jLejna2dRui4N0e6/o/0tg08QJexqCJuDwlNPUu5f1hJ5Dh67wIjnAiay1TjZdly1oxVeYfYriuws2/Msvy+nHk1uJh7xMmnfbM5LYV4p78fpXKOrXlv9ERCGh57ekipZCY3TC0x5GB+j5XjnIX778YwHczxcQ05/MH7n3twkx3zu3qRRlNhwkzm+0R5almHMNfY3Lkpt1k4oSV3vm+gRbeXXeHL5azwPR5I67MRUW32MujN94vLtmwurUYfXjFYwqQReX79ncsfsWB2FbebGeLmLKCmL6PUL7w== x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?k7UQJv0O1RzHO9WxOoE7h1AtiTXIYth7hJO4ZAi/nACHC6vn0It0OjasoM?= =?iso-8859-1?Q?d+z6BqKg1gMGcIuBpAYq95O/rpviLXBTQMJnY8TwpPfq7zslXX/1D/R6Ma?= =?iso-8859-1?Q?0ukDCNS+bVrqwipQCtlEGr2lDxxv4FQr7s9L8EeSAY4Jue56hu3gUc/m35?= =?iso-8859-1?Q?RI8w345U0RR1XGLVk4HiK6xfHQy8IzHec2QOJ4ShGYDIHp1Nz3wy8LBPoS?= =?iso-8859-1?Q?2iKejaigb21K/TV62zYoJFrD5D8RFI/LssKAT6nc7J8EC1mcfeuHXW7X4y?= =?iso-8859-1?Q?2VMAHn9bHtzggYunSLQt+VqoLssqHlZJ5Qt9wWdZWiLZN9yz4N51WFugcp?= =?iso-8859-1?Q?ATJWsBipTpj6Gd1ZsJnkrJStYqZZiqO4tyxeV2G89ea8PaBpfURgA4q+xU?= =?iso-8859-1?Q?KVh4KiJsWobXsj+JQwRcopHXW4/hWtWL101HDflTq9WGnvqjnQTAbxkhAw?= =?iso-8859-1?Q?NwImoRJWKajXGEgi+NBjLiszqD0CQO4DycLuJHTVOgmNg+L733pU8BrjKb?= =?iso-8859-1?Q?XZLkNt8H617zUgPVMbbGuvFAYfpj/7Bt2cqHG4e3+JdSsa9Ly8NzP94FZk?= =?iso-8859-1?Q?Kw6rqHWUy7TcA4AqNcnAJ99SRsSMQHuVGGAByQiCHezXrUIU/GuikLrAMb?= =?iso-8859-1?Q?Fus1PjiLMFGWNnBVGLSmGUOqwMNSei/CFN7eLdNOMs/HZXnhpqjrujIykJ?= =?iso-8859-1?Q?APD7WEOKliP+8MgJPvgVe9dtB2c5erK+0REug5bai7vsOLQNYQtAGKu/m7?= =?iso-8859-1?Q?SMLdMvCsMazS8x8v3owuNF3ISa0Orw9LCO5ugrIm/+J5AgIxwz6ahV6aCv?= =?iso-8859-1?Q?R/WthRUvcBGXZCvPLYJtUoyS8zeI8SFZ2CCuWWPJJR0P3YqbdWna/WO6NF?= =?iso-8859-1?Q?sYz5lPLOU41TEknG27RGq0SDIJqh2e3UpeaEMinmB83OP2hZXVDrCc3Uaa?= =?iso-8859-1?Q?ATr4UcLiwacfJe9/jJCPCT/Svu0ve8R11kIQj7J7MybO5azstkKriyAHDK?= =?iso-8859-1?Q?DkJ6YzxYVBPsU5PRoNaN+QFYzlT+cYV/vJc4te4lnJlvfQu8KgcTRInj0i?= =?iso-8859-1?Q?5wsO4mEmFFwLk8Asn9oV5gq1tYhyao9ioTOSVuPj2xfUzVXSo25P9NA+xg?= =?iso-8859-1?Q?m9vHgFhQDTWETBBXtpd1/yJXY5tGhy1Oew68BHNhDoPuEMzz+99guPGx5z?= =?iso-8859-1?Q?hD2T3Slo83hKkc3P2z2m79JqPaVg+4icc8DNW+uewP4A+8JlkL/ugukUKG?= =?iso-8859-1?Q?uOryiPuy0C8VnWe3HDftyAAkBxtCCb4uuAe5w0dsydIpVvD5i6j0R2jOPQ?= =?iso-8859-1?Q?c2tqifXTlhoBUJn8cSJ7+Sz5tX6eliwPOw9Tyv9gKekx1Rzk3AizE98gWz?= =?iso-8859-1?Q?PKd1fm5HRNQsGE/AEeW/jvKn4MF8SGLLxxQAxRtEoJwT7dGAO/pRYZPPzR?= =?iso-8859-1?Q?jRAuj9qAgpskDupdcfoLIdQIaXy4985/y1dfFR++lHUU7oZWlPWxqWbSoN?= =?iso-8859-1?Q?bbi36hE7gWIUcGGS51Ps9hmf5cbXasg+NfaXStl/Sz+FuBROBPGD3yAb3R?= =?iso-8859-1?Q?1Wrj3M+8+mN0+A1HlRvaozRG78whquSwHC+So6lzzv183vcQfnnoL8xtwo?= =?iso-8859-1?Q?y84fEDBvKO5QBF0kdCTsOIN4g5rYv3CePi?= MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BY5PR12MB5544.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8957992c-82ce-4bc4-b5e4-08dbf0f96e4b X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Nov 2023 16:37:09.0431 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: cNr9Fi0PFjYTz58wxlpFz7sCDOwetO06oz5doDMDNQ/2juV54pRj7aYCkJFhA6YYzyth6s/CUr8Pn2/ohC1gWA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6447 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,ashishsingha@nvidia.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 1wUmkmKg8ZAC7J13qXOnfDYbx7686176AA= Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_BY5PR12MB5544EEDFABA8BB682AB80DCFBA83ABY5PR12MB5544namp_" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=ctAaheo1; 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_BY5PR12MB5544EEDFABA8BB682AB80DCFBA83ABY5PR12MB5544namp_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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@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. ________________________________________ 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 (#111851): https://edk2.groups.io/g/devel/message/111851 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_BY5PR12MB5544EEDFABA8BB682AB80DCFBA83ABY5PR12MB5544namp_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hello,

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

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>; ardb+tianocore@kernel.org <ardb+tianocore@kern= el.org>; git@danielschaefer.me <git@danielschaefer.me>; Jeff Brasen <jbrasen@nvidia.com>
Subject: RE: [PATCH v2 1/2] EmbeddedPkg: Fix Android Boot Comma= nd Line Length Bug
 
External email: Use caution opening l= inks or attachments


[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%2Fedk2.gr= oups.io%2Fg%2Frfc%2Fmessage%2F827&data=3D05%7C01%7Cashishsingha%40nvidi= a.com%7C772572ba91f04cdfdf0108dbea352cbb%7C43083d15727340c1b7db39efd9ccc17a= %7C0%7C0%7C638361286344293715%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiL= CJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3Dw= WhH%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.chang@amd.com>

Abner


From: Ashish Singhal <ashishsingha@nvidia.com>
Sent: Tuesday, November 21, 2023 3:34 AM
To: Chang, Abner <Abner.Chang@amd.com>; devel@edk2.groups.io; quic_ll= indhol@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:ashishsingha@nvidia.com>; mailto:devel@edk2.groups.io <mailto:devel@edk2.groups.io>; mailto:quic_llindhol@quicinc.com <mailto:quic_llindhol@quicinc.com&= gt;; mailto:ardb+tianocore@kernel.org <mailto:ardb+tianocore@kernel.org&= gt;; mailto:git@danielschaefer.me <mailto:git@danielschaefer.me>; Jeff Br= asen <mailto= :jbrasen@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 <mailto:ashishsingha@nvidia.com>
> 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:Abner.Chang@amd.com>= ;
> mailto:git@danielschaefer.me; mailto:jbrasen@nvidia.com
> Cc: Ashish Singhal <mailto: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.gr= oups.io%2Fg%2Frfc%2Fmessage%2F827&data=3D05%7C01%7Cashishsingha%40nvidi= a.com%7C772572ba91f04cdfdf0108dbea352cbb%7C43083d15727340c1b7db39efd9ccc17a= %7C0%7C0%7C638361286344293715%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiL= CJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3Dw= WhH%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 (#111851) | =20 | Mute= This Topic | New Topic
Your Subscriptio= n | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_
--_000_BY5PR12MB5544EEDFABA8BB682AB80DCFBA83ABY5PR12MB5544namp_--