Spdk/lib/nvmf
John Levon acc4d1766c lib/nvmf: fix identify command corruption
In the previous fix:

adc2942ad nvmf: nvmf_ctrlr_get_log_page use iovs to store the log page

a data corruption bug in the log page code was fixed. Previously, it
used req->data, which may be too short a buffer in the case that the
buffer is split across more than one IOV. req->data is never safe to use
in this situation. The code was changed to use the provided iovs instead
of req->data.

However, the identify command handling was still vulnerable to this
problem, and has been seen in real life at least with a CentOS guest VM.

The fix is basically the same: use the IOV utility functions to write
out the response instead of directly trying to use req->data.

Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: I00445895af20e43be73189629576eee0667f86dd
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16121
Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2023-01-06 15:54:18 +00:00
..
ctrlr_bdev.c nvmf: return error on invalid req length for copy commands 2022-12-09 08:16:50 +00:00
ctrlr_discovery.c update Intel copyright notices 2022-11-10 08:28:53 +00:00
ctrlr.c lib/nvmf: fix identify command corruption 2023-01-06 15:54:18 +00:00
fc_ls.c update Intel copyright notices 2022-11-10 08:28:53 +00:00
fc.c misc: Fix spelling mistakes 2022-12-09 08:16:18 +00:00
Makefile nvmf: Add copy command support 2022-11-30 08:50:06 +00:00
nvmf_fc.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
nvmf_internal.h nvmf: Add copy command support 2022-11-30 08:50:06 +00:00
nvmf_rpc.c update Intel copyright notices 2022-11-10 08:28:53 +00:00
nvmf.c nvmf: add completed_nvme_io to nvmf_poll_group_stat 2022-12-16 09:27:50 +00:00
rdma.c nvmf/rdma: Factor out creating/destroying rdma resources into helper functions 2022-12-16 09:25:36 +00:00
spdk_nvmf.map lib/map file: Optimized some indentation formats 2022-12-05 09:43:30 +00:00
subsystem.c lib/nvmf: check the return value of the resume operation 2022-12-20 09:19:57 +00:00
tcp.c misc: Fix spelling mistakes 2022-12-09 08:16:18 +00:00
transport.c update Intel copyright notices 2022-11-10 08:28:53 +00:00
transport.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
vfio_user.c nvmf/vfio_user: add numdw to avoide signed integer overflow 2023-01-05 23:27:12 +00:00