]> git.proxmox.com Git - mirror_edk2.git/commit
MdeModulePkg: Add a check for metadata size in NvmExpress Driver
authorMa, Hua <Hua.Ma@intel.com>
Thu, 3 Mar 2022 05:06:04 +0000 (13:06 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Mon, 7 Mar 2022 01:55:41 +0000 (01:55 +0000)
commit79f2734e5a7bc2e5256eb0e599f45407855159c7
tree76453172eb7f3b70babf334b5fbcb10edc99fa4e
parent4adc364c75b556eb0b741332f08c0aceb5e2cb0a
MdeModulePkg: Add a check for metadata size in NvmExpress Driver

Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3856

Currently this NvmeExpress Driver do not support metadata handling.
According to the NVME specs, metadata may be transferred to the host after
the logical block data. It can overrun the input buffer which may only
be the size of logical block data.

Add a check to return not support for the namespaces formatted with
metadata.

v2 changes:
 - Change debug log level from INFO to ERROR
 - Change to if (NamespaceData->LbaFormat[LbaFmtIdx].Ms != 0)

v1: https://edk2.groups.io/g/devel/message/87242

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Hua Ma <hua.ma@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpress.c
MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPei.c