nvmf/vfio_user: cast numdw
to uint32_t
Use uint32_t to avoid overflow when left shift by 16 places This patch fix issue #2858 Signed-off-by: Sebastian Brzezinka <sebastian.brzezinka@intel.com> Change-Id: I07f4328674ae7bd7525792ca1e424e85a932c87f Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16180 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com> Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
This commit is contained in:
parent
58396fb135
commit
f80009632f
@ -5367,7 +5367,8 @@ map_admin_cmd_req(struct nvmf_vfio_user_ctrlr *ctrlr, struct spdk_nvmf_request *
|
||||
len = 4096;
|
||||
break;
|
||||
case SPDK_NVME_OPC_GET_LOG_PAGE:
|
||||
numdw = (((cmd->cdw11_bits.get_log_page.numdu << 16) | cmd->cdw10_bits.get_log_page.numdl) + 1);
|
||||
numdw = ((((uint32_t)cmd->cdw11_bits.get_log_page.numdu << 16) |
|
||||
cmd->cdw10_bits.get_log_page.numdl) + 1);
|
||||
if (numdw > UINT32_MAX / 4) {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user