QEMU-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Aaron Esau <aaron1esau@gmail.com>
To: qemu-devel@nongnu.org
Cc: Jonathan.Cameron@huawei.com, jic23@kernel.org,
	berrange@redhat.com, Aaron Esau <git@aaronesau.com>
Subject: [PATCH 0/2] hw/cxl: Fix two OOB access bugs in CXL mailbox commands
Date: Thu, 16 Apr 2026 15:07:00 -0500	[thread overview]
Message-ID: <20260416200702.2374709-1-git@aaronesau.com> (raw)

Two fixes for CXL Type-3 device emulation in hw/cxl/cxl-mailbox-utils.c:

Patch 1: cmd_logs_get_log() performs pointer arithmetic on a struct
array using a byte offset, reading past the end of cel_log. Fix the
memmove to use byte-based pointer arithmetic (cast to uint8_t *).

Patch 2: cmd_features_set_feature() is missing bounds checks on six
Set Feature handlers (soft_ppr, hard_ppr, cacheline_sparing,
row_sparing, bank_sparing, rank_sparing). A guest-controlled offset
and payload length can overflow the small write-attribute structs
into adjacent CXLType3Dev fields. Add the same bounds check already
present in the patrol_scrub and ecs cases.

Aaron Esau (2):
  hw/cxl: fix OOB read in Get Log command due to incorrect pointer
    arithmetic
  hw/cxl: add missing bounds checks in Set Feature for PPR and sparing

 hw/cxl/cxl-mailbox-utils.c | 33 ++++++++++++++++++++++++++++++++-
 1 file changed, 32 insertions(+), 1 deletion(-)

-- 
2.53.0



             reply	other threads:[~2026-04-16 22:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-16 20:07 Aaron Esau [this message]
2026-04-16 20:07 ` [PATCH 1/2] hw/cxl: fix OOB read in Get Log command due to incorrect pointer arithmetic Aaron Esau
2026-05-13  6:35   ` Michael Tokarev
2026-05-13 21:41     ` Aaron Esau
2026-04-16 20:07 ` [PATCH 2/2] hw/cxl: add missing bounds checks in Set Feature for PPR and sparing Aaron Esau

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=20260416200702.2374709-1-git@aaronesau.com \
    --to=aaron1esau@gmail.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=berrange@redhat.com \
    --cc=git@aaronesau.com \
    --cc=jic23@kernel.org \
    --cc=qemu-devel@nongnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox