[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-8.1.2 12/45] hw/cxl: Fix out of bound array access
From: |
Michael Tokarev |
Subject: |
[Stable-8.1.2 12/45] hw/cxl: Fix out of bound array access |
Date: |
Wed, 4 Oct 2023 11:01:33 +0300 |
From: Dmitry Frolov <frolov@swemel.ru>
According to cxl_interleave_ways_enc(), fw->num_targets is allowed to be up
to 16. This also corresponds to CXL r3.0 spec. So, the fw->target_hbs[]
array is iterated from 0 to 15. But it is statically declared of length 8.
Thus, out of bound array access may occur.
Fixes: c28db9e000 ("hw/pci-bridge: Make PCIe and CXL PXB Devices inherit from
TYPE_PXB_DEV")
Signed-off-by: Dmitry Frolov <frolov@swemel.ru>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Link: https://lore.kernel.org/r/20230913101055.754709-1-frolov@swemel.ru
Cc: qemu-stable@nongnu.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
(cherry picked from commit de5bbfc602ef1b9b79c494a914c6083a1a23cca2)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/include/hw/cxl/cxl.h b/include/hw/cxl/cxl.h
index 56c9e7676e..4944725849 100644
--- a/include/hw/cxl/cxl.h
+++ b/include/hw/cxl/cxl.h
@@ -29,7 +29,7 @@ typedef struct PXBCXLDev PXBCXLDev;
typedef struct CXLFixedWindow {
uint64_t size;
char **targets;
- PXBCXLDev *target_hbs[8];
+ PXBCXLDev *target_hbs[16];
uint8_t num_targets;
uint8_t enc_int_ways;
uint8_t enc_int_gran;
--
2.39.2
- [Stable-8.1.2 02/45] host-utils: Add muldiv64_round_up, (continued)
- [Stable-8.1.2 02/45] host-utils: Add muldiv64_round_up, Michael Tokarev, 2023/10/04
- [Stable-8.1.2 08/45] hw/ppc: Read time only once to perform decrementer write, Michael Tokarev, 2023/10/04
- [Stable-8.1.2 11/45] hw/cxl: Fix CFMW config memory leak, Michael Tokarev, 2023/10/04
- [Stable-8.1.2 04/45] hw/ppc: Avoid decrementer rounding errors, Michael Tokarev, 2023/10/04
- [Stable-8.1.2 13/45] file-posix: Clear bs->bl.zoned on error, Michael Tokarev, 2023/10/04
- [Stable-8.1.2 16/45] file-posix: Simplify raw_co_prw's 'out' zone code, Michael Tokarev, 2023/10/04
- [Stable-8.1.2 07/45] hw/ppc: Reset timebase facilities on machine reset, Michael Tokarev, 2023/10/04
- [Stable-8.1.2 10/45] linux-user/hppa: lock both words of function descriptor, Michael Tokarev, 2023/10/04
- [Stable-8.1.2 15/45] file-posix: Fix zone update in I/O error path, Michael Tokarev, 2023/10/04
- [Stable-8.1.2 14/45] file-posix: Check bs->bl.zoned for zone info, Michael Tokarev, 2023/10/04
- [Stable-8.1.2 12/45] hw/cxl: Fix out of bound array access,
Michael Tokarev <=
- [Stable-8.1.2 09/45] linux-user/hppa: clear the PSW 'N' bit when delivering signals, Michael Tokarev, 2023/10/04
- [Stable-8.1.2 05/45] target/ppc: Sign-extend large decrementer to 64-bits, Michael Tokarev, 2023/10/04
- [Stable-8.1.2 06/45] hw/ppc: Always store the decrementer value, Michael Tokarev, 2023/10/04
- [Stable-8.1.2 24/45] ui/vnc: fix debug output for invalid audio message, Michael Tokarev, 2023/10/04
- [Stable-8.1.2 27/45] migration: Fix possible race when setting rp_state.error, Michael Tokarev, 2023/10/04
- [Stable-8.1.2 19/45] hw/arm/boot: Set SCR_EL3.FGTEn when booting kernel, Michael Tokarev, 2023/10/04
- [Stable-8.1.2 20/45] target/arm: Don't skip MTE checks for LDRT/STRT at EL0, Michael Tokarev, 2023/10/04
- [Stable-8.1.2 21/45] meson.build: Make keyutils independent from keyring, Michael Tokarev, 2023/10/04
- [Stable-8.1.2 23/45] hw/scsi/scsi-disk: Disallow block sizes smaller than 512 [CVE-2023-42467], Michael Tokarev, 2023/10/04
- [Stable-8.1.2 18/45] include/exec: Widen tlb_hit/tlb_hit_page(), Michael Tokarev, 2023/10/04