From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (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 4D42E21959CAD for ; Sat, 9 Sep 2017 17:10:24 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CDBA1C0587C9; Sun, 10 Sep 2017 00:13:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com CDBA1C0587C9 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=lersek@redhat.com Received: from lacos-laptop-7.usersys.redhat.com (ovpn-121-1.rdu2.redhat.com [10.10.121.1]) by smtp.corp.redhat.com (Postfix) with ESMTP id 48AB8614C0; Sun, 10 Sep 2017 00:13:16 +0000 (UTC) From: Laszlo Ersek To: edk2-devel-01 Cc: Ard Biesheuvel , Eric Dong , Paulo Alcantara , Ruiyu Ni , Star Zeng Date: Sun, 10 Sep 2017 02:13:01 +0200 Message-Id: <20170910001304.8628-3-lersek@redhat.com> In-Reply-To: <20170910001304.8628-1-lersek@redhat.com> References: <20170910001304.8628-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Sun, 10 Sep 2017 00:13:17 +0000 (UTC) Subject: [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: Sun, 10 Sep 2017 00:10:24 -0000 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 request, i.e., when we reach the corresponding "break" statament under the INLINE_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/MdeModulePkg/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; } + Status = EFI_SUCCESS; break; + case LONG_ADS_SEQUENCE: case SHORT_ADS_SEQUENCE: // // This FE/EFE contains a run of Allocation Descriptors. Get data + size // for start reading them out. -- 2.14.1.3.gb7cf6e02401b