libnvmf: Zero controller data template for I/O controllers

This prevents stack garbage from leaking into the cdata used for the
userspace I/O controller in nvmfd(8).

Sponsored by:	Chelsio Communications
This commit is contained in:
John Baldwin 2024-07-19 17:06:47 -04:00
parent 66f360515d
commit e0649a35a6

View File

@ -425,6 +425,7 @@ nvmf_init_io_controller_data(struct nvmf_qpair *qp, const char *serial,
uname(&utsname);
memset(cdata, 0, sizeof(*cdata));
_nvmf_init_io_controller_data(qp->nq_cntlid, na->na_params.max_io_qsize,
serial, utsname.sysname, utsname.release, subnqn, nn, ioccsz,
sizeof(struct nvme_completion), cdata);