Skip to content

hw/cxl: Fix two OOB access bugs in CXL mailbox commands

Aaron Esau linux-cxl qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2hw/cxl: fix OOB read in Get Log command due to incorrect pointer arithmetichw/cxl/cxl-mailbox-utils.c+2 -13 replies
2/2hw/cxl: add missing bounds checks in Set Feature for PPR and sparinghw/cxl/cxl-mailbox-utils.c+30 -01 reply

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchJonathan Cameron
1/2R-b
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] hw/cxl: Fix two OOB access bugs in CXL mailbox commands

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(-)
Signature · 1 line
2.53.0