|
Bitdefender Hypervisor Memory Introspection
|
Go to the source code of this file.
Functions | |
| static void | IntCrSendAlert (EXCEPTION_VICTIM_ZONE const *Victim, EXCEPTION_KM_ORIGINATOR const *Originator, INTRO_ACTION Action, INTRO_ACTION_REASON Reason) |
| Sends a CR violation alert. More... | |
| static INTSTATUS | IntCrWinHandleWrite (void *Context, DWORD Cr, QWORD OldValue, QWORD NewValue, INTRO_ACTION *Action) |
| Handles a control register write attempt done by a Windows guest. More... | |
| static INTSTATUS | IntCrLixHandleWrite (void *Context, DWORD Cr, QWORD OldValue, QWORD NewValue, INTRO_ACTION *Action) |
| Handles a control register write attempt done by a Linux guest. More... | |
| static INTSTATUS | IntCr4HandleWrite (void *Context, DWORD Cr, QWORD OldValue, QWORD NewValue, INTRO_ACTION *Action) |
| Handles CR4 writes. More... | |
| INTSTATUS | IntCr4Protect (void) |
| Activates the Cr4 protection. More... | |
| INTSTATUS | IntCr4Unprotect (void) |
| Disables the CR4 protection. More... | |
Variables | |
| static HOOK_CR * | gCr4Hook = NULL |
| The Cr4 hook handle. More... | |
|
static |
Handles CR4 writes.
This is the hook handler set by IntCr4Protect. The handle is gCr4Hook. Will delegate the actual handling to a guest-specific handler: IntCrWinHandleWrite or IntCrLixHandleWrite.
| [in] | Context | The context set by the function that hooked the CR. Nothing in this case |
| [in] | Cr | The number of the written register. Will always be 4. |
| [in] | OldValue | The original value of the register |
| [in] | NewValue | The value that the guest attempted to write |
| [out] | Action | The action that must be taken |
Definition at line 277 of file cr_protection.c.
Referenced by IntCr4Protect().
| INTSTATUS IntCr4Protect | ( | void | ) |
Activates the Cr4 protection.
Enables exits for Cr4 writes and sets IntCr4HandleWrite as the hook handler.
Definition at line 313 of file cr_protection.c.
Referenced by IntGuestUpdateCoreOptions(), IntLixGuestActivateProtection(), and IntWinGuestActivateProtection().
| INTSTATUS IntCr4Unprotect | ( | void | ) |
Disables the CR4 protection.
Definition at line 345 of file cr_protection.c.
Referenced by IntGuestUpdateCoreOptions(), IntLixGuestUninit(), and IntWinGuestUninit().
|
static |
Handles a control register write attempt done by a Linux guest.
Will analyze the write and will decide if it is malicious. If the SMEP or SMAP bits are disabled it will generate an alert, unless an exception matches this write.
| [in] | Context | Ignored |
| [in] | Cr | The written control register. This will always be 4 |
| [in] | OldValue | The old, original value of the register. If the action is blocked, the register will keep this value |
| [in] | NewValue | The written value |
| [out] | Action | The action that must be taken |
Definition at line 175 of file cr_protection.c.
Referenced by IntCr4HandleWrite().
|
static |
Sends a CR violation alert.
This will send an introEventCrViolation event to the integrator. These alerts are controlled by the INTRO_OPT_ENABLE_CR_PROTECTION options.
| [in] | Victim | The victim information. This is obtained from IntExceptGetVictimCr. |
| [in] | Originator | Information about the attacker. This is obtained from IntExceptKernelGetOriginator. |
| [in] | Action | The action that was taken |
| [in] | Reason | The reason for which Action was taken |
Definition at line 17 of file cr_protection.c.
Referenced by IntCrLixHandleWrite(), and IntCrWinHandleWrite().
|
static |
Handles a control register write attempt done by a Windows guest.
Will analyze the write and will decide if it is malicious. If the SMEP or SMAP bits are disabled it will generate an alert, unless an exception matches this write.
| [in] | Context | Ignored |
| [in] | Cr | The written control register. This will always be 4 |
| [in] | OldValue | The old, original value of the register. If the action is blocked, the register will keep this value |
| [in] | NewValue | The written value |
| [out] | Action | The action that must be taken |
Definition at line 83 of file cr_protection.c.
Referenced by IntCr4HandleWrite().
|
static |
The Cr4 hook handle.
Created in IntCr4Protect and destroyed in IntCr4Unprotect
Definition at line 13 of file cr_protection.c.