From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.151; helo=mga17.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id D6EF421196801 for ; Thu, 29 Nov 2018 07:18:39 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Nov 2018 07:18:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,295,1539673200"; d="scan'208";a="95765336" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga006.jf.intel.com with ESMTP; 29 Nov 2018 07:18:38 -0800 Received: from fmsmsx124.amr.corp.intel.com (10.18.125.39) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 29 Nov 2018 07:18:38 -0800 Received: from fmsmsx103.amr.corp.intel.com ([169.254.2.186]) by fmsmsx124.amr.corp.intel.com ([169.254.8.91]) with mapi id 14.03.0415.000; Thu, 29 Nov 2018 07:18:38 -0800 From: "Carsey, Jaben" To: Ard Biesheuvel , "edk2-devel@lists.01.org" CC: Laszlo Ersek , "Gao, Liming" Thread-Topic: [edk2] [PATCH 4/6] BaseTools/DevicePath: use MAX_UINT16 as default device path max size Thread-Index: AQHUh9+UeBW6UXV3kki1fYlEuXmB46Vm3dig Date: Thu, 29 Nov 2018 15:18:37 +0000 Message-ID: References: <20181129123129.25095-1-ard.biesheuvel@linaro.org> <20181129123129.25095-5-ard.biesheuvel@linaro.org> In-Reply-To: <20181129123129.25095-5-ard.biesheuvel@linaro.org> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMjBjMzI1YzQtZDk3YS00YjQ0LThhMGQtZGYwMDA4OTYxYjgzIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiUHl2WVlrME5VeG5kK0E4VnFTR05VOFFFTDNzZDRtXC9yNHRUR09ic0ZqMGRpeUE5MmFFRFFicjVLOExoeTJpRTEifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.1.200.106] MIME-Version: 1.0 Subject: Re: [PATCH 4/6] BaseTools/DevicePath: use MAX_UINT16 as default device path max size X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 15:18:40 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Jaben Carsey > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > Ard Biesheuvel > Sent: Thursday, November 29, 2018 4:31 AM > To: edk2-devel@lists.01.org > Cc: Laszlo Ersek ; Gao, Liming > Subject: [edk2] [PATCH 4/6] BaseTools/DevicePath: use MAX_UINT16 as > default device path max size >=20 > Replace the default size limit of IsDevicePathValid() with a value > that does not depend on the native word size of the build host. >=20 > 64 KB seems sufficient as the upper bound of a device path handled > by UEFI. >=20 > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Ard Biesheuvel > --- > BaseTools/Source/C/DevicePath/DevicePathUtilities.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/BaseTools/Source/C/DevicePath/DevicePathUtilities.c > b/BaseTools/Source/C/DevicePath/DevicePathUtilities.c > index d4ec2742b7c8..ba7f83e53070 100644 > --- a/BaseTools/Source/C/DevicePath/DevicePathUtilities.c > +++ b/BaseTools/Source/C/DevicePath/DevicePathUtilities.c > @@ -62,7 +62,7 @@ IsDevicePathValid ( > ASSERT (DevicePath !=3D NULL); >=20 > if (MaxSize =3D=3D 0) { > - MaxSize =3D MAX_UINTN; > + MaxSize =3D MAX_UINT16; > } >=20 > // > @@ -78,7 +78,7 @@ IsDevicePathValid ( > return FALSE; > } >=20 > - if (NodeLength > MAX_UINTN - Size) { > + if (NodeLength > MAX_UINT16 - Size) { > return FALSE; > } > Size +=3D NodeLength; > -- > 2.19.1 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel