[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-9.0.3 63/69] hw/nvme: fix leak of uninitialized memory in io_mgm
From: |
Michael Tokarev |
Subject: |
[Stable-9.0.3 63/69] hw/nvme: fix leak of uninitialized memory in io_mgmt_recv |
Date: |
Fri, 6 Sep 2024 14:13:12 +0300 |
From: Klaus Jensen <k.jensen@samsung.com>
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>
(cherry picked from commit 6a22121c4f25b181e99479f65958ecde65da1c92)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c
index 652116085e..659332db0a 100644
--- a/hw/nvme/ctrl.c
+++ b/hw/nvme/ctrl.c
@@ -4302,7 +4302,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);
--
2.39.2
- [Stable-9.0.3 53/69] block/blkio: use FUA flag on write zeroes only if supported, (continued)
- [Stable-9.0.3 53/69] block/blkio: use FUA flag on write zeroes only if supported, Michael Tokarev, 2024/09/06
- [Stable-9.0.3 54/69] target/i386: Do not apply REX to MMX operands, Michael Tokarev, 2024/09/06
- [Stable-9.0.3 55/69] target/arm: Clear high SVE elements in handle_vec_simd_wshli, Michael Tokarev, 2024/09/06
- [Stable-9.0.3 56/69] target/arm: Update translation regime comment for new features, Michael Tokarev, 2024/09/06
- [Stable-9.0.3 57/69] target/arm: Fix usage of MMU indexes when EL3 is AArch32, Michael Tokarev, 2024/09/06
- [Stable-9.0.3 58/69] module: Prevent crash by resetting local_err in module_load_qom_all(), Michael Tokarev, 2024/09/06
- [Stable-9.0.3 59/69] target/hexagon: don't look for static glib, Michael Tokarev, 2024/09/06
- [Stable-9.0.3 60/69] linux-user: Preserve NULL hit in target_mmap subroutines, Michael Tokarev, 2024/09/06
- [Stable-9.0.3 61/69] target/sparc: Restrict STQF to sparcv9, Michael Tokarev, 2024/09/06
- [Stable-9.0.3 62/69] crypto/tlscredspsk: Free username on finalize, Michael Tokarev, 2024/09/06
- [Stable-9.0.3 63/69] hw/nvme: fix leak of uninitialized memory in io_mgmt_recv,
Michael Tokarev <=
- [Stable-9.0.3 64/69] virtio-pci: Fix the use of an uninitialized irqfd, Michael Tokarev, 2024/09/06
- [Stable-9.0.3 65/69] migration/multifd: Free MultiFDRecvParams::data, Michael Tokarev, 2024/09/06
- [Stable-9.0.3 66/69] linux-user: Handle short reads in mmap_h_gt_g, Michael Tokarev, 2024/09/06
- [Stable-9.0.3 68/69] hw/audio/virtio-snd: fix invalid param check, Michael Tokarev, 2024/09/06
- [Stable-9.0.3 67/69] Revert "replay: stop us hanging in rr_wait_io_event", Michael Tokarev, 2024/09/06
- [Stable-9.0.3 69/69] target/hppa: Fix PSW V-bit packaging in cpu_hppa_get for hppa64, Michael Tokarev, 2024/09/06