From: Klaus Jensen <its@irrelevant.dk>
To: qemu-devel@nongnu.org
Cc: qemu-block@nongnu.org, qemu-security@nongnu.org,
Keith Busch <kbusch@kernel.org>,
Mauro Matteo Cascella <mcascell@redhat.com>,
zdi-disclosures@trendmicro.com,
Klaus Jensen <k.jensen@samsung.com>,
qemu-stable@nongnu.org
Subject: Re: [PATCH] hw/nvme: fix oob memory read in fdp events log
Date: Tue, 8 Aug 2023 08:15:31 +0200 [thread overview]
Message-ID: <ZNHdgwUSQuhLSG-w@cormorant.local> (raw)
In-Reply-To: <20230803184422.27521-2-its@irrelevant.dk>
[-- Attachment #1: Type: text/plain, Size: 1317 bytes --]
+CC qemu-stable
On Aug 3 20:44, Klaus Jensen wrote:
> From: Klaus Jensen <k.jensen@samsung.com>
>
> As reported by Trend Micro's Zero Day Initiative, an oob memory read
> vulnerability exists in nvme_fdp_events(). The host-provided offset is
> not verified.
>
> Fix this.
>
> This is only exploitable when Flexible Data Placement mode (fdp=on) is
> enabled.
>
> Fixes: CVE-2023-4135
> Fixes: 73064edfb864 ("hw/nvme: flexible data placement emulation")
> Reported-by: Trend Micro's Zero Day Initiative
> Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
> ---
> hw/nvme/ctrl.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c
> index f2e5a2fa737b..e9b5a55811b8 100644
> --- a/hw/nvme/ctrl.c
> +++ b/hw/nvme/ctrl.c
> @@ -5120,6 +5120,11 @@ static uint16_t nvme_fdp_events(NvmeCtrl *n, uint32_t endgrpid,
> }
>
> log_size = sizeof(NvmeFdpEventsLog) + ebuf->nelems * sizeof(NvmeFdpEvent);
> +
> + if (off >= log_size) {
> + return NVME_INVALID_FIELD | NVME_DNR;
> + }
> +
> trans_len = MIN(log_size - off, buf_len);
> elog = g_malloc0(log_size);
> elog->num_events = cpu_to_le32(ebuf->nelems);
> --
> 2.41.0
>
--
One of us - No more doubt, silence or taboo about mental illness.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
prev parent reply other threads:[~2023-08-08 6:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-03 18:44 [PATCH] hw/nvme: fix oob memory read in fdp events log Klaus Jensen
2023-08-08 6:15 ` Klaus Jensen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZNHdgwUSQuhLSG-w@cormorant.local \
--to=its@irrelevant.dk \
--cc=k.jensen@samsung.com \
--cc=kbusch@kernel.org \
--cc=mcascell@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-security@nongnu.org \
--cc=qemu-stable@nongnu.org \
--cc=zdi-disclosures@trendmicro.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.