[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 53/65] hw/cxl: Ensuring enough data to read parameters in cmd_tunn
From: |
Michael S. Tsirkin |
Subject: |
[PULL 53/65] hw/cxl: Ensuring enough data to read parameters in cmd_tunnel_management_cmd() |
Date: |
Mon, 4 Nov 2024 16:09:00 -0500 |
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
If len_in is less than the minimum spec allowed value, then return
CXL_MBOX_INVALID_PAYLOAD_LENGTH
Reported-by: Esifiel <esifiel@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Message-Id: <20241101133917.27634-8-Jonathan.Cameron@huawei.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
hw/cxl/cxl-mailbox-utils.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/hw/cxl/cxl-mailbox-utils.c b/hw/cxl/cxl-mailbox-utils.c
index 5e571955b6..a40d81219c 100644
--- a/hw/cxl/cxl-mailbox-utils.c
+++ b/hw/cxl/cxl-mailbox-utils.c
@@ -151,6 +151,9 @@ static CXLRetCode cmd_tunnel_management_cmd(const struct
cxl_cmd *cmd,
in = (void *)payload_in;
out = (void *)payload_out;
+ if (len_in < sizeof(*in)) {
+ return CXL_MBOX_INVALID_PAYLOAD_LENGTH;
+ }
/* Enough room for minimum sized message - no payload */
if (in->size < sizeof(in->ccimessage)) {
return CXL_MBOX_INVALID_PAYLOAD_LENGTH;
--
MST
- [PULL 36/65] hw/cxl: Fix background completion percentage calculation, (continued)
- [PULL 36/65] hw/cxl: Fix background completion percentage calculation, Michael S. Tsirkin, 2024/11/04
- [PULL 41/65] hw/pci-bridge: Make pxb_dev_realize_common() return if it succeeded, Michael S. Tsirkin, 2024/11/04
- [PULL 42/65] vhost-user: fix shared object return values, Michael S. Tsirkin, 2024/11/04
- [PULL 44/65] pcie: enable Extended tag field support, Michael S. Tsirkin, 2024/11/04
- [PULL 45/65] cxl/cxl-mailbox-utils: Fix size check for cmd_firmware_update_get_info, Michael S. Tsirkin, 2024/11/04
- [PULL 46/65] hw/cxl/cxl-mailbox-util: Fix output buffer index update when retrieving DC extents, Michael S. Tsirkin, 2024/11/04
- [PULL 47/65] hw/cxl: Check size of input data to dynamic capacity mailbox commands, Michael S. Tsirkin, 2024/11/04
- [PULL 48/65] hw/cxl: Check input includes at least the header in cmd_features_set_feature(), Michael S. Tsirkin, 2024/11/04
- [PULL 49/65] hw/cxl: Check input length is large enough in cmd_events_clear_records(), Michael S. Tsirkin, 2024/11/04
- [PULL 50/65] hw/cxl: Check enough data in cmd_firmware_update_transfer(), Michael S. Tsirkin, 2024/11/04
- [PULL 53/65] hw/cxl: Ensuring enough data to read parameters in cmd_tunnel_management_cmd(),
Michael S. Tsirkin <=
- [PULL 54/65] hw/cxl: Check that writes do not go beyond end of target attributes, Michael S. Tsirkin, 2024/11/04
- [PULL 55/65] hw/cxl: Ensure there is enough data for the header in cmd_ccls_set_lsa(), Michael S. Tsirkin, 2024/11/04
- [PULL 56/65] hw/cxl: Ensure there is enough data to read the input header in cmd_get_physical_port_state(), Michael S. Tsirkin, 2024/11/04
- [PULL 29/65] amd_iommu: Add support for pass though mode, Michael S. Tsirkin, 2024/11/04
- [PULL 57/65] hw/pci: Add parenthesis to PCI_BUILD_BDF macro, Michael S. Tsirkin, 2024/11/04
- [PULL 58/65] hw/acpi: Make CPUs ACPI `presence` conditional during vCPU hot-unplug, Michael S. Tsirkin, 2024/11/04
- [PULL 59/65] qtest: allow ACPI DSDT Table changes, Michael S. Tsirkin, 2024/11/04
- [PULL 60/65] hw/acpi: Update ACPI `_STA` method with QOM vCPU ACPI Hotplug states, Michael S. Tsirkin, 2024/11/04