VirtualBox

Ignore:
Timestamp:
Feb 5, 2018 6:13:55 PM (7 years ago)
Author:
vboxsync
Message:

VMMDev,VBoxGuest: Classify who is calling the host (part 1). bugref:9105

Location:
trunk/src/VBox/Additions/common/VBoxGuest/lib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR0LibGenericRequest.cpp

    r69500 r70873  
    127127            pReq->rc          = VERR_GENERAL_FAILURE;
    128128            pReq->reserved1   = 0;
    129             pReq->reserved2   = 0;
     129#ifdef VBGL_VBOXGUEST
     130            pReq->fRequestor  = VMMDEV_REQUESTOR_KERNEL        | VMMDEV_REQUESTOR_USR_DRV
     131#else
     132            pReq->fRequestor  = VMMDEV_REQUESTOR_KERNEL        | VMMDEV_REQUESTOR_USR_DRV_OTHER
     133#endif
    130134
     135                              | VMMDEV_REQUESTOR_CON_DONT_KNOW | VMMDEV_REQUESTOR_TRUST_NOT_GIVEN;
    131136            *ppReq = pReq;
    132137            rc = VINF_SUCCESS;
  • trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR0LibHGCMInternal.cpp

    r69638 r70873  
    8484/* These functions can be only used by VBoxGuest. */
    8585
    86 DECLR0VBGL(int) VbglR0HGCMInternalConnect(HGCMServiceLocation const *pLoc, HGCMCLIENTID *pidClient,
     86DECLR0VBGL(int) VbglR0HGCMInternalConnect(HGCMServiceLocation const *pLoc, uint32_t fRequestor, HGCMCLIENTID *pidClient,
    8787                                          PFNVBGLHGCMCALLBACK pfnAsyncCallback, void *pvAsyncData, uint32_t u32AsyncData)
    8888{
     
    9898        {
    9999            /* Initialize request memory */
     100            pHGCMConnect->header.header.fRequestor = fRequestor;
     101
    100102            pHGCMConnect->header.fu32Flags = 0;
    101103
     
    127129
    128130
    129 DECLR0VBGL(int) VbglR0HGCMInternalDisconnect(HGCMCLIENTID idClient,
     131DECLR0VBGL(int) VbglR0HGCMInternalDisconnect(HGCMCLIENTID idClient, uint32_t fRequestor,
    130132                                             PFNVBGLHGCMCALLBACK pfnAsyncCallback, void *pvAsyncData, uint32_t u32AsyncData)
    131133{
     
    140142        {
    141143            /* Initialize request memory */
     144            pHGCMDisconnect->header.header.fRequestor = fRequestor;
     145
    142146            pHGCMDisconnect->header.fu32Flags = 0;
    143147
     
    471475 * @param   pCallInfo       The call info.
    472476 * @param   cbCallInfo      The size of the call info structure.
     477 * @param   fRequestor      VMMDEV_REQUESTOR_XXX.
    473478 * @param   fIsUser         Is it a user request or kernel request.
    474479 * @param   pcbExtra        Where to return the extra request space needed for
     
    476481 */
    477482static void vbglR0HGCMInternalInitCall(VMMDevHGCMCall *pHGCMCall, PCVBGLIOCHGCMCALL pCallInfo,
    478                                        uint32_t cbCallInfo, bool fIsUser, struct VbglR0ParmInfo *pParmInfo)
     483                                       uint32_t cbCallInfo, uint32_t fRequestor, bool fIsUser, struct VbglR0ParmInfo *pParmInfo)
    479484{
    480485    HGCMFunctionParameter const *pSrcParm = VBGL_HGCM_GET_CALL_PARMS(pCallInfo);
     
    492497     * The call request headers.
    493498     */
     499    pHGCMCall->header.header.fRequestor = !fIsUser || (fRequestor & VMMDEV_REQUESTOR_USERMODE) ? fRequestor
     500                                        :   VMMDEV_REQUESTOR_USERMODE        | VMMDEV_REQUESTOR_USR_NOT_GIVEN
     501                                          | VMMDEV_REQUESTOR_TRUST_NOT_GIVEN | VMMDEV_REQUESTOR_CON_DONT_KNOW;
     502
    494503    pHGCMCall->header.fu32Flags = 0;
    495504    pHGCMCall->header.result    = VINF_SUCCESS;
     
    855864
    856865
    857 DECLR0VBGL(int) VbglR0HGCMInternalCall(PVBGLIOCHGCMCALL pCallInfo, uint32_t cbCallInfo, uint32_t fFlags,
     866DECLR0VBGL(int) VbglR0HGCMInternalCall(PVBGLIOCHGCMCALL pCallInfo, uint32_t cbCallInfo, uint32_t fFlags, uint32_t fRequestor,
    858867                                       PFNVBGLHGCMCALLBACK pfnAsyncCallback, void *pvAsyncData, uint32_t u32AsyncData)
    859868{
     
    896905        {
    897906            bool fLeakIt;
    898             vbglR0HGCMInternalInitCall(pHGCMCall, pCallInfo, cbCallInfo, fIsUser, &ParmInfo);
     907            vbglR0HGCMInternalInitCall(pHGCMCall, pCallInfo, cbCallInfo, fRequestor, fIsUser, &ParmInfo);
    899908
    900909            /*
     
    944953
    945954#if ARCH_BITS == 64
    946 DECLR0VBGL(int) VbglR0HGCMInternalCall32(PVBGLIOCHGCMCALL pCallInfo, uint32_t cbCallInfo, uint32_t fFlags,
     955DECLR0VBGL(int) VbglR0HGCMInternalCall32(PVBGLIOCHGCMCALL pCallInfo, uint32_t cbCallInfo, uint32_t fFlags, uint32_t fRequestor,
    947956                                         PFNVBGLHGCMCALLBACK pfnAsyncCallback, void *pvAsyncData, uint32_t u32AsyncData)
    948957{
     
    10181027    {
    10191028        rc = VbglR0HGCMInternalCall(pCallInfo64, sizeof(*pCallInfo64) + cParms * sizeof(HGCMFunctionParameter), fFlags,
    1020                                     pfnAsyncCallback, pvAsyncData, u32AsyncData);
     1029                                    fRequestor, pfnAsyncCallback, pvAsyncData, u32AsyncData);
    10211030
    10221031        if (RT_SUCCESS(rc))
  • trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibGR.cpp

    r69500 r70873  
    5252        pReq->rc          = VERR_GENERAL_FAILURE;
    5353        pReq->reserved1   = 0;
    54         pReq->reserved2   = 0;
     54        pReq->fRequestor  = 0;
    5555
    5656        *ppReq = pReq;
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