998aee8 MdeModulePkg/UdfDxe: reject reserved values in ICB.Flags[2:0]

Authored and Committed by lersek 6 years ago
    MdeModulePkg/UdfDxe: reject reserved values in ICB.Flags[2:0]
    
    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)".
    
    https://www.ecma-international.org/publications/standards/Ecma-167.htm
    
    The
    
      switch (RecordingFlags)
    
    statement in the ReadFile() function handles all the standard values,
    using the constants of the UDF_FE_RECORDING_FLAGS enum type. However, the
    reserved values are not caught with a "default" case label, which both
    breaks the edk2 Coding Style Spec, and leaves the Status variable
    un-initialized, before we return Status under the Done label.
    
    Set Status to EFI_UNSUPPORTED if we encounter a reserved value.
    
    This issue was reported by Ard's and Gerd's CI systems independently
    (through build failures with GCC48/GCC49, DEBUG/RELEASE targets).
    
    Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
    Cc: Eric Dong <eric.dong@intel.com>
    Cc: Paulo Alcantara <pcacjr@zytor.com>
    Cc: Ruiyu Ni <ruiyu.ni@intel.com>
    Cc: Star Zeng <star.zeng@intel.com>
    Reported-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
    Reported-by: Gerd Hoffmann <kraxel@redhat.com>
    Contributed-under: TianoCore Contribution Agreement 1.1
    Signed-off-by: Laszlo Ersek <lersek@redhat.com>
    Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
    Reviewed-by: Star Zeng <star.zeng@intel.com>
    Reviewed-by: Paulo Alcantara <pcacjr@zytor.com>