From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (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 515FA21E8798A for ; Tue, 12 Sep 2017 02:03:36 -0700 (PDT) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Sep 2017 02:06:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,382,1500966000"; d="scan'208";a="1217666500" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga002.fm.intel.com with ESMTP; 12 Sep 2017 02:06:32 -0700 Received: from fmsmsx124.amr.corp.intel.com (10.18.125.39) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 12 Sep 2017 02:06:32 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx124.amr.corp.intel.com (10.18.125.39) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 12 Sep 2017 02:06:32 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.39]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.168]) with mapi id 14.03.0319.002; Tue, 12 Sep 2017 17:06:30 +0800 From: "Zeng, Star" To: Laszlo Ersek , edk2-devel-01 CC: Ard Biesheuvel , "Dong, Eric" , Paulo Alcantara , "Ni, Ruiyu" , "Zeng, Star" Thread-Topic: [PATCH 2/5] MdeModulePkg/UdfDxe: don't return unset Status if INLINE_DATA req succeeds Thread-Index: AQHTKcmc4Uyw0qE3KkCvXgve7vwBh6Kw+TEw Date: Tue, 12 Sep 2017 09:06:29 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483103B94013E@shsmsx102.ccr.corp.intel.com> References: <20170910001304.8628-1-lersek@redhat.com> <20170910001304.8628-3-lersek@redhat.com> In-Reply-To: <20170910001304.8628-3-lersek@redhat.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH 2/5] MdeModulePkg/UdfDxe: don't return unset Status if INLINE_DATA req succeeds 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: Tue, 12 Sep 2017 09:03:36 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Star Zeng -----Original Message----- From: Laszlo Ersek [mailto:lersek@redhat.com]=20 Sent: Sunday, September 10, 2017 8:13 AM To: edk2-devel-01 Cc: Ard Biesheuvel ; Dong, Eric ; Paulo Alcantara ; Ni, Ruiyu ; = Zeng, Star Subject: [PATCH 2/5] MdeModulePkg/UdfDxe: don't return unset Status if INLI= NE_DATA req succeeds Ard reports that clang-3.8 correctly flags the following issue in the ReadFile() function: If "RecordingFlags" is INLINE_DATA, then there are three paths through the = code where we mean to return success, but forget to set Status accordingly: (1) when "ReadFileInfo->Flags" is READ_FILE_GET_FILESIZE, or (2) when "ReadFileInfo->Flags" is READ_FILE_ALLOCATE_AND_READ and AllocatePool() succeeds, or (3) when "ReadFileInfo->Flags" is READ_FILE_SEEK_AND_READ. Set "Status" to EFI_SUCCESS when we are done processing the INLINE_DATA req= uest, i.e., when we reach the corresponding "break" statament under the INL= INE_DATA case label. Cc: Ard Biesheuvel Cc: Eric Dong Cc: Paulo Alcantara Cc: Ruiyu Ni Cc: Star Zeng Reported-by: Ard Biesheuvel Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek --- MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c b/Md= eModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c index a2ca65e5dfe8..0de9c71c250f 100644 --- a/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c +++ b/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c @@ -958,11 +958,13 @@ ReadFile ( } else { ASSERT (FALSE); return EFI_INVALID_PARAMETER; } =20 + Status =3D EFI_SUCCESS; break; + case LONG_ADS_SEQUENCE: case SHORT_ADS_SEQUENCE: // // This FE/EFE contains a run of Allocation Descriptors. Get data + si= ze // for start reading them out. -- 2.14.1.3.gb7cf6e02401b