Commit 4b1c2e5f authored by Seth Howell's avatar Seth Howell Committed by Jim Harris
Browse files

blob: Make sure that our IOVs match the io size



This is in response to a Scan-build error with Clang 6.0 but is a real
bug. If we don't match up our IOVs properly with the lenght we provide,
we could jump over the iov list into invalid memory in
_spdk_rw_iov_split_next.

Change-Id: I472a7aa53027af0a18ebeee8226e0b008447cce4
Signed-off-by: default avatarSeth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/424248


Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 938183c9
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2023,6 +2023,7 @@ _spdk_rw_iov_split_next(void *cb_arg, int bserrno)
	iov = &ctx->iov[0];
	iovcnt = 0;
	while (byte_count > 0) {
		assert(iovcnt < ctx->iovcnt);
		iov->iov_len = spdk_min(byte_count, orig_iov->iov_len - orig_iovoff);
		iov->iov_base = orig_iov->iov_base + orig_iovoff;
		byte_count -= iov->iov_len;