[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 46/46] hw/cxl: Fix read from bogus memory
From: |
Michael S. Tsirkin |
Subject: |
[PULL 46/46] hw/cxl: Fix read from bogus memory |
Date: |
Tue, 4 Jun 2024 15:08:45 -0400 |
From: Ira Weiny <ira.weiny@intel.com>
Peter and coverity report:
We've passed '&data' to address_space_write(), which means "read
from the address on the stack where the function argument 'data'
lives", so instead of writing 64 bytes of data to the guest ,
we'll write 64 bytes which start with a host pointer value and
then continue with whatever happens to be on the host stack
after that.
Indeed the intention was to write 64 bytes of data at the address given.
Fix the parameter to address_space_write().
Reported-by: Peter Maydell <peter.maydell@linaro.org>
Link:
https://lore.kernel.org/all/CAFEAcA-u4sytGwTKsb__Y+_+0O2-WwARntm3x8WNhvL1WfHOBg@mail.gmail.com/
Fixes: 6bda41a69bdc ("hw/cxl: Add clear poison mailbox command support.")
Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Message-Id: <20240531-fix-poison-set-cacheline-v1-1-e3bc7e8f1158@intel.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
hw/mem/cxl_type3.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/mem/cxl_type3.c b/hw/mem/cxl_type3.c
index 5d4a1276be..3274e5dcbb 100644
--- a/hw/mem/cxl_type3.c
+++ b/hw/mem/cxl_type3.c
@@ -1292,7 +1292,7 @@ static bool set_cacheline(CXLType3Dev *ct3d, uint64_t
dpa_offset, uint8_t *data)
dpa_offset -= (vmr_size + pmr_size);
}
- address_space_write(as, dpa_offset, MEMTXATTRS_UNSPECIFIED, &data,
+ address_space_write(as, dpa_offset, MEMTXATTRS_UNSPECIFIED, data,
CXL_CACHE_LINE_SIZE);
return true;
}
--
MST
- Re: [PULL 36/46] bios-tables-test: Add data for complex numa test (GI, GP etc), (continued)
[PULL 37/46] scripts/update-linux-headers: Copy setup_data.h to correct directory, Michael S. Tsirkin, 2024/06/04
[PULL 38/46] linux-headers: update to 6.10-rc1, Michael S. Tsirkin, 2024/06/04
[PULL 39/46] hw/misc/pvpanic: centralize definition of supported events, Michael S. Tsirkin, 2024/06/04
[PULL 40/46] tests/qtest/pvpanic: use centralized definition of supported events, Michael S. Tsirkin, 2024/06/04
[PULL 41/46] hw/misc/pvpanic: add support for normal shutdowns, Michael S. Tsirkin, 2024/06/04
[PULL 42/46] pvpanic: Emit GUEST_PVSHUTDOWN QMP event on pvpanic shutdown signal, Michael S. Tsirkin, 2024/06/04
[PULL 43/46] tests/qtest/pvpanic: add tests for pvshutdown event, Michael S. Tsirkin, 2024/06/04
[PULL 45/46] virtio-pci: Fix the failure process in kvm_virtio_pci_vector_use_one(), Michael S. Tsirkin, 2024/06/04
[PULL 46/46] hw/cxl: Fix read from bogus memory,
Michael S. Tsirkin <=
[PULL 44/46] Revert "docs/specs/pvpanic: mark shutdown event as not implemented", Michael S. Tsirkin, 2024/06/04
Re: [PULL 00/46] virtio: features,fixes, Michael S. Tsirkin, 2024/06/05
Re: [PULL 00/46] virtio: features,fixes, Peter Maydell, 2024/06/25