]> git.proxmox.com Git - mirror_edk2.git/commit
MdeModulePkg/NvmExpressPei: Refine data buffer & len check in PassThru
authorHao Wu <hao.a.wu@intel.com>
Fri, 9 Nov 2018 07:14:08 +0000 (15:14 +0800)
committerHao Wu <hao.a.wu@intel.com>
Tue, 13 Nov 2018 12:54:44 +0000 (20:54 +0800)
commitbd224a5dad4d32f5224f5e8ae998b70e4621dcd3
treecee56cbbf849efe461c1e1e66657af4f2b2bf80a
parentda2c81ee96eba5d5c8ef91fd870ac98d3cf72beb
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>
MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiPassThru.c