diff options
author | Klaus Jensen <k.jensen@samsung.com> | 2024-08-20 06:16:48 +0200 |
---|---|---|
committer | Klaus Jensen <k.jensen@samsung.com> | 2024-08-20 06:16:48 +0200 |
commit | 6a22121c4f25b181e99479f65958ecde65da1c92 (patch) | |
tree | 8335c13b8317186555b3344ba72b4a55014a4630 | |
parent | 48e4ba59a3756aad743982da16bf9b5120d91a0c (diff) | |
download | qemu-6a22121c4f25b181e99479f65958ecde65da1c92.zip qemu-6a22121c4f25b181e99479f65958ecde65da1c92.tar.gz qemu-6a22121c4f25b181e99479f65958ecde65da1c92.tar.bz2 |
hw/nvme: fix leak of uninitialized memory in io_mgmt_recv
Yutaro Shimizu from the Cyber Defense Institute discovered a bug in the
NVMe emulation that leaks contents of an uninitialized heap buffer if
subsystem and FDP emulation are enabled.
Cc: qemu-stable@nongnu.org
Reported-by: Yutaro Shimizu <shimizu@cyberdefense.jp>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
-rw-r--r-- | hw/nvme/ctrl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c index c6d4f61..9f277b8 100644 --- a/hw/nvme/ctrl.c +++ b/hw/nvme/ctrl.c @@ -4474,7 +4474,7 @@ static uint16_t nvme_io_mgmt_recv_ruhs(NvmeCtrl *n, NvmeRequest *req, nruhsd = ns->fdp.nphs * endgrp->fdp.nrg; trans_len = sizeof(NvmeRuhStatus) + nruhsd * sizeof(NvmeRuhStatusDescr); - buf = g_malloc(trans_len); + buf = g_malloc0(trans_len); trans_len = MIN(trans_len, len); |