MdeModulePkg/NvmExpressPei: Refine data buffer & len check in PassThru

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1142

The fix is similar to commit ebb6c7633bca47fcd5b460a67e18e4a717ea91cc.
We found that a similar fix should be applied to the NVMe PEI driver as
well. Hence, this one is for the PEI counterpart driver.

According to the the NVM Express spec Revision 1.1, for some commands
(like Get/Set Feature Command, Figure 89 & 90 of the spec), the Memory
Buffer maybe optional although the command opcode indicates there is a
data transfer between host & controller (Get/Set Feature Command, Figure
38 of the spec).

Hence, this commit refine the checks for the 'TransferLength' and
'TransferBuffer' field of the
EDKII_PEI_NVM_EXPRESS_PASS_THRU_COMMAND_PACKET structure to address this
issue.

Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jiewen Yao <Jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
1 file changed
tree: cee56cbbf849efe461c1e1e66657af4f2b2bf80a
  1. AppPkg/
  2. ArmPkg/
  3. ArmPlatformPkg/
  4. ArmVirtPkg/
  5. BaseTools/
  6. BeagleBoardPkg/
  7. Conf/
  8. CorebootModulePkg/
  9. CorebootPayloadPkg/
  10. CryptoPkg/
  11. DuetPkg/
  12. EdkCompatibilityPkg/
  13. EdkShellBinPkg/
  14. EdkShellPkg/
  15. EmbeddedPkg/
  16. EmulatorPkg/
  17. FatPkg/
  18. FmpDevicePkg/
  19. IntelFrameworkModulePkg/
  20. IntelFrameworkPkg/
  21. IntelFsp2Pkg/
  22. IntelFsp2WrapperPkg/
  23. IntelFspPkg/
  24. IntelFspWrapperPkg/
  25. IntelSiliconPkg/
  26. MdeModulePkg/
  27. MdePkg/
  28. NetworkPkg/
  29. Nt32Pkg/
  30. Omap35xxPkg/
  31. OptionRomPkg/
  32. OvmfPkg/
  33. PcAtChipsetPkg/
  34. QuarkPlatformPkg/
  35. QuarkSocPkg/
  36. SecurityPkg/
  37. ShellBinPkg/
  38. ShellPkg/
  39. SignedCapsulePkg/
  40. SourceLevelDebugPkg/
  41. StandaloneMmPkg/
  42. StdLib/
  43. StdLibPrivateInternalFiles/
  44. UefiCpuPkg/
  45. UnixPkg/
  46. Vlv2DeviceRefCodePkg/
  47. Vlv2TbltDevicePkg/
  48. .gitignore
  49. .gitmodules
  50. BuildNotes2.txt
  51. Contributions.txt
  52. edksetup.bat
  53. edksetup.sh
  54. License.txt
  55. Maintainers.txt
  56. Readme.md
Readme.md

EDK II Project

A modern, feature-rich, cross-platform firmware development environment for the UEFI and PI specifications from www.uefi.org.

Contributions to the EDK II open source project are covered by the TianoCore Contribution Agreement 1.1

The majority of the content in the EDK II open source project uses a BSD 2-Clause License. The EDK II open source project contains the following components that are covered by additional licenses:

The EDK II Project is composed of packages. The maintainers for each package are listed in Maintainers.txt.

Resources