VirtualBox

Changeset 90572 in vbox for trunk/src


Ignore:
Timestamp:
Aug 7, 2021 1:24:00 PM (4 years ago)
Author:
vboxsync
Message:

VMM/PDMCritSect: Validate the queued pointer. bugref:6695

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/PDMAllCritSect.cpp

    r90558 r90572  
    10601060    VMM_ASSERT_RELEASE_MSG_RETURN(pVM, i < RT_ELEMENTS(pVCpu->pdm.s.apQueuedCritSectLeaves), ("%d\n", i), VERR_PDM_CRITSECT_IPE);
    10611061    pVCpu->pdm.s.apQueuedCritSectLeaves[i] = pCritSect->s.pSelfR3;
     1062    VMM_ASSERT_RELEASE_MSG_RETURN(pVM,
     1063                                     RT_VALID_PTR(pVCpu->pdm.s.apQueuedCritSectLeaves[i])
     1064                                  &&    ((uintptr_t)pVCpu->pdm.s.apQueuedCritSectLeaves[i] & PAGE_OFFSET_MASK)
     1065                                     == ((uintptr_t)pCritSect & PAGE_OFFSET_MASK),
     1066                                  ("%p vs %p\n", pVCpu->pdm.s.apQueuedCritSectLeaves[i], pCritSect),
     1067                                  pdmCritSectCorrupted(pCritSect, "Invalid pSelfR3 value"));
    10621068    VMCPU_FF_SET(pVCpu, VMCPU_FF_PDM_CRITSECT); /** @todo handle VMCPU_FF_PDM_CRITSECT in ring-0 outside the no-call-ring-3 part. */
    10631069    VMCPU_FF_SET(pVCpu, VMCPU_FF_TO_R3); /* unnecessary paranoia */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette