From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (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 DBAD720945C1E for ; Fri, 8 Sep 2017 08:02:40 -0700 (PDT) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Sep 2017 08:05:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,361,1500966000"; d="scan'208";a="1193010960" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga001.fm.intel.com with ESMTP; 08 Sep 2017 08:05:32 -0700 Received: from fmsmsx125.amr.corp.intel.com (10.18.125.40) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 8 Sep 2017 08:05:32 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX125.amr.corp.intel.com (10.18.125.40) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 8 Sep 2017 08:05:32 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.117]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.98]) with mapi id 14.03.0319.002; Fri, 8 Sep 2017 23:05:30 +0800 From: "Ni, Ruiyu" To: Laszlo Ersek , Paulo Alcantara CC: "Dong, Eric" , "Wu, Hao A" , "Justen, Jordan L" , "edk2-devel@lists.01.org" , Andrew Fish , "Gao, Liming" , "Kinney, Michael D" , "Zeng, Star" Thread-Topic: [edk2] [PATCH v6 0/6] read-only UDF file system support Thread-Index: AQHTKJ/6xAHZHGUHNE+br+mkblovv6KqdKQAgAChwjA= Date: Fri, 8 Sep 2017 15:05:28 +0000 Deferred-Delivery: Fri, 8 Sep 2017 15:05:00 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5BA28A47@SHSMSX104.ccr.corp.intel.com> References: In-Reply-To: Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH v6 0/6] read-only UDF file system support X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Sep 2017 15:02:41 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Ruiyu Ni -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Lasz= lo Ersek Sent: Friday, September 8, 2017 9:26 PM To: Paulo Alcantara ; Ni, Ruiyu Cc: Dong, Eric ; Wu, Hao A ; Juste= n, Jordan L ; edk2-devel@lists.01.org; Andrew Fi= sh ; Gao, Liming ; Kinney, Michael D= ; Zeng, Star Subject: Re: [edk2] [PATCH v6 0/6] read-only UDF file system support Ray, On 09/08/17 14:41, Paulo Alcantara wrote: > v6: > - Fixed a bug in UdfRead() that'd pontentially break in ARM or IA32 > by allowing caller to read more than 4GiB of data > (i.e. BufferSize pointer is dereferenced as an UINT64 * and it's > followed by 4 bytes that are nonzero). > > Repo: https://github.com/pcacjr/edk2.git > Branch: udf-fs-v6 The v5-v6 diff is as follows: > diff --git a/MdeModulePkg/Universal/Disk/UdfDxe/File.c=20 > b/MdeModulePkg/Universal/Disk/UdfDxe/File.c > index 2dbcff0be4a3..8b9339567f8e 100644 > --- a/MdeModulePkg/Universal/Disk/UdfDxe/File.c > +++ b/MdeModulePkg/Universal/Disk/UdfDxe/File.c > @@ -325,8 +325,9 @@ UdfRead ( > UDF_FILE_IDENTIFIER_DESCRIPTOR *NewFileIdentifierDesc; > VOID *NewFileEntryData; > CHAR16 FileName[UDF_FILENAME_LENGTH] =3D { 0 = }; > UINT64 FileSize; > + UINT64 BufferSizeUint64; > > OldTpl =3D gBS->RaiseTPL (TPL_CALLBACK); > > if (This =3D=3D NULL || BufferSize =3D=3D NULL || (*BufferSize !=3D 0 = && @@=20 > -363,18 +364,22 @@ UdfRead ( > Status =3D EFI_SUCCESS; > goto Done; > } > > + BufferSizeUint64 =3D *BufferSize; > + > Status =3D ReadFileData ( > BlockIo, > DiskIo, > Volume, > Parent, > PrivFileData->FileSize, > &PrivFileData->FilePosition, > Buffer, > - (UINT64 *)(UINTN)BufferSize > + &BufferSizeUint64 > ); > + ASSERT (BufferSizeUint64 <=3D MAX_UINTN); > + *BufferSize =3D (UINTN)BufferSizeUint64; > } else if (IS_FID_DIRECTORY_FILE (Parent->FileIdentifierDesc)) { > if (ReadDirInfo->FidOffset =3D=3D 0 && PrivFileData->FilePosition > = 0) { > Status =3D EFI_DEVICE_ERROR; > *BufferSize =3D 0; It looks OK to me, and it builds fine for IA32, X64, ARM and AARCH64: Build/ArmVirtQemu-AARCH64/DEBUG_GCC5/AARCH64/UdfDxe.efi Build/ArmVirtQemu-ARM/DEBUG_GCC5/ARM/UdfDxe.efi Build/OvmfIa32/NOOPT_GCC48/IA32/UdfDxe.efi Build/OvmfX64/NOOPT_GCC48/X64/UdfDxe.efi Green light from your side? Paulo: you forgot to pick up Ray's R-b for patches #4 and #5, from his v5 response -- it was for the entire series. But, I'll apply that for you. Thanks, Laszlo _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel