nvme_ns_cmd: add overflow check in write_zeroes function
The value for lba_count is stored in a 0-based 16 bit register. here we confirm that the value passed to that register is no larger than 2^16. Change-Id: I234e55fc2b61338444dfe8f734e76f958d1f0443 Signed-off-by: Seth Howell <seth.howell@intel.com> Reviewed-on: https://review.gerrithub.io/372370 Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
d8e88d9918
commit
8fbcc1e3ec
@ -714,7 +714,7 @@ spdk_nvme_ns_cmd_write_zeroes(struct spdk_nvme_ns *ns, struct spdk_nvme_qpair *q
|
||||
struct spdk_nvme_cmd *cmd;
|
||||
uint64_t *tmp_lba;
|
||||
|
||||
if (lba_count == 0) {
|
||||
if (lba_count == 0 || lba_count > UINT16_MAX + 1) {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user