From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 E358321E87979 for ; Tue, 12 Sep 2017 19:23:17 -0700 (PDT) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP; 12 Sep 2017 19:26:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,385,1500966000"; d="scan'208";a="311033229" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga004.fm.intel.com with ESMTP; 12 Sep 2017 19:26:14 -0700 Received: from fmsmsx126.amr.corp.intel.com (10.18.125.43) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 12 Sep 2017 19:26:15 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX126.amr.corp.intel.com (10.18.125.43) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 12 Sep 2017 19:26:14 -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; Wed, 13 Sep 2017 10:26:11 +0800 From: "Ni, Ruiyu" To: Laszlo Ersek , edk2-devel-01 CC: Ard Biesheuvel , "Dong, Eric" , Paulo Alcantara , "Zeng, Star" Thread-Topic: [PATCH 1/2] MdeModulePkg/UdfDxe: reject reserved values in ICB.Flags[2:0] Thread-Index: AQHTLBYupg+dRVF+kUmJOZdAhArrTKKyFwVQ Date: Wed, 13 Sep 2017 02:26:11 +0000 Deferred-Delivery: Wed, 13 Sep 2017 02:26:00 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5BA2CDF2@SHSMSX104.ccr.corp.intel.com> References: <20170912222612.14451-1-lersek@redhat.com> <20170912222612.14451-2-lersek@redhat.com> In-Reply-To: <20170912222612.14451-2-lersek@redhat.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH 1/2] MdeModulePkg/UdfDxe: reject reserved values in ICB.Flags[2:0] 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: Wed, 13 Sep 2017 02:23:18 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Ruiyu Ni Thanks/Ray > -----Original Message----- > From: Laszlo Ersek [mailto:lersek@redhat.com] > Sent: Wednesday, September 13, 2017 6:26 AM > To: edk2-devel-01 > Cc: Ard Biesheuvel ; Dong, Eric > ; Paulo Alcantara ; Ni, Ruiyu > ; Zeng, Star > Subject: [PATCH 1/2] MdeModulePkg/UdfDxe: reject reserved values in > ICB.Flags[2:0] >=20 > The ECMA-167 standard (3rd Edition, June 1997) reserves values 4 through = 7 > in the ICB.Flags[2:0] bit-field for future standardization; see "14.6 ICB= Tag" / > "14.6.8 Flags (RBP 18)". >=20 > https://www.ecma-international.org/publications/standards/Ecma-167.htm >=20 > The >=20 > switch (RecordingFlags) >=20 > statement in the ReadFile() function handles all the standard values, usi= ng > the constants of the UDF_FE_RECORDING_FLAGS enum type. However, the > reserved values are not caught with a "default" case label, which both br= eaks > the edk2 Coding Style Spec, and leaves the Status variable un-initialized= , > before we return Status under the Done label. >=20 > Set Status to EFI_UNSUPPORTED if we encounter a reserved value. >=20 > This issue was reported by Ard's and Gerd's CI systems independently > (through build failures with GCC48/GCC49, DEBUG/RELEASE targets). >=20 > Cc: Ard Biesheuvel > Cc: Eric Dong > Cc: Paulo Alcantara > Cc: Ruiyu Ni > Cc: Star Zeng > Reported-by: Ard Biesheuvel > Reported-by: Gerd Hoffmann > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Laszlo Ersek > --- > MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c | 8 > ++++++++ > 1 file changed, 8 insertions(+) >=20 > diff --git a/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c > b/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c > index 72862653738e..096fbb4452cb 100644 > --- a/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c > +++ b/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c > @@ -1150,6 +1150,14 @@ ReadFile ( > ASSERT (FALSE); > Status =3D EFI_UNSUPPORTED; > break; > + > + default: > + // > + // A flag value reserved by the ECMA-167 standard (3rd Edition - Jun= e > + // 1997); 14.6 ICB Tag; 14.6.8 Flags (RBP 18); was found. > + // > + Status =3D EFI_UNSUPPORTED; > + break; > } >=20 > Done: > -- > 2.14.1.3.gb7cf6e02401b >=20