VirtualBox

Changeset 13871 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Nov 5, 2008 2:45:31 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
38869
Message:

VMMR0EntryFast: Always validate idCpu.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/VMMR0.cpp

    r13858 r13871  
    566566 * @param   pVM             The VM to operate on.
    567567 *                          The return code is stored in pVM->vmm.s.iLastGZRc.
    568  * @param   idCPU           VMCPU id.
     568 * @param   idCpu           VMCPU id.
    569569 * @param   enmOperation    Which operation to execute.
    570570 * @remarks Assume called with interrupts _enabled_.
    571571 */
    572 VMMR0DECL(void) VMMR0EntryFast(PVM pVM, unsigned idCPU, VMMR0OPERATION enmOperation)
    573 {
     572VMMR0DECL(void) VMMR0EntryFast(PVM pVM, unsigned idCpu, VMMR0OPERATION enmOperation)
     573{
     574    if (RT_UNLIKELY(idCpu >= pVM->cCPUs))
     575    {
     576        pVM->vmm.s.iLastGZRc = VERR_INVALID_PARAMETER;
     577        return;
     578    }
     579
    574580    switch (enmOperation)
    575581    {
     
    621627
    622628            STAM_COUNTER_INC(&pVM->vmm.s.StatRunRC);
    623 
    624             if (idCPU >= pVM->cCPUs)
    625             {
    626                 pVM->vmm.s.iLastGZRc = VERR_INVALID_PARAMETER;
    627                 return;
    628             }
    629629
    630630#ifndef RT_OS_WINDOWS /** @todo check other hosts */
Note: See TracChangeset for help on using the changeset viewer.

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