diff options
| -rw-r--r-- | meta/recipes-devtools/qemu/qemu.inc | 1 | ||||
| -rw-r--r-- | meta/recipes-devtools/qemu/qemu/CVE-2021-3607.patch | 43 |
2 files changed, 44 insertions, 0 deletions
diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc index 854a907216..6066418a7b 100644 --- a/meta/recipes-devtools/qemu/qemu.inc +++ b/meta/recipes-devtools/qemu/qemu.inc | |||
| @@ -82,6 +82,7 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \ | |||
| 82 | file://CVE-2021-3527-1.patch \ | 82 | file://CVE-2021-3527-1.patch \ |
| 83 | file://CVE-2021-3527-2.patch \ | 83 | file://CVE-2021-3527-2.patch \ |
| 84 | file://CVE-2021-3582.patch \ | 84 | file://CVE-2021-3582.patch \ |
| 85 | file://CVE-2021-3607.patch \ | ||
| 85 | " | 86 | " |
| 86 | UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar" | 87 | UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar" |
| 87 | 88 | ||
diff --git a/meta/recipes-devtools/qemu/qemu/CVE-2021-3607.patch b/meta/recipes-devtools/qemu/qemu/CVE-2021-3607.patch new file mode 100644 index 0000000000..0547c74484 --- /dev/null +++ b/meta/recipes-devtools/qemu/qemu/CVE-2021-3607.patch | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | From 32e5703cfea07c91e6e84bcb0313f633bb146534 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Marcel Apfelbaum <marcel.apfelbaum@gmail.com> | ||
| 3 | Date: Wed, 30 Jun 2021 14:46:34 +0300 | ||
| 4 | Subject: [PATCH] pvrdma: Ensure correct input on ring init (CVE-2021-3607) | ||
| 5 | |||
| 6 | Check the guest passed a non zero page count | ||
| 7 | for pvrdma device ring buffers. | ||
| 8 | |||
| 9 | Fixes: CVE-2021-3607 | ||
| 10 | Reported-by: VictorV (Kunlun Lab) <vv474172261@gmail.com> | ||
| 11 | Reviewed-by: VictorV (Kunlun Lab) <vv474172261@gmail.com> | ||
| 12 | Signed-off-by: Marcel Apfelbaum <marcel@redhat.com> | ||
| 13 | Message-Id: <20210630114634.2168872-1-marcel@redhat.com> | ||
| 14 | Reviewed-by: Yuval Shaia <yuval.shaia.ml@gmail.com> | ||
| 15 | Tested-by: Yuval Shaia <yuval.shaia.ml@gmail.com> | ||
| 16 | Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com> | ||
| 17 | |||
| 18 | CVE: CVE-2021-3607 | ||
| 19 | Upstream-Status: Backport [32e5703cfea07c91e6e84bcb0313f633bb146534] | ||
| 20 | Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com> | ||
| 21 | --- | ||
| 22 | hw/rdma/vmw/pvrdma_main.c | 5 +++++ | ||
| 23 | 1 file changed, 5 insertions(+) | ||
| 24 | |||
| 25 | diff --git a/hw/rdma/vmw/pvrdma_main.c b/hw/rdma/vmw/pvrdma_main.c | ||
| 26 | index 84ae8024fc..7c0c3551a8 100644 | ||
| 27 | --- a/hw/rdma/vmw/pvrdma_main.c | ||
| 28 | +++ b/hw/rdma/vmw/pvrdma_main.c | ||
| 29 | @@ -92,6 +92,11 @@ static int init_dev_ring(PvrdmaRing *ring, PvrdmaRingState **ring_state, | ||
| 30 | uint64_t *dir, *tbl; | ||
| 31 | int rc = 0; | ||
| 32 | |||
| 33 | + if (!num_pages) { | ||
| 34 | + rdma_error_report("Ring pages count must be strictly positive"); | ||
| 35 | + return -EINVAL; | ||
| 36 | + } | ||
| 37 | + | ||
| 38 | dir = rdma_pci_dma_map(pci_dev, dir_addr, TARGET_PAGE_SIZE); | ||
| 39 | if (!dir) { | ||
| 40 | rdma_error_report("Failed to map to page directory (ring %s)", name); | ||
| 41 | -- | ||
| 42 | 2.25.1 | ||
| 43 | |||
