public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Paulo Alcantara <pcacjr@zytor.com>
To: Laszlo Ersek <lersek@redhat.com>, Ruiyu Ni <ruiyu.ni@intel.com>
Cc: edk2-devel@lists.01.org, Eric Dong <eric.dong@intel.com>,
	hao.a.wu@intel.com, Jordan Justen <jordan.l.justen@intel.com>,
	Andrew Fish <afish@apple.com>, Liming Gao <liming.gao@intel.com>,
	Michael D Kinney <michael.d.kinney@intel.com>,
	Star Zeng <star.zeng@intel.com>
Subject: Re: [PATCH v6 0/6] read-only UDF file system support
Date: Fri, 8 Sep 2017 10:43:09 -0300	[thread overview]
Message-ID: <be6bb783-0bf9-ea98-d03a-433fff4dc52c@zytor.com> (raw)
In-Reply-To: <dd01c5cf-38c9-c221-e793-d5985c09f586@redhat.com>

Hi,

On 08/09/2017 10:25, Laszlo Ersek wrote:
> 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 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] = { 0 };
>>     UINT64                          FileSize;
>> +  UINT64                          BufferSizeUint64;
>>
>>     OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
>>
>>     if (This == NULL || BufferSize == NULL || (*BufferSize != 0 &&
>> @@ -363,18 +364,22 @@ UdfRead (
>>         Status = EFI_SUCCESS;
>>         goto Done;
>>       }
>>
>> +    BufferSizeUint64 = *BufferSize;
>> +
>>       Status = ReadFileData (
>>         BlockIo,
>>         DiskIo,
>>         Volume,
>>         Parent,
>>         PrivFileData->FileSize,
>>         &PrivFileData->FilePosition,
>>         Buffer,
>> -      (UINT64 *)(UINTN)BufferSize
>> +      &BufferSizeUint64
>>         );
>> +    ASSERT (BufferSizeUint64 <= MAX_UINTN);
>> +    *BufferSize = (UINTN)BufferSizeUint64;
>>     } else if (IS_FID_DIRECTORY_FILE (Parent->FileIdentifierDesc)) {
>>       if (ReadDirInfo->FidOffset == 0 && PrivFileData->FilePosition > 0) {
>>         Status = EFI_DEVICE_ERROR;
>>         *BufferSize = 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?

Yes - at least from what I've been testing :-)

> 
> Paulo: you forgot to pick up Ray's R-b for patches #4 and #5, from his
> v5 response
> <http://mid.mail-archive.com/734D49CCEBEEF84792F5B80ED585239D5BA282B7@SHSMSX104.ccr.corp.intel.com>
> -- it was for the entire series.

D'oh - I only considered the Mde*Pkg and Nt32Pkg R-b's. Sorry.

> But, I'll apply that for you.

Thank you very much!

Paulo


  reply	other threads:[~2017-09-08 13:42 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-08 12:41 [PATCH v6 0/6] read-only UDF file system support Paulo Alcantara
2017-09-08 12:41 ` [PATCH v6 1/6] MdePkg: Add UDF volume structure definitions Paulo Alcantara
2017-09-08 12:41 ` [PATCH v6 2/6] MdeModulePkg/PartitionDxe: Add UDF file system support Paulo Alcantara
2017-09-08 12:41 ` [PATCH v6 3/6] MdeModulePkg: Initial UDF/ECMA-167 " Paulo Alcantara
2017-09-08 12:41 ` [PATCH v6 4/6] OvmfPkg: Enable UDF " Paulo Alcantara
2017-09-08 12:41 ` [PATCH v6 5/6] ArmVirtPkg: " Paulo Alcantara
2017-09-08 12:41 ` [PATCH v6 6/6] Nt32Pkg: " Paulo Alcantara
2017-09-08 13:25 ` [PATCH v6 0/6] read-only " Laszlo Ersek
2017-09-08 13:43   ` Paulo Alcantara [this message]
2017-09-08 15:05   ` Ni, Ruiyu
2017-09-08 18:47 ` Laszlo Ersek
2017-09-08 19:21   ` Ard Biesheuvel
2017-09-08 19:40     ` Laszlo Ersek
2017-09-08 22:17       ` Ard Biesheuvel
2017-09-08 23:30         ` Paulo Alcantara
2017-09-09 21:52           ` Laszlo Ersek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=be6bb783-0bf9-ea98-d03a-433fff4dc52c@zytor.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox