[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 12/15] hw/pvrdma: Protect against buggy or malicious guest driver
From: |
Laurent Vivier |
Subject: |
[PULL 12/15] hw/pvrdma: Protect against buggy or malicious guest driver |
Date: |
Wed, 18 Jan 2023 08:52:31 +0100 |
From: Yuval Shaia <yuval.shaia.ml@gmail.com>
Guest driver might execute HW commands when shared buffers are not yet
allocated.
This could happen on purpose (malicious guest) or because of some other
guest/host address mapping error.
We need to protect againts such case.
Fixes: CVE-2022-1050
Reported-by: Raven <wxhusst@gmail.com>
Signed-off-by: Yuval Shaia <yuval.shaia.ml@gmail.com>
Message-Id: <20220403095234.2210-1-yuval.shaia.ml@gmail.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
hw/rdma/vmw/pvrdma_cmd.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/hw/rdma/vmw/pvrdma_cmd.c b/hw/rdma/vmw/pvrdma_cmd.c
index 1eca6328c924..c6ed02598211 100644
--- a/hw/rdma/vmw/pvrdma_cmd.c
+++ b/hw/rdma/vmw/pvrdma_cmd.c
@@ -776,6 +776,12 @@ int pvrdma_exec_cmd(PVRDMADev *dev)
dsr_info = &dev->dsr_info;
+ if (!dsr_info->dsr) {
+ /* Buggy or malicious guest driver */
+ rdma_error_report("Exec command without dsr, req or rsp buffers");
+ goto out;
+ }
+
if (dsr_info->req->hdr.cmd >= sizeof(cmd_handlers) /
sizeof(struct cmd_handler)) {
rdma_error_report("Unsupported command");
--
2.38.1
- [PULL 00/15] Trivial branch for 8.0 patches, Laurent Vivier, 2023/01/18
- [PULL 02/15] hw/display: Move omap_lcdc.c out of target-specific source set, Laurent Vivier, 2023/01/18
- [PULL 03/15] hw/intc: Move some files out of the target-specific source set, Laurent Vivier, 2023/01/18
- [PULL 04/15] hw/tpm: Move tpm_ppi.c out of target-specific source set, Laurent Vivier, 2023/01/18
- [PULL 06/15] hw/cpu: Mark arm11 and realview mpcore as target-independent code, Laurent Vivier, 2023/01/18
- [PULL 05/15] hw/arm: Move various units to softmmu_ss[], Laurent Vivier, 2023/01/18
- [PULL 12/15] hw/pvrdma: Protect against buggy or malicious guest driver,
Laurent Vivier <=
- [PULL 08/15] hw/usb: Mark the XLNX_VERSAL-related files as target-independent, Laurent Vivier, 2023/01/18
- [PULL 10/15] hw/i386/pc: Remove unused 'owner' argument from pc_pci_as_mapping_init, Laurent Vivier, 2023/01/18
- [PULL 07/15] hw/intc: Mark more interrupt-controller files as target independent, Laurent Vivier, 2023/01/18
- [PULL 09/15] tests/qtest/test-hmp: Improve the check for verbose mode, Laurent Vivier, 2023/01/18
- [PULL 11/15] ccid-card-emulated: fix cast warning/error, Laurent Vivier, 2023/01/18
- [PULL 13/15] hw/cxl/cxl-cdat.c: spelling: missmatch, Laurent Vivier, 2023/01/18
- [PULL 14/15] hw/cxl/cxl-host: Fix an error message typo, Laurent Vivier, 2023/01/18
- [PULL 01/15] Call qemu_socketpair() instead of socketpair() when possible, Laurent Vivier, 2023/01/18
- [PULL 15/15] hw/ssi/sifive_spi.c: spelling: reigster, Laurent Vivier, 2023/01/18
- Re: [PULL 00/15] Trivial branch for 8.0 patches, Peter Maydell, 2023/01/19