- Timestamp:
- Apr 17, 2014 5:50:33 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/darwin/SUPDrv-darwin.cpp
r49965 r51100 5 5 6 6 /* 7 * Copyright (C) 2006-201 3Oracle Corporation7 * Copyright (C) 2006-2014 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 455 455 456 456 /* 457 * The process issuing the request must be the current process. 458 */ 459 RTPROCESS Process = RTProcSelf(); 460 if (Process != proc_pid(pProcess)) 461 return EIO; 462 463 /* 457 464 * Find the session created by org_virtualbox_SupDrvClient, fail 458 465 * if no such session, and mark it as opened. We set the uid & gid … … 472 479 RTGID Gid = pCred->cr_rgid; 473 480 #endif 474 RTPROCESS Process = RTProcSelf();475 481 unsigned iHash = SESSION_HASH(Process); 476 482 RTSpinlockAcquire(g_Spinlock); … … 552 558 */ 553 559 RTSpinlockAcquire(g_Spinlock); 560 554 561 pSession = g_apSessionHashTab[iHash]; 555 while (pSession && pSession->Process != Process && pSession->fUnrestricted == fUnrestricted && pSession->fOpened)562 while (pSession && (pSession->Process != Process || pSession->fUnrestricted != fUnrestricted || !pSession->fOpened)) 556 563 pSession = pSession->pNextHash; 557 564 558 565 if (RT_LIKELY(pSession)) 559 566 supdrvSessionRetain(pSession); 567 560 568 RTSpinlockReleaseNoInts(g_Spinlock); 561 if ( !pSession)569 if (RT_UNLIKELY(!pSession)) 562 570 { 563 571 OSDBGPRINT(("VBoxDrvDarwinIOCtl: WHAT?!? pSession == NULL! This must be a mistake... pid=%d iCmd=%#lx\n", … … 1411 1419 1412 1420 PSUPDRVSESSION pCur = g_apSessionHashTab[iHash]; 1413 if (pCur && pCur->Process != m_pSession->Process) 1414 { 1415 do pCur = pCur->pNextHash; 1416 while (pCur && pCur->Process != m_pSession->Process); 1417 } 1421 while (pCur && pCur->Process != m_pSession->Process) 1422 pCur = pCur->pNextHash; 1418 1423 if (!pCur) 1419 1424 {
Note:
See TracChangeset
for help on using the changeset viewer.