mirror of https://github.com/xemu-project/xemu.git
PVRDMA queue
Several CVE fixes for the PVRDMA device. -----BEGIN PGP SIGNATURE----- iQEcBAABAgAGBQJg4hJVAAoJEDbUwPDPL+RtGEkIAJs7yas9LdaP80scaEQ3UiOJ Mr9M2+RwoUm19YhrM2MqjIByluB5Jk2bO1ZmpuJmeg03V15I8AV8MozKGAzZaThx 8LVwduqlmdnrprBYKVRRn/SLSqbMkRSXGli9BjX2PoF97VeqvhNOxH1hL6z8Ytn6 zzpsOSq7NmC87hLdvL2UIkpYy1Z4bUjAWr1wn7K6jIhM163pek61rmO9eWwc7W3y M1lXtGtrLgE0AuLm0oEJwz0xqlOuN8ld5kwIEu33RnL8phLwT0hDjHoLPqIX79bS UdIL1zNjwXKI0DkR5EoVLRMdF87b3LMfVEvij25PNLPf6gyyh5FHmdqQi0r3sZU= =MrNO -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/marcel/tags/pvrdma-04-07-2021-v2' into staging PVRDMA queue Several CVE fixes for the PVRDMA device. # gpg: Signature made Sun 04 Jul 2021 20:56:05 BST # gpg: using RSA key 36D4C0F0CF2FE46D # gpg: Good signature from "Marcel Apfelbaum <marcel.apfelbaum@zoho.com>" [marginal] # gpg: aka "Marcel Apfelbaum <marcel@redhat.com>" [marginal] # gpg: aka "Marcel Apfelbaum <marcel.apfelbaum@gmail.com>" [marginal] # gpg: WARNING: This key is not certified with sufficiently trusted signatures! # gpg: It is not certain that the signature belongs to the owner. # Primary key fingerprint: B1C6 3A57 F92E 08F2 640F 31F5 36D4 C0F0 CF2F E46D * remotes/marcel/tags/pvrdma-04-07-2021-v2: pvrdma: Fix the ring init error flow (CVE-2021-3608) pvrdma: Ensure correct input on ring init (CVE-2021-3607) hw/rdma: Fix possible mremap overflow in the pvrdma device (CVE-2021-3582) Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
4fb2820854
|
@ -38,6 +38,13 @@ static void *pvrdma_map_to_pdir(PCIDevice *pdev, uint64_t pdir_dma,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
length = ROUND_UP(length, TARGET_PAGE_SIZE);
|
||||
if (nchunks * TARGET_PAGE_SIZE != length) {
|
||||
rdma_error_report("Invalid nchunks/length (%u, %lu)", nchunks,
|
||||
(unsigned long)length);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
dir = rdma_pci_dma_map(pdev, pdir_dma, TARGET_PAGE_SIZE);
|
||||
if (!dir) {
|
||||
rdma_error_report("Failed to map to page directory");
|
||||
|
|
|
@ -41,7 +41,7 @@ int pvrdma_ring_init(PvrdmaRing *ring, const char *name, PCIDevice *dev,
|
|||
qatomic_set(&ring->ring_state->cons_head, 0);
|
||||
*/
|
||||
ring->npages = npages;
|
||||
ring->pages = g_malloc(npages * sizeof(void *));
|
||||
ring->pages = g_malloc0(npages * sizeof(void *));
|
||||
|
||||
for (i = 0; i < npages; i++) {
|
||||
if (!tbl[i]) {
|
||||
|
|
|
@ -92,6 +92,11 @@ static int init_dev_ring(PvrdmaRing *ring, PvrdmaRingState **ring_state,
|
|||
uint64_t *dir, *tbl;
|
||||
int rc = 0;
|
||||
|
||||
if (!num_pages) {
|
||||
rdma_error_report("Ring pages count must be strictly positive");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
dir = rdma_pci_dma_map(pci_dev, dir_addr, TARGET_PAGE_SIZE);
|
||||
if (!dir) {
|
||||
rdma_error_report("Failed to map to page directory (ring %s)", name);
|
||||
|
|
Loading…
Reference in New Issue