[go: up one dir, main page]

HK1216679B - Page fault injection in virtual machines - Google Patents

Page fault injection in virtual machines Download PDF

Info

Publication number
HK1216679B
HK1216679B HK16104630.0A HK16104630A HK1216679B HK 1216679 B HK1216679 B HK 1216679B HK 16104630 A HK16104630 A HK 16104630A HK 1216679 B HK1216679 B HK 1216679B
Authority
HK
Hong Kong
Prior art keywords
page
memory
processor
virtualization
virtual machine
Prior art date
Application number
HK16104630.0A
Other languages
Chinese (zh)
Other versions
HK1216679A1 (en
Inventor
安德烈-弗拉德.卢察什
Original Assignee
比特梵德知识产权管理有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority claimed from US14/289,163 external-priority patent/US9507727B2/en
Application filed by 比特梵德知识产权管理有限公司 filed Critical 比特梵德知识产权管理有限公司
Publication of HK1216679A1 publication Critical patent/HK1216679A1/en
Publication of HK1216679B publication Critical patent/HK1216679B/en

Links

Description

虚拟机中的页面错误注入Page fault injection in virtual machines

相关申请案Related applications

本申请案主张2013年7月17日申请的题为“虚拟机中的页面错误注入(Page FaultInjection In Virtual Machines)”的第61/847,538号美国临时专利申请案的申请日期的权益,所述申请案的全部内容以引用方式并入本文中。This application claims the benefit of the filing date of U.S. Provisional Patent Application No. 61/847,538, filed on July 17, 2013, entitled “Page Fault Injection In Virtual Machines,” which is incorporated herein by reference in its entirety.

背景技术Background Art

本发明涉及用于保护计算机系统免受恶意软件影响的系统及方法。The present invention relates to systems and methods for protecting computer systems from malware.

恶意软件(也称为恶意软件(malware))影响全世界范围内的大量计算机系统。恶意软件呈其许多形式(例如计算机病毒、蠕虫病毒、藏匿技术及间谍软件)向数百万的计算机用户呈现严重风险,从而使其易遭受数据及敏感信息丢失、身份盗用及生产率的损失以及其它。Malicious software (also known as malicious software) affects a large number of computer systems worldwide. In its many forms, such as computer viruses, worms, rootkits, and spyware, malicious software presents a serious risk to millions of computer users, exposing them to loss of data and sensitive information, identity theft, and loss of productivity, among other things.

硬件虚拟化技术允许产生通常被称为虚拟机的模拟计算机环境,其以许多方式表现为物理计算机系统。在典型的应用程序(例如服务器整合及基础设施即服务(IAAS))中,若干虚拟机可在相同的物理机上同时运行,共享其间的硬件资源,从而减小投资及操作成本。每一虚拟机可与其它虚拟机分开地运行其自己的操作系统及/或软件应用程序。由于恶意软件的平稳扩散,在此类环境中操作的每一虚拟机潜在地需要恶意软件保护。Hardware virtualization technology allows the creation of simulated computer environments, often called virtual machines, that behave like physical computer systems in many ways. In typical applications, such as server consolidation and Infrastructure as a Service (IaaS), several virtual machines can run simultaneously on the same physical machine, sharing hardware resources between them, thereby reducing investment and operating costs. Each virtual machine can run its own operating system and/or software applications separately from the other virtual machines. Due to the steady spread of malware, each virtual machine operating in such an environment potentially requires malware protection.

通常用于所属领域中的虚拟化解决方案包括管理程序,也被称为虚拟机监视器,其由在计算硬件与虚拟机的操作系统(OS)之间操作的软件的层组成,且具有比相应的OS多的处理器权限。可在管理程序的权限级别下进行反恶意软件操作。尽管此类配置可增加安全性,但其引入一层额外的复杂性且可带来较大的计算成本。Virtualization solutions commonly used in the field include a hypervisor, also known as a virtual machine monitor. This consists of a layer of software that operates between the computing hardware and the virtual machine's operating system (OS) and has greater processor privileges than the corresponding OS. Anti-malware operations can be performed at the hypervisor's privilege level. While such a configuration can increase security, it introduces an additional layer of complexity and can incur significant computational costs.

对针对硬件虚拟化平台开发有效、稳健且可扩展的反恶意软件解决方案存在相当大的兴趣。There is considerable interest in developing effective, robust, and scalable anti-malware solutions for hardware virtualization platforms.

发明内容Summary of the Invention

根据一个方面,一种主机系统包括:经配置以操作管理程序及存储器自省引擎的硬件处理器。所述管理程序经配置以暴露包括虚拟化处理器及虚拟化存储器的虚拟机,所述虚拟机经配置以利用虚拟化处理器执行目标进程。所述存储器自省引擎在虚拟机外部执行且经配置以根据虚拟机的页面表确定目标进程的虚拟存储器空间的目标页面是否被换出虚拟化存储器,且作为响应,当目标页面被换出虚拟化存储器时直接将页面错误注入到虚拟机中,所述页面错误使得虚拟机的操作系统将目标页面映射到虚拟化存储器的页面。According to one aspect, a host system includes a hardware processor configured to operate a hypervisor and a memory introspection engine. The hypervisor is configured to expose a virtual machine including a virtualized processor and virtualized memory, the virtual machine being configured to execute a target process using the virtualized processor. The memory introspection engine executes outside the virtual machine and is configured to determine, based on a page table of the virtual machine, whether a target page of a virtual memory space of a target process has been swapped out of the virtualized memory. In response, when the target page has been swapped out of the virtualized memory, the memory introspection engine directly injects a page fault into the virtual machine, causing the operating system of the virtual machine to map the target page to a page of the virtualized memory.

根据另一方面,一种方法包括:利用主机系统的至少一个硬件处理器执行管理程序,所述管理程序经配置以暴露包括虚拟化处理器及虚拟化存储器的虚拟机,所述虚拟机进一步经配置以利用所述虚拟化处理器执行目标进程。所述方法进一步包括:利用至少一个硬件处理器以确定所述目标进程的虚拟存储器空间的目标页面是否被换出虚拟化存储器,且作为响应,当所述页面被换出所述虚拟化存储器时利用所述至少一个硬件处理器直接将页面错误注入到所述虚拟机中,所述页面错误使得所述虚拟机的操作系统将所述目标页面映射到所述虚拟化存储器的页面。According to another aspect, a method includes executing a hypervisor using at least one hardware processor of a host system, the hypervisor being configured to expose a virtual machine including a virtualized processor and virtualized memory, the virtual machine being further configured to execute a target process using the virtualized processor. The method further includes determining, using the at least one hardware processor, whether a target page of a virtual memory space of the target process has been swapped out of the virtualized memory, and in response, injecting, using the at least one hardware processor, a page fault directly into the virtual machine when the page has been swapped out of the virtualized memory, the page fault causing an operating system of the virtual machine to map the target page to a page of the virtualized memory.

根据另一方面,一种非暂时性计算机可读媒体存储指令,所述指令在由主机系统的至少一个硬件处理器执行时使得所述主机系统形成存储器自省引擎,其中所述主机系统进一步经配置以执行暴露包括虚拟化处理器及虚拟化存储器的虚拟机的管理程序,所述虚拟机经配置以利用虚拟化处理器执行目标进程。所述存储器自省引擎在所述虚拟机外部执行且经配置以根据所述虚拟机的页面表确定所述目标进程的虚拟存储器空间的目标页面是否被换出所述虚拟存储器,且作为响应,当所述目标页面被换出所述虚拟化存储器时直接将页面错误注入到所述虚拟机中,所述页面错误使得所述虚拟机的操作系统将所述目标页面映射到所述虚拟化存储器的页面。According to another aspect, a non-transitory computer-readable medium stores instructions that, when executed by at least one hardware processor of a host system, cause the host system to form a memory introspection engine, wherein the host system is further configured to execute a hypervisor that exposes a virtual machine including a virtualized processor and virtualized memory, the virtual machine configured to execute a target process using the virtualized processor. The memory introspection engine executes externally to the virtual machine and is configured to determine, based on a page table of the virtual machine, whether a target page of a virtual memory space of the target process is swapped out of the virtual memory, and in response, directly inject a page fault into the virtual machine when the target page is swapped out of the virtualized memory, the page fault causing an operating system of the virtual machine to map the target page to a page of the virtualized memory.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

在阅读以下详细的描述之后且在参看图式之后,本发明的前述方面及优点将得到更好的理解,在图式中:The foregoing aspects and advantages of the present invention will be better understood after reading the following detailed description and after referring to the accompanying drawings, in which:

图1展示根据本发明的一些实施例的由在主机系统上执行的管理程序暴露的一组示范性虚拟机,及保护所述组虚拟机免受恶意软件影响的存储器自省引擎。1 shows an exemplary set of virtual machines exposed by a hypervisor executing on a host system, and a memory introspection engine that protects the set of virtual machines from malware, according to some embodiments of the invention.

图2展示根据本发明的一些实施例的主机系统的示范性硬件配置。FIG2 shows an exemplary hardware configuration of a host system according to some embodiments of the present invention.

图3展示根据本发明的一些实施例的被暴露到客户虚拟机的虚拟化硬件的示范性配置。3 shows an exemplary configuration of virtualized hardware exposed to a guest virtual machine according to some embodiments of the present invention.

图4说明根据本发明的一些实施例的在各种处理器权限级别下在主机系统上执行的软件对象的示范性分层。4 illustrates an exemplary layering of software objects executing on a host system at various processor privilege levels, according to some embodiments of the invention.

图5展示根据本发明的一些实施例的存储器地址的示范性映射及存储器页面换入及换出虚拟化存储器的示范性交换。5 shows an exemplary mapping of memory addresses and exemplary swapping of memory pages in and out of virtualized memory according to some embodiments of the invention.

图6展示根据本发明的一些实施例的由存储器自省引擎执行以保护虚拟机免受恶意软件影响的步骤的示范性序列。6 shows an exemplary sequence of steps performed by a memory introspection engine to protect a virtual machine from malware, according to some embodiments of the invention.

图7展示根据本发明的一些实施例的由存储自省执行以实施直接页面错误注入的步骤的示范性序列。7 shows an exemplary sequence of steps performed by storage introspection to implement direct page fault injection, according to some embodiments of the invention.

图8展示根据本发明的一些实施例的说明图6到7的方法的应用的步骤的示范性序列。8 shows an exemplary sequence of steps illustrating application of the methods of FIGs. 6-7, according to some embodiments of the invention.

图9展示根据本发明的一些实施例的说明图6到7的方法的另一应用的步骤的示范性序列。9 shows an exemplary sequence of steps illustrating another application of the method of FIGs. 6-7, according to some embodiments of the invention.

图10说明根据本发明的一些实施例的含有目标进程的数据的存储器页面的一组虚拟地址的示范性确定。10 illustrates an exemplary determination of a set of virtual addresses of memory pages containing data for a target process, according to some embodiments of the invention.

具体实施方式DETAILED DESCRIPTION

在以下描述中,应理解,结构之间所有所列举的连接可为直接可操作的连接或通过中间结构的间接可操作的连接。一组元件包含一或多个元件。对元件的任何列举被理解为指代至少一个元件。多个元件包含至少两个元件。除非另外要求,否则任何所描述的方法步骤无需一定以特定的所说明的次序执行。来源于第二元素的第一元素(举例来说,数据)包含与第二元素相同的第一元素,也包含通过处理第二元素及任选地其它数据产生的第一元素。根据参数做出确定或决策包含根据参数及任选地根据其它数据做出确定或决策。除非另外指定,否则一些量/数据的指示符可为所述量/数据本身或不同于量/数据本身的指示符。除非另外指定,否则进程为计算机程序(例如应用程序或操作系统的一部分)的实例,且以具有至少一个执行线程及由操作系统指派到其的虚拟存储器的区段为特征,相应的区段包括可执行代码。除非另外指定,否则页面表示被个别地映射到主机系统的物理存储器的虚拟机的最小单元。除非另外指定,否则直接将页面错误注入到虚拟机中包括:在无需来自操作系统或在相应的虚拟机内执行的其它软件的协助的情况下,在相应的虚拟机的虚拟化处理器内诱发页面错误事件。此类直接注入不排除操作系统或其它软件响应于所注入的页面错误而采取动作,例如以处理页面错误。计算机可读媒体包含非暂时性媒体,例如磁存储媒体、光存储媒体及半导体存储媒体(举例来说,硬盘驱动器、光盘、闪存存储器、DRAM),也包含通信链路,例如导电电缆及光纤链路。根据一些实施例,本发明尤其提供包括经编程以执行本文中描述的方法的硬件(举例来说,一或多个处理器)的计算机系统,以及对指令编码以执行本文中描述的方法的计算机可读媒体。In the following description, it should be understood that all listed connections between structures may be directly operable connections or indirectly operable connections through intermediate structures. A set of elements includes one or more elements. Any listing of elements is understood to refer to at least one element. A plurality of elements includes at least two elements. Unless otherwise required, any described method steps need not necessarily be performed in the specific order described. A first element (for example, data) derived from a second element includes a first element that is identical to the second element, and also includes a first element generated by processing the second element and, optionally, other data. Making a determination or decision based on a parameter includes making a determination or decision based on the parameter and, optionally, other data. Unless otherwise specified, an indicator of some quantity/data may be the quantity/data itself or an indicator different from the quantity/data itself. Unless otherwise specified, a process is an instance of a computer program (such as an application or part of an operating system) and is characterized by having at least one execution thread and a segment of virtual memory assigned to it by the operating system, wherein the corresponding segment includes executable code. Unless otherwise specified, a page represents the smallest unit of a virtual machine that is individually mapped to the physical memory of a host system. Unless otherwise specified, directly injecting a page fault into a virtual machine includes inducing a page fault event within the virtualized processor of the corresponding virtual machine without assistance from the operating system or other software executing within the corresponding virtual machine. Such direct injection does not preclude the operating system or other software from taking action in response to the injected page fault, such as to handle the page fault. Computer-readable media includes non-transitory media such as magnetic storage media, optical storage media, and semiconductor storage media (for example, hard drives, optical disks, flash memory, DRAM), as well as communication links such as conductive cables and fiber optic links. According to some embodiments, the present invention provides, among other things, a computer system comprising hardware (for example, one or more processors) programmed to perform the methods described herein, and a computer-readable medium encoding instructions to perform the methods described herein.

以下描述作为实例但不一定作为限制说明本发明的实施例。The following description illustrates embodiments of the invention by way of example and not necessarily by way of limitation.

图1展示根据本发明的一些实施例的将硬件虚拟化用于恶意软件保护的主机系统10 的示范性配置。主机系统10可表示企业计算装置(例如企业服务器)或终端用户装置(例如个人计算机或智能手机)。其它示范性主机系统包含娱乐装置(例如TV或游戏机)或具有存储器及处理器且需要恶意软件保护的任何其它装置。在图1的实例中,主机系统10 执行由管理程序30暴露的一组客户虚拟机32a到b。虚拟机(VM)包括实际的物理机/计算机系统的抽象(举例来说,软件模拟),所述VM能够运行操作系统及其它应用程序。管理程序30包含经配置以产生多个虚拟化装置(例如虚拟处理器及虚拟存储器控制器) 且将此类虚拟化装置呈现到软件以替代主机系统10的真实的物理装置的软件。在一些实施例中,管理程序30允许由主机系统10的硬件资源的多个虚拟机进行的多路复用(共享)。管理程序30可进一步管理此类多路复用使得每一VM独立地操作且察觉不到主机系统10上同时执行的其它VM。流行的管理程序的实例包含来自Vmware公司的VMware vSphereTM及开源Xen管理程序以及其它。FIG1 shows an exemplary configuration of a host system 10 that utilizes hardware virtualization for malware protection, according to some embodiments of the present invention. Host system 10 may represent an enterprise computing device (e.g., an enterprise server) or an end-user device (e.g., a personal computer or smartphone). Other exemplary host systems include entertainment devices (e.g., a TV or game console) or any other device with memory and a processor that requires malware protection. In the example of FIG1 , host system 10 executes a set of client virtual machines 32 a-b exposed by a hypervisor 30. A virtual machine (VM) comprises an abstraction (e.g., a software emulation) of an actual physical machine/computer system capable of running an operating system and other applications. Hypervisor 30 includes software configured to generate multiple virtualized devices (e.g., virtual processors and virtual memory controllers) and present these virtualized devices to software as replacements for the actual physical devices of host system 10. In some embodiments, hypervisor 30 allows multiplexing (sharing) of hardware resources of host system 10 by multiple virtual machines. Hypervisor 30 can further manage this multiplexing so that each VM operates independently and is unaware of other VMs executing simultaneously on host system 10. Examples of popular hypervisors include VMware vSphere from VMware, Inc. and the open source Xen hypervisor, among others.

每一VM 32a到b可分别执行客户操作系统(OS)34a到b。一组示范性应用程序42a到d一般表示任何软件应用程序,例如文字处理、图像处理、媒体播放器、数据库、日历、个人联系人管理、浏览器、游戏、音频通信、数据通信及反恶意软件应用程序以及其它。操作系统34a到b可包括任何广泛可用的操作系统,例如Microsoft或AndroidTM以及其它。每一OS在虚拟机内执行的应用程序与相应的VM的虚拟化硬件装置之间提供接口。在以下描述中,在虚拟机的虚拟处理器上执行的软件被认为在相应的虚拟机内执行。例如,在图1的实例中,应用程序42a到 b被认为在客户VM 32a内执行,而应用程序42c到d被认为在客户VM 32b内执行。相比之下,管理程序30被认为在客户VM 32a到b外部或下面执行。Each VM 32a to b can execute a client operating system (OS) 34a to b, respectively. A set of exemplary applications 42a to d generally represent any software application, such as word processing, image processing, media player, database, calendar, personal contact management, browser, game, audio communication, data communication, and anti-malware applications, among others. Operating systems 34a to b can include any widely available operating system, such as Microsoft or Android , among others. Each OS provides an interface between the applications executing within the virtual machine and the virtualized hardware devices of the corresponding VM. In the following description, software executing on the virtual processor of a virtual machine is considered to be executed within the corresponding virtual machine. For example, in the example of FIG. 1 , applications 42a to b are considered to be executed within client VM 32a, while applications 42c to d are considered to be executed within client VM 32b. In contrast, hypervisor 30 is considered to be executed outside or below client VMs 32a to b.

在一些实施例中,管理程序30包含经配置以执行如下文进一步描述的反恶意软件操作的存储器自省引擎40。引擎40可被并入到管理程序30中,或可作为与管理程序 30不同且独立于管理程序30但在与管理程序30实质上类似的处理器权限级别下执行的软件组件而被传递。单一引擎40可经配置以对在主机系统10上执行的多个VM进行恶意软件保护。In some embodiments, hypervisor 30 includes a memory introspection engine 40 configured to perform anti-malware operations as described further below. Engine 40 may be incorporated into hypervisor 30, or may be delivered as a software component that is distinct and independent from hypervisor 30 but executes at a substantially similar processor privilege level as hypervisor 30. A single engine 40 may be configured to protect multiple VMs executing on host system 10 from malware.

图2展示主机系统10的示范性硬件配置。系统10包括一组物理装置,包含处理器12、存储器单元14、一组输入装置16、一组输出装置18、一组存储装置20及一组网络适配器22,所有这些都由控制器集线器24连接。在一些实施例中,处理器12包括物理装置(举例来说,形成于半导体衬底上的多核集成电路),所述物理装置经配置以用一组信号及/或数据执行计算及/或逻辑操作。在一些实施例中,此类逻辑操作呈处理器指令序列(举例来说,机器代码或其它类型软件)的形式被传递到处理器12。存储器单元14 可包括存储在实施指令的进程中由处理器12存取或产生的数据/信号的易失性计算机可读媒体(举例来说,RAM)。FIG2 shows an exemplary hardware configuration of a host system 10. System 10 includes a set of physical devices, including a processor 12, a memory unit 14, a set of input devices 16, a set of output devices 18, a set of storage devices 20, and a set of network adapters 22, all of which are connected by a controller hub 24. In some embodiments, processor 12 comprises a physical device (e.g., a multi-core integrated circuit formed on a semiconductor substrate) that is configured to perform computations and/or logical operations on a set of signals and/or data. In some embodiments, such logical operations are delivered to processor 12 in the form of a sequence of processor instructions (e.g., machine code or other type of software). Memory unit 14 may include volatile computer-readable media (e.g., RAM) that stores data/signals accessed or generated by processor 12 in the course of implementing the instructions.

输入装置16可包含计算机键盘、鼠标及麦克风以及其它,包含相应的硬件接口及/或适配器,从而允许用户将数据及/或指令引入到主机系统10中。输出装置18可包含显示器装置(例如监视器及扬声器以及其它),以及硬件接口/适配器(例如图形卡),从而允许主机系统10将数据传达到用户。在一些实施例中,输入装置16及输出装置18可共享一块共同的硬件,如在触控屏装置的情况下。存储装置20包含实现软件指令及/或数据的非易失性存储、读取、及写入的计算机可读媒体。示范性存储装置20包含磁盘及光盘及闪存存储装置,以及可移动媒体,例如CD及/或DVD盘及驱动器。网络适配器 22的组使得主机系统10能够连接到计算机网络及/或连接到其它装置/计算机系统。控制器集线器24表示多个系统、外设及/或芯片组总线及/或使得处理器12与装置14、16、 18、20及22之间能够通信的所有其它电路。例如,控制器集线器24可包含存储器控制器、输入/输出(I/O)控制器及中断控制器以及其它。在另一实例中,控制器集线器24可包括将处理器12连接到存储器14的北桥及/或将处理器12连接到装置16、18、20及 22的南桥。Input devices 16 may include a computer keyboard, mouse, and microphone, among others, including corresponding hardware interfaces and/or adapters, allowing a user to enter data and/or instructions into host system 10. Output devices 18 may include a display device (e.g., a monitor and speakers, among others), as well as hardware interfaces/adapters (e.g., a graphics card) to allow host system 10 to communicate data to the user. In some embodiments, input devices 16 and output devices 18 may share a common piece of hardware, such as in the case of a touchscreen device. Storage device 20 includes computer-readable media that enables non-volatile storage, reading, and writing of software instructions and/or data. Exemplary storage devices 20 include magnetic and optical disks and flash memory storage devices, as well as removable media such as CD and/or DVD disks and drives. A set of network adapters 22 enables host system 10 to connect to a computer network and/or to other devices/computer systems. Controller hub 24 represents multiple system, peripheral, and/or chipset buses and/or all other circuitry that enables communication between processor 12 and devices 14, 16, 18, 20, and 22. For example, controller hub 24 may include a memory controller, an input/output (I/O) controller, and an interrupt controller, among other things. In another example, controller hub 24 may include a north bridge that connects processor 12 to memory 14 and/or a south bridge that connects processor 12 to devices 16, 18, 20, and 22.

为了实现如图1中展示的配置,管理程序30可产生多个虚拟化装置,其各自模拟系统10的物理硬件装置。管理程序30可进一步将一组虚拟化装置指派到每一VM 32a 到b,且控制调度、信令及通信使得VM 32a到b可同时使用处理器12及其它硬件装置。执行此类操作(如暴露VM 32a到b)在所属领域中也为已知的。1 , hypervisor 30 may create multiple virtualized devices, each of which emulates the physical hardware devices of system 10. Hypervisor 30 may further assign a set of virtualized devices to each VM 32 a-b and control scheduling, signaling, and communication so that VMs 32 a-b can simultaneously use processor 12 and other hardware devices. Performing such operations, such as exposing VMs 32 a-b, is also known in the art.

图3展示如由管理程序30暴露的虚拟机32的示范性配置。VM 32可表示(例如)图 1的VM 32a到b中的任何者。VM 32包含虚拟化处理器112、虚拟化存储器单元114、虚拟化输入装置116、虚拟化输出装置118、虚拟化存储装置120、虚拟化网络适配器 122及虚拟化控制器集线器124。虚拟化处理器112包括对处理器12的至少一些功能性的模拟且经配置以接收形成软件(例如操作系统及其它应用程序)的部分的处理器指令以用于执行。将处理器112用于执行的软件被认为在虚拟机32内执行。在一些实施例中,虚拟化存储器单元114包括用于存储及检索由虚拟化处理器112使用的数据的可寻址空间。其它虚拟化装置(举例来说,虚拟化输入、输出、存储装置等等)模拟主机系统10的相应的物理装置的至少一些功能性。虚拟化处理器112可经配置以与此类装置交互,如同其与对应的物理装置交互一样。例如,在VM 32内执行的软件可经由虚拟化网络适配器122发送及/或接收网络业务。在一些实施例中,管理程序30可将仅虚拟化装置的子集暴露到VM 32(例如,仅虚拟化处理器112、虚拟化存储器114及集线器124的部分)。管理程序30还可给出主机系统10的经选择的VM专用的一些硬件装置。在一个此类实例中,VM 32a(图1)可具有专用输入装置16及输出装置18,但缺少虚拟化网络适配器。同时,VM 32b可具有专用网络适配器22。FIG3 shows an exemplary configuration of a virtual machine 32 as exposed by a hypervisor 30. VM 32 may represent, for example, any of VMs 32a-b of FIG1 . VM 32 includes a virtualized processor 112, a virtualized memory unit 114, a virtualized input device 116, a virtualized output device 118, a virtualized storage device 120, a virtualized network adapter 122, and a virtualized controller hub 124. Virtualized processor 112 emulates at least some of the functionality of processor 12 and is configured to receive processor instructions forming part of software (e.g., an operating system and other applications) for execution. Software executed using processor 112 is considered to be executed within virtual machine 32. In some embodiments, virtualized memory unit 114 includes an addressable space for storing and retrieving data used by virtualized processor 112. Other virtualized devices (e.g., virtualized input, output, storage, etc.) emulate at least some of the functionality of corresponding physical devices of host system 10. Virtualized processor 112 can be configured to interact with such devices as if they were physical devices. For example, software executing within VM 32 can send and/or receive network traffic via virtualized network adapter 122. In some embodiments, hypervisor 30 can expose only a subset of virtualized devices to VM 32 (e.g., only virtualized processor 112, virtualized memory 114, and a portion of hub 124). Hypervisor 30 can also expose some hardware devices of host system 10 to be dedicated to selected VMs. In one such example, VM 32a ( FIG. 1 ) may have dedicated input devices 16 and output devices 18, but lack a virtualized network adapter. Meanwhile, VM 32b may have dedicated network adapter 22.

图4说明根据本发明的一些实施例的在主机系统10上执行的软件对象的分层。图4是从处理器权限级别(在所属领域中也称为层或保护环)的角度来呈现。在一些实施例中,管理程序30在最高权限级别(举例来说,支持虚拟化的平台上的VMXroot,也称为环-1或根模式)下控制处理器12,从而产生如虚拟机32暴露到在主机系统10上执行的其它软件的硬件虚拟化平台。操作系统34(例如图2中的OS 34a到b)在VM 32的虚拟环境内执行,OS34具有比管理程序30小的处理器权限(举例来说,在英特尔(Intel) 平台上的环0或内核模式)。一组应用程序42e到f在比OS 34小的处理器权限(举例来说,环3或用户模式)下执行。应用程序42e到f的部分可在内核权限级别(例如,由应用程序42f安装的驱动程序36;示范性驱动程序36执行反恶意软件操作,例如检测软件对象的恶意软件指示行为及/或检测软件对象内的恶意软件指示签名)下执行。类似地, OS 34的部分可在用户模式(环3)中执行。FIG4 illustrates the layering of software objects executing on host system 10, according to some embodiments of the present invention. FIG4 is presented from the perspective of processor privilege levels (also known in the art as layers or protection rings). In some embodiments, hypervisor 30 controls processor 12 at the highest privilege level (e.g., VMXroot, also known as ring-1 or root mode, on platforms that support virtualization), creating a hardware virtualization platform that virtual machine 32 exposes to other software executing on host system 10. An operating system 34 (e.g., OS 34a-b in FIG2 ) executes within the virtual environment of VM 32, with lesser processor privileges than hypervisor 30 (e.g., ring 0 or kernel mode on Intel platforms). A set of applications 42e-f executes at lesser processor privileges than OS 34 (e.g., ring 3 or user mode). Some applications 42e-f may execute at a kernel privilege level (e.g., driver 36 installed by application 42f; exemplary driver 36 performs anti-malware operations, such as detecting malware-indicative behavior in software objects and/or detecting malware-indicative signatures within software objects). Similarly, portions of OS 34 may execute in user mode (ring 3).

在一些实施例中,自省引擎40实质上在与管理程序30相同的处理器权限级别下执行,且经配置以执行在主机系统10上执行的虚拟机(例如VM 32)的自省。VM的或在相应的VM内执行的软件对象的自省可包括:分析相应的软件对象的行为,例如识别由对象执行的一组操作(例如,发布系统调用、存取OS的注册表、从远程位置下载文件、将数据写入到文件等)。自省可进一步包括:确定含有软件对象的部分的存储器区段的地址;存取相应的存储器区段;以及分析存储于相应的存储器区段内的内容。自省的其它实例包含:拦截及/或约束对此类存储器区段的某些进程的存取,举例来说,防止进程重写由另一进程使用的代码或数据。在一些实施例中,由引擎40针对自省选择的对象包括进程、指令流、寄存器及数据结构(例如页面表及相应的VM的驱动对象)以及其它。In some embodiments, introspection engine 40 executes at substantially the same processor privilege level as hypervisor 30 and is configured to perform introspection of a virtual machine (e.g., VM 32) executing on host system 10. Introspection of a VM or a software object executing within a corresponding VM may include analyzing the behavior of the corresponding software object, such as identifying a set of operations performed by the object (e.g., issuing a system call, accessing the OS's registry, downloading a file from a remote location, writing data to a file, etc.). Introspection may further include determining the address of a memory segment containing a portion of the software object; accessing the corresponding memory segment; and analyzing the contents stored within the corresponding memory segment. Other examples of introspection include intercepting and/or restricting access to such memory segments by certain processes, for example, to prevent a process from overwriting code or data used by another process. In some embodiments, objects selected by engine 40 for introspection include processes, instruction streams, registers, and data structures (e.g., page tables and driver objects of the corresponding VM), among others.

为了在如图1(即,从相应的VM外部)中说明的配置中执行VM 32的自省,引擎40 的一些实施例利用处理器12的存储器映射结构及机制。虚拟机通常与虚拟化物理存储器(举例来说,图3中的存储器114,在所属领域中也称为客户物理存储器)一起操作。虚拟化物理存储器包括实际物理存储器14的抽象表示,例如作为指定到每一客户VM 的虚拟化地址的连续空间,其中所述空间的部分被映射到物理存储器14及/或物理存储装置20内的地址。在经配置以支持虚拟化的系统中,通常通过由处理器12控制的专用数据结构实现此类映射,所述专用数据结构称为第二级地址转换(SLAT)。流行的SLAT 实施方案包含扩展页面表(平台上的EPT)及嵌套页面表(平台上的NPT)。在此类系统中,虚拟化物理存储器可被划分在所属领域中称为页面的单元中,页面表示经由机制(例如EPT及/或NPT)被个别地映射到物理存储器的虚拟化物理存储器的最小单元,即,用页面粒度执行物理与虚拟化物理存储器之间的映射。所有页面通常都具有预先确定的尺寸,举例来说,4千字节、2兆字节等。通常由管理程序30配置虚拟化物理存储器到页面的划分。在一些实施例中,管理程序30还配置EPT/NPT且因此配置物理存储器与虚拟化物理存储器之间的映射。虚拟化物理存储器地址到物理存储器地址的实际映射(转换)可包括在主机系统10的转换后备缓冲器(TLB)中查找物理存储器地址。在一些实施例中,地址转换包括:执行页面行走,其包含在一组页面表及/或页面目录中的一组连续的地址查找;以及执行计算,例如将页面的偏置添加到关于相应的页面的地址。To perform introspection of VM 32 in a configuration such as that illustrated in FIG1 (i.e., from outside the corresponding VM), some embodiments of engine 40 utilize the memory mapping structures and mechanisms of processor 12. Virtual machines typically operate with virtualized physical memory (e.g., memory 114 in FIG3 , also referred to in the art as guest physical memory). Virtualized physical memory comprises an abstract representation of actual physical memory 14, for example, as a contiguous space of virtualized addresses assigned to each guest VM, portions of which are mapped to addresses within physical memory 14 and/or physical storage devices 20. In systems configured to support virtualization, such mapping is typically implemented via a dedicated data structure controlled by processor 12, known as a second-level address translation (SLAT). Popular SLAT implementations include extended page tables (EPTs on platforms) and nested page tables (NPTs on platforms). In such systems, virtualized physical memory may be divided into units known in the art as pages, which represent the smallest unit of virtualized physical memory that is individually mapped to physical memory via a mechanism such as an EPT and/or NPT. That is, the mapping between physical and virtualized physical memory is performed at a page granularity. All pages typically have a predetermined size, for example, 4 kilobytes, 2 megabytes, etc. The division of virtualized physical memory into pages is typically configured by the hypervisor 30. In some embodiments, the hypervisor 30 also configures the EPT/NPT and, therefore, the mapping between physical memory and virtualized physical memory. The actual mapping (translation) of virtualized physical memory addresses to physical memory addresses may include looking up the physical memory address in a translation lookaside buffer (TLB) of the host system 10. In some embodiments, address translation includes performing a page walk, which includes a set of consecutive address lookups in a set of page tables and/or page directories, and performing calculations, such as adding a page offset to the address associated with the corresponding page.

一些硬件配置允许管理程序30(举例来说)通过对相应的页面设定读、写及/或执行存取权利来选择性地控制对存储于物理存储器14中的每一页面内的数据的存取。(例如)可通过修改EPT或NPT内的相应的页面的项目来设定此类权利。管理程序30可因此选择哪个软件对象可存取在每一页面内的地址处存储的数据,且可指示用相应的数据允许哪种操作,举例来说,读、写、执行。为了执行操作(例如将数据写入到对象不具有相应的权利的页面或执行来自被标记为非可执行的页面的代码)由在VM内执行的软件对象做出的尝试可触发虚拟机退出事件(举例来说,英特尔平台上的VMExit事件)。在一些实施例中,虚拟机退出事件将对处理器的控制从执行相应的软件对象的VM转移到管理程序30。此类转移可允许在管理程序30的处理器权限级别下执行的软件拦截未经授权的写或执行尝试。在一些实施例中,自省引擎40执行此类自省以作为反恶意软件操作的部分。Some hardware configurations allow hypervisor 30 to selectively control access to data within each page stored in physical memory 14, for example, by setting read, write, and/or execute access rights for the corresponding page. Such rights can be set, for example, by modifying an entry for the corresponding page within the EPT or NPT. Hypervisor 30 can thus select which software object can access the data stored at the address within each page and can indicate which operations are permitted with the corresponding data, for example, read, write, or execute. An attempt by a software object executing within a VM to perform an operation (e.g., writing data to a page for which the object does not have corresponding rights or executing code from a page marked as non-executable) can trigger a virtual machine exit event (e.g., a VMExit event on Intel platforms). In some embodiments, a virtual machine exit event transfers control of the processor from the VM executing the corresponding software object to hypervisor 30. This transfer can allow software executing at the processor privilege level of hypervisor 30 to intercept unauthorized write or execute attempts. In some embodiments, introspection engine 40 performs such introspection as part of anti-malware operations.

在一些实施例中,OS 34通过(例如)利用页面表机制维持VM 32相应的虚拟存储器空间与虚拟化物理存储器之间的映射(地址转换),针对进程(例如图4中的应用程序42e 到f)配置虚拟存储器空间。在一些实施例中,进程虚拟存储器空间也被划分成页面,此类页面表示被OS 34个别地映射到虚拟化物理存储器的虚拟存储器的最小单元,即,用页面粒度执行对虚拟化物理存储器映射的虚拟化。In some embodiments, OS 34 configures virtual memory space for a process (e.g., applications 42e to 42f in FIG. 4 ) by, for example, maintaining a mapping (address translation) between the corresponding virtual memory space of VM 32 and virtualized physical memory using a page table mechanism. In some embodiments, the process virtual memory space is also divided into pages, which represent the smallest unit of virtual memory that is individually mapped to virtualized physical memory by OS 34. That is, virtualization of virtualized physical memory mapping is performed with page granularity.

图5说明在如图4中展示的实施例中的存储器地址的示范性映射。软件对象(例如应用程序、进程或在客户VM 32内执行的操作系统的部分)由客户OS 34指派虚拟存储器空间214a。当软件对象试图存取空间214a的示范性存储器页面60a的内容时,根据由客户OS34配置及控制的页面表,由客户VM 32的虚拟化处理器将页面60a的地址转换成VM 32的虚拟化物理存储器空间114的页面60b的地址。配置及控制虚拟化物理存储器114的管理程序30(例如)使用如上文论述的SLAT构件接着将页面60b的地址映射到在主机系统10的物理存储器14内的页面60c的地址。FIG5 illustrates an exemplary mapping of memory addresses in an embodiment such as that shown in FIG4 . A software object (e.g., an application, process, or portion of an operating system executing within a guest VM 32) is assigned virtual memory space 214a by guest OS 34. When the software object attempts to access the contents of exemplary memory page 60a of space 214a, the address of page 60a is translated by the virtualization processor of guest VM 32 into the address of page 60b of virtualized physical memory space 114 of VM 32 according to a page table configured and controlled by guest OS 34. Hypervisor 30, which configures and controls virtualized physical memory 114, then maps the address of page 60b to the address of page 60c within physical memory 14 of host system 10, e.g., using the SLAT mechanism discussed above.

在一些实施例中,管理程序30构建包括物理存储器14的表示的其本身的虚拟存储器空间214b且利用转换机构(例如页面表)将空间214b中的地址映射到物理存储器14中的地址中。在图5中,此类示范性映射将页面60c的地址转换成页面60h的地址。此类映射允许管理程序30管理(举例来说,读取、写入及对其的控制存取)属于在主机系统 10上运行在各种VM内执行的软件对象的存储器页面。In some embodiments, hypervisor 30 constructs its own virtual memory space 214b that includes a representation of physical memory 14 and utilizes a translation mechanism (e.g., a page table) to map addresses in space 214b to addresses in physical memory 14. In Figure 5, such an exemplary mapping translates the address of page 60c to the address of page 60h. Such mapping allows hypervisor 30 to manage (e.g., read, write, and control access to) memory pages belonging to software objects executing within various VMs running on host system 10.

图5进一步说明由客户OS 34执行的页面交换操作。页面交换是现代操作系统的共同特征,其用以有效地管理可用的存储器资源。在一些实施例中,将页面换出存储器包括OS将相应的页面的内容从存储器移动到存储装置(举例来说,磁盘),使得相应的页面可用以存储其它数据。在稍后的时间,OS可大概在与存储内容的原始页面的地址不同的地址处通过将相应的内容从存储装置移回到存储器中来执行页面的换入。为了完成换入,OS可修改相应的页面的页面表项目以反应地址变化。在图5中说明的实例中,页面60c被换出到存储装置上的页面60d。由于OS 34在虚拟机内执行,所以OS 34将虚拟化物理存储器114视为其物理存储器,且将虚拟化存储装置120视为其物理存储装置。所以有效地将页面60c换出存储器包括将页面60c的内容移动到虚拟化存储装置 120。装置120可包括由物理装置20的管理程序30产生的抽象,所以页面60d的内容可实际上被重新引导到装置20上的页面60k。在一些实施例中,管理程序30可给予客户VM 32对存储装置20的直接存取,例如使用来自的VT-d技术。在此类配置中,虚拟化存储装置120可与主机系统10的实际物理存储装置一致。为了执行换入,OS 34 可将页面60d的内容移动到虚拟化物理存储器114的页面60e。客户OS 34可进一步修改对应于页面60a的页面表项目以指示从页面60a到页面60e的地址转换(图5中的虚线箭头)。页面60e可被映射到物理存储器14中的页面60m。FIG5 further illustrates a page swap operation performed by guest OS 34. Page swapping is a common feature of modern operating systems, used to efficiently manage available memory resources. In some embodiments, swapping a page out of memory involves the OS moving the contents of the corresponding page from memory to a storage device (e.g., disk) so that the corresponding page can be used to store other data. At a later time, the OS may swap the page in by moving the corresponding content from the storage device back into memory, presumably at an address different from the address of the original page that stored the content. To complete the swap in, the OS may modify the page table entry for the corresponding page to reflect the address change. In the example illustrated in FIG5 , page 60c is swapped out to page 60d on the storage device. Because OS 34 executes within a virtual machine, OS 34 views virtualized physical memory 114 as its physical memory and virtualized storage device 120 as its physical storage device. Therefore, effectively swapping page 60c out of memory involves moving the contents of page 60c to virtualized storage device 120. Device 120 may include an abstraction created by hypervisor 30 of physical device 20, so the contents of page 60d may actually be redirected to page 60k on device 20. In some embodiments, hypervisor 30 may give guest VM 32 direct access to storage device 20, for example, using VT-d technology from [ 15 ]. In such a configuration, virtualized storage device 120 may be consistent with the actual physical storage device of host system 10. To perform the swap-in, OS 34 may move the contents of page 60d to page 60e of virtualized physical memory 114. Guest OS 34 may further modify the page table entry corresponding to page 60a to indicate the address translation from page 60a to page 60e (dashed arrow in FIG. 5 ). Page 60e may be mapped to page 60m in physical memory 14.

图6展示根据本发明的一些实施例的由存储器自省引擎40执行的用以保护虚拟机免受恶意软件影响的步骤的示范性序列。此类反恶意软件保护包括:(例如)识别在相应的VM内执行的经选择的进程(此后被视为目标进程)的存储器空间的页面(此后被视为目标页面);以及保护相应的页面内容免于(举例来说)由恶意软件实体进行的未经授权的修改。在另一实例中,自省引擎40可确定目标页面是否含有恶意代码。目标进程可属于(例如)应用程序(例如应用程序42e到f)或属于图4中的客户OS 34。当目标进程在用户级别处理器权限(举例来说,中的用户模式)下执行时,目标页面的内容可能并不是一直存在于存储器中,而是可偶尔由OS换入到存储器中及换出存储器。通过在VM 32 外部执行,存储器自省引擎40可能不能对此类经换出的存储器页面的内容直接存取。FIG6 illustrates an exemplary sequence of steps performed by memory introspection engine 40 to protect a virtual machine from malware, according to some embodiments of the present invention. Such anti-malware protection includes, for example, identifying pages (hereinafter referred to as target pages) of the memory space of a selected process (hereinafter referred to as a target process) executing within the corresponding VM; and protecting the corresponding page contents from unauthorized modification by, for example, a malware entity. In another example, introspection engine 40 may determine whether the target page contains malicious code. The target process may belong to, for example, an application (such as applications 42e-f) or to guest OS 34 in FIG4. When the target process executes under user-level processor privileges (for example, user mode in ), the contents of the target page may not be constantly present in memory but may be occasionally swapped in and out of memory by the OS. By executing outside VM 32, memory introspection engine 40 may not be able to directly access the contents of such swapped-out memory pages.

在步骤302到304的序列中,引擎40等待直到当前执行上下文为目标进程的执行上下文,即,直到当前执行的指令属于目标进程。确定当前执行上下文可包括(例如)读取相应的VM的虚拟处理器的CR3寄存器的内容(x86平台的CR3寄存器存储页面结构的地址,所述页面结构地址唯一地识别每一执行进程)。当执行上下文为目标进程的执行上下文时,在步骤306到308的序列中,引擎40可确定目标页面的内容当前是否被换出存储器。当目标页面的内容在存储器中时,在步骤316中,引擎40可继续自省目标页面(举例来说)以分析及/或保护目标页面的内容。当目标页面的内容当前被换出时,在步骤310中,引擎40直接将页面错误注入到相应的VM中以迫使换入目标页面(如下文将详细描述)。接下来,在步骤312到314的序列中,引擎40等待直到目标页面被换入,即,直到相应的页面内容被映射到相应的VM的虚拟化物理存储器,以执行自省。In the sequence of steps 302-304, engine 40 waits until the current execution context is that of the target process, that is, until the currently executing instruction belongs to the target process. Determining the current execution context may include, for example, reading the contents of the CR3 register of the virtual processor of the corresponding VM (the CR3 register on the x86 platform stores the address of the page structure, which uniquely identifies each executing process). When the execution context is that of the target process, in the sequence of steps 306-308, engine 40 may determine whether the contents of the target page are currently swapped out of memory. If the contents of the target page are in memory, in step 316, engine 40 may continue to introspect the target page (for example, to analyze and/or protect the contents of the target page). If the contents of the target page are currently swapped out, in step 310, engine 40 directly injects a page fault into the corresponding VM to force the target page to be swapped in (as described in detail below). Next, in a sequence of steps 312 to 314 , the engine 40 waits until the target page is swapped in, ie, until the corresponding page content is mapped to the virtualized physical memory of the corresponding VM, to perform introspection.

为了确定目标页面是否存在于存储器中(步骤306到308),以及为了确定目标页面是否已被换入(步骤312到314),存储器自省引擎40可存取由OS 34构建的页面表的内容。在一些实施例中,目标页面的页面表项目的字段(举例来说,专用位)指示相应的页面当前是否存在于存储器中。To determine whether the target page exists in memory (steps 306-308), and to determine whether the target page has been swapped in (steps 312-314), memory introspection engine 40 may access the contents of a page table built by OS 34. In some embodiments, a field (e.g., a dedicated bit) of the page table entry for the target page indicates whether the corresponding page currently exists in memory.

图7说明由引擎40执行以直接注入页面错误从而迫使换入目标页面(图6中的步骤310)的步骤的示范性序列。在步骤序列322到324中,引擎40评估当前状态或虚拟处理器112以确定页面错误异常是否能被安全地注入到VM 32中。步骤322可包括评估当前在处理中的中断请求的优先级。在Microsoft系统中,此类评估可包括(例如) 通过查找VM32的段寄存器的内容确定当前中断请求级别(IRQL)。此类示范性寄存器包含x86处理器架构的FS及/或GS寄存器,所述FS及/或GS寄存器存储到包含IRQL的数据结构的指针。在示范性实施例中,当IRQL<2时,注入页面错误被认为是安全的。当较高优先级的中断在等待时(举例来说,IRQL≥2),步骤322到324等待待服务的高优先级请求。FIG7 illustrates an exemplary sequence of steps performed by engine 40 to directly inject a page fault, thereby forcing a swap in of a target page (step 310 in FIG6 ). In steps 322 through 324, engine 40 evaluates the current state or virtual processor 112 to determine whether a page fault exception can be safely injected into VM 32. Step 322 may include evaluating the priority of the currently processing interrupt request. In Microsoft systems, such evaluation may include, for example, determining the current interrupt request level (IRQL) by looking up the contents of VM 32's segment registers. Exemplary registers include the FS and/or GS registers of the x86 processor architecture, which store pointers to data structures containing IRQLs. In an exemplary embodiment, injecting a page fault is considered safe when IRQL < 2. When a higher priority interrupt is pending (e.g., IRQL ≥ 2), steps 322 through 324 wait for the higher priority request to be serviced.

在一些实施例中,步骤322可包含确定虚拟处理器112当前在其下执行的权限级别(环)。在运行Microsoft的主机系统中,当处理器在用户模式(环3)中执行时,IRQL为零,对应于用户模式页面的如此页面错误的注入可被认为是安全的。当处理器 112在内核模式(环0)中执行时,可需要额外确定以推断错误注入是否为安全的。In some embodiments, step 322 may include determining the privilege level (ring) at which the virtual processor 112 is currently executing. In a host system running Microsoft, when the processor is executing in user mode (ring 3), the IRQL is zero, and injection of such page faults corresponding to user mode pages may be considered safe. When the processor 112 is executing in kernel mode (ring 0), additional determinations may be required to infer whether fault injection is safe.

步骤326到328的序列将页面错误异常注入到VM 32中,所述异常经配置以触发目标页面的换入。在示范性实施例中,在步骤326中,引擎40将目标页面的虚拟地址写入到相应的VM的虚拟处理器的CR2寄存器中,从而向OS 34指示将哪一虚拟页面换入到存储器中。接下来,在步骤328中,引擎40(例如)通过写入VM 32的虚拟机控制结构(VMCS)的一组控制位在虚拟化处理器112内触发异常,相应的控制位可配置以在相应的VM内触发页面错误。在经配置以支持虚拟化的处理器上,此类控制位为 VMCS的VM项目事件注入字段的部分。The sequence of steps 326 through 328 injects a page fault exception into VM 32, which is configured to trigger the swapping of the target page. In an exemplary embodiment, in step 326, engine 40 writes the virtual address of the target page into the CR2 register of the virtual processor of the corresponding VM, thereby indicating to OS 34 which virtual page to swap into memory. Next, in step 328, engine 40 triggers an exception within virtualization processor 112, for example, by writing a set of control bits to the virtual machine control structure (VMCS) of VM 32. The corresponding control bits are configurable to trigger a page fault within the corresponding VM. On processors configured to support virtualization, such control bits are part of the VM entry event injection field of the VMCS.

VM控制结构为由管理程序30维持以描述在主机系统10上执行的客户VM的一种特殊种类的数据结构。VMCS的格式可为特定于实施及/或特定于平台的。对于包括多个虚拟化处理器112的VM,管理程序30可维持用于每一虚拟处理器的相异的VMCS。在一些实施例中,每一VMCS可包括客户状态区及主机状态区,所述客户状态区存储数据,例如CPU状态及/或相应的虚拟处理器的控制寄存器的内容,且所述主机状态区存储用于管理程序30的类似数据。在一些实施例中,处理器12使存储器中的区域与每一VMCS 相关联,命名为VMCS区域。软件可使用区域的地址(举例来说,VMCS指针)来指代特定VMCS。在任何给定时间处,至多一个VMCS可被加载到处理器12上,表示所述VM 当前控制处理器。A VM control structure is a special type of data structure maintained by the hypervisor 30 to describe a guest VM executing on the host system 10. The format of a VMCS can be implementation-specific and/or platform-specific. For a VM that includes multiple virtualized processors 112, the hypervisor 30 can maintain a distinct VMCS for each virtual processor. In some embodiments, each VMCS may include a guest state area that stores data, such as the CPU state and/or the contents of the corresponding virtual processor's control registers, and a host state area that stores similar data for the hypervisor 30. In some embodiments, the processor 12 associates a region in memory with each VMCS, designated a VMCS region. Software can use the region's address (e.g., a VMCS pointer) to refer to a specific VMCS. At any given time, at most one VMCS can be loaded on the processor 12, representing the VM currently controlling the processor.

图8到9展示在环境中的本发明的一些实施例的示范性应用。图8说明由引擎40执行以确定目标进程主要可执行的虚拟存储器地址的步骤的序列。在步骤332中,引擎40可检测目标进程的开始。步骤332可利用所属领域中已知的任何方法,例如拦截管理活动进程的列表的OS的机构。例如,在中,每当进程产生时,相应的进程的指示符被插入到活动进程的列表中;在相应的进程的结束后从列表移除指示符。在一些实施例中,在开始进程之后,OS 34也构建包括由OS 34使用的数据的特定于进程的数据结构(被称为进程环境块(PEB))以管理与相应的进程相关联的资源。通过拦截(举例来说,安放一拦截)用于将目标进程插入到活动进程的列表中的OS指令,引擎40可获得例如相应的PEB的存储器地址等信息,引擎40可在步骤334中提取所述信息。在Windows中,PEB的虚拟地址被存储于OS的数据结构中,被称为执行进程块 (EPROCESS)。图10展示此类特定于进程的数据结构的说明性图式。Figures 8 and 9 illustrate exemplary applications of some embodiments of the present invention within an environment. Figure 8 illustrates a sequence of steps performed by engine 40 to determine the virtual memory address of the target process's primary executable. In step 332, engine 40 may detect the start of the target process. Step 332 may utilize any method known in the art, such as intercepting an OS mechanism that manages a list of active processes. For example, in Windows, whenever a process is created, an indicator of the corresponding process is inserted into the list of active processes; the indicator is removed from the list after the corresponding process ends. In some embodiments, after starting a process, OS 34 also constructs a process-specific data structure (referred to as a process environment block (PEB)) containing data used by OS 34 to manage resources associated with the corresponding process. By intercepting (e.g., placing an intercept) the OS instruction for inserting the target process into the list of active processes, engine 40 may obtain information such as the memory address of the corresponding PEB, which engine 40 may extract in step 334. In Windows, the virtual address of the PEB is stored in an OS data structure referred to as the executing process block (EPROCESS). FIG10 shows an illustrative diagram of such a process-specific data structure.

作为用户级别数据结构,含有PEB数据的虚拟存储器页面当前可存在或可不存在于存储器中。在步骤336中,引擎40确定相应的虚拟存储器页面是否被换出,且如果否,则在步骤340中引擎40继续(例如)通过解析PEB数据确定目标进程的主要可执行的虚拟地址。当PEB数据当前被换出存储器时,步骤338使用(举例来说)如上文关于图7描述的机制迫使换入含有PEB数据的相应的页面。As a user-level data structure, the virtual memory page containing the PEB data may or may not currently be present in memory. In step 336, the engine 40 determines whether the corresponding virtual memory page is swapped out. If not, the engine 40 proceeds to determine the virtual address of the target process's primary executable, for example, by parsing the PEB data, in step 340. When the PEB data is currently swapped out of memory, step 338 forces the corresponding page containing the PEB data to be swapped in, for example, using the mechanism described above with respect to FIG. 7 .

图9展示由引擎40实施以执行由目标进程加载的可执行模块(例如库)的存储器自省的步骤的示范性序列。恶意软件通常使用DLL作为用于携载恶意代码的向量,所以分析此类库的内容对反恶意软件操作可能是重要的。在步骤342中存取含有PEB数据的虚拟页面之后(参看(举例来说)上文的步骤336到338),在步骤344到346到348的序列中引擎40识别由目标进程使用的目标模块(举例来说,动态链接库(DLL))且确定相应的模块是否已加载。当目标模块已加载时,在步骤350中引擎40可(例如)根据PEB的特定数据字段(参看(举例来说)图10)确定相应的模块的虚拟地址。在步骤352中,引擎40确定含有模块数据且存在于在步骤350中确定的地址处的虚拟页面当前是否被换出存储器,且当没有时,在步骤356中继续执行相应的模块的存储器自省。当相应的模块的虚拟页面当前被换出时,在步骤354中,引擎40使用(例如)上文关于图7描述的机制迫使换入相应的虚拟页面。FIG9 shows an exemplary sequence of steps implemented by engine 40 to perform memory introspection of an executable module (e.g., a library) loaded by a target process. Malware often uses DLLs as a vector for carrying malicious code, so analyzing the contents of such libraries can be important for anti-malware operations. After accessing the virtual page containing PEB data in step 342 (see, for example, steps 336 through 338 above), engine 40 identifies the target module (e.g., a dynamic link library (DLL)) used by the target process and determines whether the corresponding module is loaded in a sequence of steps 344 through 346 through 348. If the target module is loaded, engine 40 may determine the virtual address of the corresponding module in step 350, for example, based on specific data fields in the PEB (see, for example, FIG10). In step 352, engine 40 determines whether the virtual page containing the module data and located at the address determined in step 350 is currently swapped out of memory. If not, engine 40 continues to perform memory introspection of the corresponding module in step 356. When the virtual page of the corresponding module is currently swapped out, in step 354 the engine 40 forces the corresponding virtual page to be swapped in using, for example, the mechanism described above with respect to FIG. 7 .

图10展示在环境中的虚拟地址的示范性确定。在一些实施例中,OS 34维持内核虚拟存储器空间214d,其中位于虚拟地址60p处的页面含有由OS 34用来管理目标进程的执行的EPROCESS结构的部分。(例如)可通过拦截目标进程的开始(参见(举例来说)图8中的步骤332)确定地址60p。EPROCESS数据结构的字段持有目标进程的进程环境块(PEB)的指示符(举例来说,指针)。指针指示由OS 34指派到目标进程的进程虚拟存储器214e内的虚拟地址60q。PEB结构进一步包含到含有关于由目标进程加载的可执行模块(举例来说,库)的信息的结构(LDR数据)的指针。LDR数据位于空间214e内的地址60r处。通过行走由OS 34构建的进程管理数据结构的分层,自省引擎40可因此确定用于自省目标的对象的多个虚拟地址。当位于此类地址处的存储器页面的内容被换出 RAM时,引擎40可迫使OS34使用本文中描述的方法将相应的页面换入。FIG10 illustrates an exemplary determination of a virtual address within an environment. In some embodiments, OS 34 maintains kernel virtual memory space 214d, wherein a page at virtual address 60p contains a portion of an EPROCESS structure used by OS 34 to manage the execution of a target process. Address 60p can be determined, for example, by intercepting the start of the target process (see, for example, step 332 in FIG8 ). Fields of the EPROCESS data structure hold an indicator (e.g., a pointer) to the process environment block (PEB) of the target process. The pointer indicates a virtual address 60q within process virtual memory 214e assigned by OS 34 to the target process. The PEB structure further includes a pointer to a structure (LDR data) containing information about executable modules (e.g., libraries) loaded by the target process. The LDR data is located at address 60r within space 214e. By traversing the hierarchy of process management data structures constructed by OS 34, introspection engine 40 can thus determine multiple virtual addresses for objects targeted for introspection. When the contents of a memory page located at such an address are swapped out of RAM, engine 40 may force OS 34 to swap in the corresponding page using the methods described herein.

上文描述的示范性系统及方法允许使用虚拟化技术保护主机系统免受恶意软件影响。在一些实施例中,存储器自省引擎在于主机系统上执行的虚拟机下方操作。存储器自省引擎可通过分析由在相应的虚拟机内执行的进程使用的存储器页面的内容保护虚拟机。自省引擎可因此从相应的VM外部确定相应的进程的代码是否含有恶意软件。The exemplary systems and methods described above allow for the use of virtualization technology to protect host systems from malware. In some embodiments, a memory introspection engine operates beneath a virtual machine executing on the host system. The memory introspection engine can protect the virtual machine by analyzing the contents of memory pages used by processes executing within the corresponding virtual machine. The introspection engine can thus determine, from outside the corresponding VM, whether the code of the corresponding process contains malware.

在一些实施例中,自省引擎还可防止一些关键对象(例如某些驱动程序及页面表以及其它)的未经授权的修改(举例来说,通过恶意软件)。为了保护此类对象,一些实施例可通过拦截对被分配到相应的对象的存储器页面的试图写入来防止变化。可根据管理程序的级别执行此类拦截。In some embodiments, the introspection engine can also prevent unauthorized modification (e.g., by malware) of some critical objects, such as certain drivers and page tables, among others. To protect such objects, some embodiments can prevent changes by intercepting attempts to write to memory pages allocated to the corresponding objects. Such interception can be performed based on the level of the hypervisor.

在常规的反恶意软件系统中,安全应用程序在类似于操作系统或共同应用程序的处理器权限级别的处理器权限级别下执行。此类系统可能易受也在操作系统的权限级别下操作的高级的恶意软件的伤害。相比之下,在本发明的一些实施例中,管理程序在最高权限级别(举例来说,根模式或环-1)下执行,从而将操作系统转移到虚拟机。存储器自省引擎可在与管理程序相同的处理器权限级别下执行。可因此根据高于操作系统的处理器权限级别的处理器权限级别进行反恶意软件操作。在一些实施例中,单一存储器自省引擎可保护在相应的计算机系统上同时执行的多个虚拟机。In conventional anti-malware systems, security applications execute at a processor privilege level similar to that of the operating system or common applications. Such systems may be vulnerable to advanced malware that also operates at the operating system's privilege level. In contrast, in some embodiments of the present invention, the hypervisor executes at the highest privilege level (for example, root mode or ring-1), thereby transferring the operating system to a virtual machine. The memory introspection engine may execute at the same processor privilege level as the hypervisor. Anti-malware operations may therefore be performed at a processor privilege level that is higher than that of the operating system. In some embodiments, a single memory introspection engine may protect multiple virtual machines executing simultaneously on a corresponding computer system.

尽管存储器自省引擎在用于保护目标的虚拟机外部执行,但引擎可确定由在受保护的VM内运行的软件对象使用的虚拟地址。然而,当此类虚拟地址指向当前由操作系统换出存储器的页面的内容时,存储器自省引擎不能存取相应的内容。在本发明的一些实施例中,当页面当前被换出时,存储器自省引擎可迫使OS将相应的页面换入,从而使相应的页面内容可用于分析及/或保护。为了迫使换入,存储器自省引擎可在相应的虚拟机的虚拟化处理器内触发处理器事件(例如页面错误异常),所述处理器事件经配置以使得操作系统将经换出的页面带回到存储器。触发处理器事件可包括:(例如)写入到由相应的虚拟机使用的虚拟机控制结构的一组控制位。存储器自省引擎可因此在无需来自 OS或来自在相应的VM内执行的其它软件的协助的情况下将页面错误注入到相应的虚拟机中。Although the memory introspection engine executes outside the virtual machine used to protect the target, the engine can determine the virtual addresses used by software objects running within the protected VM. However, when such virtual addresses point to the contents of a page currently swapped out of memory by the operating system, the memory introspection engine cannot access the corresponding contents. In some embodiments of the present invention, when a page is currently swapped out, the memory introspection engine can force the OS to swap in the corresponding page, thereby making the corresponding page contents available for analysis and/or protection. To force the swap in, the memory introspection engine can trigger a processor event (such as a page fault exception) within the virtualization processor of the corresponding virtual machine, which is configured to cause the operating system to bring the swapped out page back to memory. Triggering the processor event may include, for example, writing a set of control bits to a virtual machine control structure used by the corresponding virtual machine. The memory introspection engine can therefore inject a page fault into the corresponding virtual machine without assistance from the OS or from other software executing within the corresponding VM.

所属领域的技术人员将清楚的是,在不背离本发明的范围的情况下可以许多方式更改上文的实施例。因此,本发明的范围应由以下权利要求书及其合法等效物确定。It will be apparent to those skilled in the art that the above embodiments can be modified in many ways without departing from the scope of the invention. Therefore, the scope of the invention should be determined by the following claims and their legal equivalents.

Claims (23)

1.一种用于保护计算机系统免受恶意软件影响的主机系统,所述主机系统包括硬件处理器,其经配置以操作:1. A host system for protecting a computer system from malware, the host system including a hardware processor configured to operate: 管理程序,其经配置以暴露包括虚拟化处理器及虚拟化存储器的虚拟机,所述虚拟机经配置以利用所述虚拟化处理器执行目标进程,其中暴露所述虚拟机包括配置数据结构以存储所述虚拟化处理器的当前状态,所述数据结构包括事件注入字段,当所述事件注入字段设置为预定值时,致使所述虚拟化处理器产生页面错误;以及存储器自省引擎,其在所述虚拟机外部执行且经配置以:A hypervisor configured to expose a virtual machine including a virtualization processor and virtualization memory, the virtual machine being configured to execute a target process using the virtualization processor, wherein exposing the virtual machine includes a configuration data structure for storing the current state of the virtualization processor, the data structure including an event injection field that, when set to a predetermined value, causes the virtualization processor to generate a page fault; and a memory introspection engine executed outside the virtual machine and configured to: 根据所述虚拟机的页面表确定所述目标进程的虚拟存储器空间的目标页面是否被换出所述虚拟化存储器;以及The virtual machine's page table is used to determine whether the target page of the target process's virtual memory space has been swapped out of the virtualized memory; and 作为响应,当所述目标页面被换出所述虚拟化存储器时,直接将所述页面错误注入到所述虚拟机中,所述页面错误使得所述虚拟机的操作系统将所述目标页面映射到所述虚拟化存储器的页面,其中直接注入所述页面错误包括所述存储器自省引擎将所述预定值写入所述事件注入字段。In response, when the target page is swapped out of the virtualization memory, a page fault is directly injected into the virtual machine. The page fault causes the operating system of the virtual machine to map the target page to a page in the virtualization memory. Directly injecting the page fault includes the memory introspection engine writing the predetermined value into the event injection field. 2.根据权利要求1所述的主机系统,其中直接注入所述页面错误包括:所述存储器自省引擎将所述目标页面的虚拟地址写入到所述虚拟化处理器的寄存器。2. The host system according to claim 1, wherein directly injecting the page fault includes: the memory introspection engine writing the virtual address of the target page into the register of the virtualization processor. 3.根据权利要求1所述的主机系统,其中所述存储器自省引擎进一步经配置以:3. The host system of claim 1, wherein the memory introspection engine is further configured to: 为直接注入所述页面错误做准备,根据所述虚拟化处理器的所述当前状态确定是否满足注入条件;以及In preparation for directly injecting the page fault, it is determined whether the injection conditions are met based on the current state of the virtualization processor; and 作为响应,当满足所述注入条件时直接注入所述页面错误。In response, the page error is injected directly when the injection conditions are met. 4.根据权利要求3所述的主机系统,其中确定是否满足所述事件注入条件包括:确定所述虚拟化处理器的中断请求级别IRQL。4. The host system of claim 3, wherein determining whether the event injection condition is met includes: determining the interrupt request level (IRQL) of the virtualization processor. 5.根据权利要求3所述的主机系统,其中确定是否满足所述事件注入条件包括:确定所述虚拟化处理器当前在其下执行的权限级别。5. The host system of claim 3, wherein determining whether the event injection condition is met includes: determining the permission level under which the virtualization processor is currently executing. 6.根据权利要求3所述的主机系统,其中确定是否满足所述事件注入条件包括:确定所述虚拟化处理器的当前执行上下文。6. The host system of claim 3, wherein determining whether the event injection condition is met includes: determining the current execution context of the virtualization processor. 7.根据权利要求3所述的主机系统,其中响应于确定所述注入条件是否被满足,所述存储器自省引擎进一步经配置以当所述注入条件没有被满足时,延迟注入所述页面错误直到所述注入条件被满足。7. The host system of claim 3, wherein, in response to determining whether the injection condition is met, the memory introspection engine is further configured to delay injecting the page fault until the injection condition is met if the injection condition is not met. 8.根据权利要求1所述的主机系统,其中所述存储器自省引擎进一步经配置响应于直接注入所述页面错误以:8. The host system of claim 1, wherein the memory introspection engine is further configured to respond to direct injection of the page fault to: 检测所述目标页面的页面表项目的修改;以及Detect modifications to the page table items of the target page; and 作为响应,根据所述修改确定所述目标页面是否被映射到所述虚拟化存储器的所述页面。In response, it is determined whether the target page is mapped to the page in the virtualized memory based on the modification. 9.根据权利要求1所述的主机系统,其中所述存储器自省引擎进一步经配置以根据所述目标页面的内容确定所述目标进程是否为恶意的。9. The host system of claim 1, wherein the memory introspection engine is further configured to determine whether the target process is malicious based on the content of the target page. 10.根据权利要求1所述的主机系统,其中所述存储器自省引擎进一步经配置以拦截对所述目标页面的内容的试图修改。10. The host system of claim 1, wherein the memory introspection engine is further configured to intercept attempts to modify the content of the target page. 11.根据权利要求1所述的主机系统,其中所述存储器自省引擎进一步经配置为确定所述目标页面是否被换出所述虚拟化存储器做准备以:11. The host system of claim 1, wherein the memory introspection engine is further configured to prepare for determining whether the target page is to be swapped out of the virtualization memory: 检测所述虚拟化处理器的事件,所述事件指示在所述虚拟机内的所述目标进程的开始;以及Detecting events on the virtualization processor, the events indicating the start of the target process within the virtual machine; and 作为响应,根据所述事件确定所述目标页面的虚拟地址。In response, the virtual address of the target page is determined based on the event. 12.一种用于保护计算机系统免受恶意软件影响的方法,其包括:12. A method for protecting a computer system from malware, comprising: 利用主机系统的至少一个硬件处理器执行管理程序,所述管理程序经配置以暴露包括虚拟化处理器及虚拟化存储器的虚拟机,所述虚拟机经配置以利用所述虚拟化处理器执行目标进程,其中暴露所述虚拟机包括配置数据结构以存储所述虚拟化处理器的当前状态,所述数据结构包括事件注入字段,当所述事件注入字段设置为预定值时,致使所述虚拟化处理器产生页面错误;A hypervisor is executed using at least one hardware processor of a host system. The hypervisor is configured to expose a virtual machine including a virtualization processor and virtualization memory. The virtual machine is configured to execute a target process using the virtualization processor. Exposing the virtual machine includes a configuration data structure to store the current state of the virtualization processor. The data structure includes an event injection field that, when set to a predetermined value, causes the virtualization processor to generate a page fault. 利用所述至少一个硬件处理器确定所述目标进程的虚拟存储器空间的目标页面是否被换出所述虚拟化存储器;以及The at least one hardware processor is used to determine whether a target page in the virtual memory space of the target process has been swapped out of the virtualized memory; and 作为响应,当所述页面被换出所述虚拟化存储器时,利用所述至少一个硬件处理器直接将所述页面错误注入到所述虚拟机中,所述页面错误使得所述虚拟机的操作系统将所述目标页面映射到所述虚拟化存储器的页面,其中直接注入所述页面错误包括所述存储器自省引擎将所述预定值写入所述事件注入字段。In response, when the page is swapped out of the virtualized memory, the page fault is directly injected into the virtual machine using the at least one hardware processor. The page fault causes the operating system of the virtual machine to map the target page to a page in the virtualized memory. Directly injecting the page fault includes the memory introspection engine writing the predetermined value into the event injection field. 13.根据权利要求12所述的方法,其中直接注入所述页面错误包括:将所述目标页面的虚拟地址写入到所述虚拟化处理器的寄存器。13. The method of claim 12, wherein directly injecting the page fault comprises: writing the virtual address of the target page into a register of the virtualization processor. 14.根据权利要求12所述的方法,其进一步包括为直接注入所述页面错误做准备:14. The method of claim 12, further comprising preparing for direct injection of the page error: 利用所述至少一个硬件处理器以根据所述虚拟化处理器的所述当前状态确定是否满足注入条件;以及The at least one hardware processor is used to determine whether the injection condition is met based on the current state of the virtualization processor; and 作为响应,当满足所述注入条件时利用所述至少一个硬件处理器直接注入所述页面错误。In response, when the injection conditions are met, the page error is directly injected using the at least one hardware processor. 15.根据权利要求14所述的方法,其中确定是否满足所述事件注入条件包括:确定所述虚拟化处理器的当前中断请求级别IRQL。15. The method of claim 14, wherein determining whether the event injection condition is met comprises: determining the current interrupt request level (IRQL) of the virtualization processor. 16.根据权利要求14所述的方法,其中确定是否满足所述事件注入条件包括:确定所述虚拟化处理器当前在其下执行的权限级别。16. The method of claim 14, wherein determining whether the event injection condition is met comprises: determining the permission level under which the virtualization processor is currently executing. 17.根据权利要求14所述的方法,其中确定是否满足所述事件注入条件包括:确定所述虚拟化处理器的当前执行上下文。17. The method of claim 14, wherein determining whether the event injection condition is met comprises: determining the current execution context of the virtualization processor. 18.根据权利要求14所述的方法,其进一步包括响应于确定所述注入条件是否被满足,当所述注入条件没有被满足时,延迟注入所述页面错误直到所述注入条件被满足。18. The method of claim 14, further comprising, in response to determining whether the injection condition is met, delaying the injection of the page error until the injection condition is met when the injection condition is not met. 19.根据权利要求12所述的方法,其进一步包括,响应于直接注入所述页面错误:19. The method of claim 12, further comprising, in response to directly injecting the page error: 利用所述至少一个硬件处理器检测所述目标页面的页面表项目的修改;以及The modification of page table items of the target page is detected using the at least one hardware processor; and 作为响应,利用所述至少一个硬件处理器以根据所述修改确定所述目标页面是否被映射到所述虚拟化存储器的所述页面。In response, the at least one hardware processor is used to determine, based on the modification, whether the target page is mapped to the page in the virtualized memory. 20.根据权利要求12所述的方法,其进一步包括利用所述至少一个硬件处理器以根据所述目标页面的内容确定所述目标进程是否为恶意的。20. The method of claim 12, further comprising using the at least one hardware processor to determine whether the target process is malicious based on the content of the target page. 21.根据权利要求12所述的方法,其进一步包括利用所述至少一个硬件处理器拦截对所述目标页面的内容的试图修改。21. The method of claim 12, further comprising using the at least one hardware processor to intercept attempts to modify the content of the target page. 22.根据权利要求12所述的方法,其进一步包括,为确定所述目标页面是否被换出所述虚拟化存储器做准备:22. The method of claim 12, further comprising preparing for determining whether the target page has been swapped out of the virtualization memory: 利用所述至少一个硬件处理器检测所述虚拟化处理器的事件,所述事件指示在所述虚拟机内的所述目标进程的开始;以及The virtualization processor is detected using the at least one hardware processor, the event indicating the start of the target process within the virtual machine; and 作为响应,利用所述至少一个硬件处理器以根据所述事件确定所述目标页面的虚拟地址。In response, the at least one hardware processor is used to determine the virtual address of the target page based on the event. 23.一种用于保护计算机系统免受恶意软件影响的非暂时性计算机可读媒体,所述非暂时性计算机可读媒体存储指令,所述指令在由主机系统的至少一个硬件处理器执行时使得所述主机系统形成存储器自省引擎,其中所述主机系统执行暴露包括虚拟化处理器及虚拟化存储器的虚拟机的管理程序,所述虚拟机经配置以利用所述虚拟化处理器执行目标进程,其中暴露所述虚拟机包括配置数据结构以存储所述虚拟化处理器的当前状态,所述数据结构包括事件注入字段,当所述事件注入字段设置为预定值时,致使所述虚拟化处理器产生页面错误,其中所述存储器自省引擎在所述虚拟机外部执行,且其中所述存储器自省引擎经配置以:23. A non-transitory computer-readable medium for protecting a computer system from malware, the non-transitory computer-readable medium storing instructions that, when executed by at least one hardware processor of a host system, cause the host system to form a memory introspection engine, wherein the host system executes a hypervisor that exposes a virtual machine including a virtualization processor and virtualization memory, the virtual machine being configured to execute a target process using the virtualization processor, wherein exposing the virtual machine includes a configuration data structure for storing the current state of the virtualization processor, the data structure including an event injection field that, when the event injection field is set to a predetermined value, causes the virtualization processor to generate a page fault, wherein the memory introspection engine executes outside the virtual machine, and wherein the memory introspection engine is configured to: 根据所述虚拟机的页面表确定所述目标进程的虚拟存储器空间的目标页面是否被换出所述虚拟化存储器;以及The virtual machine's page table is used to determine whether the target page of the target process's virtual memory space has been swapped out of the virtualized memory; and 作为响应,当所述目标页面被换出所述虚拟化存储器时直接将页面错误注入到所述虚拟机中,所述页面错误使得所述虚拟机的操作系统将所述目标页面映射到所述虚拟化存储器的页面,其中直接注入所述页面错误包括所述存储器自省引擎将所述预定值写入所述事件注入字段。In response, when the target page is swapped out of the virtualization memory, a page fault is directly injected into the virtual machine. The page fault causes the operating system of the virtual machine to map the target page to a page in the virtualization memory. Directly injecting the page fault includes the memory introspection engine writing the predetermined value into the event injection field.
HK16104630.0A 2013-07-17 2014-07-02 Page fault injection in virtual machines HK1216679B (en)

Applications Claiming Priority (5)

Application Number Priority Date Filing Date Title
US201361847538P 2013-07-17 2013-07-17
US61/847,538 2013-07-17
US14/289,163 US9507727B2 (en) 2013-07-17 2014-05-28 Page fault injection in virtual machines
US14/289,163 2014-05-28
PCT/RO2014/000018 WO2015152747A2 (en) 2013-07-17 2014-07-02 Page fault injection in virtual machines

Publications (2)

Publication Number Publication Date
HK1216679A1 HK1216679A1 (en) 2016-11-25
HK1216679B true HK1216679B (en) 2019-11-15

Family

ID=

Similar Documents

Publication Publication Date Title
AU2014389571B2 (en) Page fault injection in virtual machines to cause mapping of swapped-out memory pages into VM] virtu alized memory
CN109923546B (en) Event filtering for virtual machine security applications
KR101863174B1 (en) Memory introspection engine for integrity protection of virtual machines
JP6378758B2 (en) Process evaluation for malware detection in virtual machines
US10489185B2 (en) Hypervisor-assisted approach for locating operating system data structures based on attribute matching
US20180267818A1 (en) Hypervisor-assisted approach for locating operating system data structures based on notification data
US20150379265A1 (en) Systems And Methods For Preventing Code Injection In Virtualized Environments
US10620985B2 (en) Transparent code patching using a hypervisor
Li et al. Iso-UniK: lightweight multi-process unikernel through memory protection keys
HK1216679B (en) Page fault injection in virtual machines
HK1214663B (en) Memory introspection engine for integrity protection of virtual machines
HK1216930B (en) Process evaluation for malware detection in virtual machines