WO2021130420A1 - Method and device implementing said method for generating and installing an executable code in the memory of a core of a virtual machine from a hypervisor - Google Patents

Method and device implementing said method for generating and installing an executable code in the memory of a core of a virtual machine from a hypervisor Download PDF

Info

Publication number
WO2021130420A1
WO2021130420A1 PCT/FR2020/052346 FR2020052346W WO2021130420A1 WO 2021130420 A1 WO2021130420 A1 WO 2021130420A1 FR 2020052346 W FR2020052346 W FR 2020052346W WO 2021130420 A1 WO2021130420 A1 WO 2021130420A1
Authority
WO
WIPO (PCT)
Prior art keywords
instruction
code
memory
executable code
address
Prior art date
Application number
PCT/FR2020/052346
Other languages
French (fr)
Inventor
Yacine HEBBAL
Original Assignee
Orange
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
Application filed by Orange filed Critical Orange
Publication of WO2021130420A1 publication Critical patent/WO2021130420A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/301Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system is a virtual computing platform, e.g. logically partitioned systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45583Memory management, e.g. access or allocation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45591Monitoring or debugging support

Definitions

  • the invention relates to the general field of computer software. It relates more particularly to the management of functions executed by a virtual machine.
  • the current state of the art does not provide a satisfactory solution for monitoring the functions that run in the kernel memory of a virtual machine.
  • the current existing techniques are exclusively "in-VM”: the probing technique or “probing” requires injecting code into a virtual machine from it; this requires administrator access to the virtual machine.
  • Another existing observation technique is to position observation points in a virtual machine. However, during observation, the virtual machine is stopped, which impacts the performance of the virtual machine.
  • the invention relates to a method for generating and installing an executable code of at least a first function in the memory of a kernel of a virtual machine, this method being implemented by a hypervisor and comprising steps from:
  • this configuration data comprising at least one address in a memory of the kernel of the virtual machine, a function or data referenced by the source code;
  • the invention is aimed at a device for generating and installing an executable code of at least a first function in a memory of a kernel of a virtual machine, this device comprising the virtual machine and a hypervisor, said device.
  • hypervisor comprising a module capable of implementing a generation and installation method according to the invention.
  • the executable code thus obtained will sometimes be called “first executable code”.
  • the invention first of all provides a solution for generating and installing from a hypervisor executable code in the memory of the kernel of a virtual machine.
  • the hypervisor can monitor the functions running in the virtual machine and install the new executable code into kernel memory without shutting down the virtual machine.
  • the executable code obtained is specific to the virtual machine.
  • the hypervisor instantiates multiple virtual machines, it can generate and install for each of these virtual machines a specific executable code, generated from the same source code.
  • the poll or “probing” of a virtual machine becomes an on-demand (“on-demand”) and on-the-fly (“on-the-fly”) mechanism, independent of what exists in the virtual machine initially, that is to say at the time of its development or / and its initial instantiation.
  • the survey is done from the hypervisor, and no longer from the virtual machine using an administrator account.
  • the hypervisor can be of the native type (installed directly on a physical machine), or of the host type (installed on a given operating system, which is itself installed on a physical machine).
  • the mechanism of the invention can be used on any operating system and on any type of virtual machine: "classic" virtual machine or virtual machine containing a container or a uni kernel.
  • a uni kernel is a small kernel in which a single application is integrated. Such a probing mechanism on a unikernel thus makes it possible to probe minimalist functions, such as network functions.
  • the method of generating and installing an executable code of at least a first function further comprises the steps of:
  • the invention thus makes it possible to enrich the second executable code with the first executable code.
  • the processor of the installation device according to the invention executes the second code, it is redirected to execute the first code, and then executes the end of the second code.
  • the hypervisor Since the method is implemented by the hypervisor, the latter can check that the function to be enriched is not executed to modify its executable code as mentioned above to allow its enrichment.
  • the invention thus makes it possible to enrich a function running in the kernel of a virtual machine without interrupting this virtual machine.
  • the first code can implement a survey to perform statistics on the use of the second code.
  • the first code can correspond to an authorization management function to increase the security of the use of the second code.
  • moving and recording steps can be performed simultaneously, or one after the other, without constraint on the order of their implementation.
  • a branch instruction also called a return instruction, or a jump instruction is an instruction which allows when it is executed, a return without return, to a memory address comprising an instruction to be executed.
  • the method according to the invention further comprises steps of:
  • an aggregation space is used to install the first executable code.
  • the method further comprises steps of:
  • This embodiment makes it possible to organize the memory of the kernel of the virtual machine so as to be able to make, from the second code, one or more references to one or more other executable codes, by inserting branching instructions in space. aggregation memory.
  • the instruction of the second code is moved into the aggregation space, preferably towards its end so as to leave space for recording the first branch instruction in the memory space of the first. code, and possibly record other branching instructions to additional executable code memory spaces, to further enrich the second code with these additional codes.
  • the method according to the invention further comprises steps of:
  • the instruction of the second code is moved in the aggregation space, preferably at its start so as to leave space for recording the first branch instruction in the memory space of the first. code, and possibly record other branching instructions to additional executable code memory spaces, to further enrich the second code with these additional codes.
  • the step of calling the memory allocation function takes into consideration the size of a said branch instruction in addition to the size of the first code.
  • a margin is provided for this instruction in the memory space of the first executable code.
  • the pointing to the target address is maintained even by implementing the step of moving the instruction (s) of the second code.
  • This embodiment makes it possible to set up an optimized probing mechanism.
  • the method according to the invention allows the installation of at least one additional executable code in the memory of the kernel of the virtual machine. It includes stages of:
  • the second code can thus be enriched by the first executable code, and by the additional executable code.
  • the invention makes it possible to enrich a code with as many other executable codes.
  • the invention also relates to a computer program on a recording medium, this program being capable of being implemented in a computer or in a generation and installation device in accordance with the invention, this program comprising instructions adapted to the implementation of a generation and installation method as described above.
  • This program can use any programming language, and be in the form of machine code, source code, object code, or code intermediate between source code and object code, such as in a partially compiled form, or in n ' any other desirable shape.
  • this program can be in Java language, supported by the hypervisor according to the invention.
  • this program can be executed by a microcontroller pC (“microcontroller” in English).
  • the invention also relates to information or recording media readable by a computer, and comprising instructions of the computer program as mentioned above.
  • Information or recording media can be any entity or device capable of storing programs.
  • the media can include a storage means, such as a ROM, for example a CD ROM or a microelectronic circuit ROM, or else a magnetic recording means, for example a floppy disk or a disk. hard, or flash memory.
  • the information or recording media can be transmissible media such as an electrical or optical signal, which can be routed via an electrical or optical cable, by radio link, by wireless optical link or by other ways.
  • the program according to the invention can in particular be downloaded from an Internet type network.
  • each information or recording medium can be an integrated circuit in which the program is incorporated, the circuit being adapted to execute or to be used in the execution of the generation and installation method according to the invention.
  • FIG. 1 illustrates a functional architecture of a device for generating and installing an executable code in accordance with the invention, according to one embodiment of the invention
  • FIG. 2 is a flowchart representing steps of a method for generating and installing an executable code in accordance with the invention, implemented according to one embodiment
  • FIG. 3 is a flowchart representing additional steps of a method for generating and installing an executable code in accordance with the invention, implemented according to a first embodiment of the invention
  • FIG. 4A illustrates an architecture of the organization of the memory of a virtual machine before the implementation of the method for generating and installing an executable code in accordance with the invention, according to the embodiment of the figure 3
  • FIG. 4B illustrates an architecture of the organization of the memory of a virtual machine following the implementation of the method for generating and installing an executable code in accordance with the invention, according to the embodiment of the figure 3
  • FIG. 4C illustrates an architecture of the organization of the memory of a virtual machine following the implementation of the method for generating and installing an executable code in accordance with the invention, according to a variant of the embodiment of Figure 3;
  • FIG. 4A illustrates an architecture of the organization of the memory of a virtual machine before the implementation of the method for generating and installing an executable code in accordance with the invention, according to the embodiment of the figure 3
  • FIG. 4B illustrates an architecture of the organization of the memory of a virtual machine following the implementation of the method for generating and installing an executable code in accordance with the invention, according to the embodiment of
  • FIG. 5 is a flowchart representing additional steps of a method for generating and installing an executable code in accordance with the invention, implemented according to a second embodiment of the invention
  • FIG. 6 A illustrates an architecture of the organization of the memory of a virtual machine following the implementation of the method for generating and installing an executable code in accordance with the invention, according to the embodiment of figure 5
  • FIG. 6B illustrates an architecture of the organization of the memory of a virtual machine following the implementation of the method for generating and installing an executable code in accordance with the invention, according to a variant of the embodiment of Figure 5
  • FIG. 7 is a flowchart representing steps of a method for generating and installing an additional code in accordance with the invention, implemented according to an embodiment of the invention
  • FIG. 6 A illustrates an architecture of the organization of the memory of a virtual machine following the implementation of the method for generating and installing an executable code in accordance with the invention, according to the embodiment of figure 5
  • FIG. 6B illustrates an architecture of the organization of the memory of
  • FIG. 8 illustrates an architecture of the organization of the memory of a virtual machine following the implementation of the generation and installation method according to the invention, according to the embodiment of FIG. 7;
  • FIG. 9 illustrates a particular embodiment of the invention in which the displaced instructions comprise branch or call instructions with address offset; and
  • FIG. 10 illustrates the hardware architecture of a generation and installation device according to one embodiment of the invention.
  • Figure 1 illustrates a functional architecture of a CMP generation and installation device according to one embodiment of the invention. This device is configured to implement a method in accordance with the invention.
  • the installation device CMP comprises a physical machine PHY, such as a computer, on which a hypervisor H is installed.
  • the H hypervisor is suitable for managing the allocation of the physical resources of the server between different instances of machines virtual machines and to be able to create, instantiate, release and place virtual machines MV, MV 'and MV ”.
  • Virtual machines can use different operating systems.
  • Each of the virtual machine operating systems has at least one kernel.
  • K the kernel of the virtual machine MV, more precisely of the operating system of the virtual machine MV.
  • the H hypervisor can install executable codes in one or more of these virtual machines, in a personalized way for each of these virtual machines.
  • the hypervisor H installs one or more executable codes in a single virtual machine MV.
  • FIG. 2 is a flowchart representing the different steps of a method for generating and installing an executable code CX1, usually called a “probe”, of at least one function f1 in the kernel of a virtual machine, in accordance with to one embodiment of the invention. This process is implemented by the hypervisor H in figure 1.
  • the hypervisor H obtains the source code CS1 from a probe comprising at least the source code of a function fl.
  • This CS1 code can include several functions and data internal to the probe, and reference other functions, and / or data external to the probe, which therefore belong to the virtual machine.
  • the H hypervisor is configured to install the CX1 executable code of the probe, obtained from this CS1 source code, in the K kernel of the VM virtual machine, this CX1 code being specific to this virtual machine.
  • the hypervisor H obtains configuration data CFG_MV of the virtual machine MV, these configuration data comprising at least one @F address of a function F called by the source code CS1 in the memory of the virtual machine MV, or an @D address of a data item D referenced by the source code CS1 in the memory of the virtual machine MV.
  • the configuration data CFG_MV can be included in a file of the “system.map” type, comprising an exhaustive list of the functions of the operating system. of the virtual machine MV as well as, for each of these functions (F), the memory address (@F) of the memory space in which this function is recorded.
  • the CFG_MV configuration data can include information on the structure of the data recorded in the VM virtual machine, for example on how a process descriptor is structured: process identifier, next process, previous process, etc.
  • the hypervisor H compiles the source code CS1 using the configuration data CFG_MV to obtain an object code.
  • the hypervisor H calls a malloc_MV function of the virtual machine MV to allocate a memory space EM1 in the memory of the kernel of the virtual machine MV at least sufficient to accommodate the executable code CX1.
  • EM1 the start address of this memory space EM1 in the virtual machine VM.
  • the hypervisor H then edits the links (in English "link") and assembles the object code to obtain the executable code CX1 using the configuration data CFG_MV and a result of the call (E030) to the malloc_MV function, in particular l '@ EM1 address of the EM1 space.
  • the executable code CX1 is specific to the virtual machine MV; in effect, linking relies on the configuration of the VM virtual machine.
  • the hypervisor H records the executable code CX1 in the virtual machine MV, in the memory space EM1 allocated in step E030.
  • FIG. 3 is a flowchart showing additional steps of the generation and installation method according to the invention, these steps being implemented by the hypervisor H, in accordance with a particular embodiment of the invention.
  • the executable code CX0 of the probed function fO can be a pre-existing function in the kernel of the virtual machine MV.
  • this CX0 code can be the code for a disk file reading fO function. This process is implemented by the hypervisor H in figure 1.
  • Figure 4A shows the memory of the virtual machine VM before performing the steps in Figure 3:
  • the code CX0 comprises consecutive INS0 instructions in the function fO;
  • - code CX1 ends with a return instruction RET, the address of this instruction being noted @ RET1.
  • the hypervisor H locates in the memory of the kernel of the virtual machine MV the address @ RET1 of the last return instruction (of the RET or return type) of the code CX1 of the function fl.
  • the term “last return instruction” is understood to mean the return instruction with the largest address.
  • the hypervisor H moves one or more consecutive instructions INS0 located at address @ EM0 from code CX0 to address @ RET1, thus overwriting the return instruction of function fl.
  • the INS0 instructions of the CX0 code are intended to be executed in place of the RET return instruction of the CX1 code.
  • the INS0 instruction or moved instructions can be stored exactly at the @ RET1 address.
  • one or more NOP type instructions are recorded at the address @ RET1 and the displaced INS0 instructions are recorded after these NOP instructions.
  • NOP in English No Operation
  • the hypervisor H records in the memory of the kernel of the virtual machine MV, just after the displaced INS0 instructions, a branch instruction JMP @ EM0 + at the address @ EM0 + which followed the address @ EM0 of the INS0 instructions in the CX0 code before they are moved.
  • the hypervisor H replaces, in the code CX0, the instruction (s) INS0 by a JMP @ EM1 instruction for branching to the address @ EM1 at the start of the memory space EM1 where the code is recorded CX1.
  • the CX1 code of the fl function installed by the hypervisor, is executed before the execution of the CX0 code of the fO function.
  • FIG. 4B illustrates the content of the memory of the virtual machine MV following the implementation by the hypervisor H of the installation method described with reference to FIGS. 1 to 4A.
  • the processor of the device CMP executes the instruction JMP @ EM1 and connects to the start of the executable code of the function fl (phase 2).
  • the processor executes, during phase 3, the CX1 code of the fl function except the return instruction RET, overwritten, then the displaced INS0 instructions, then it connects to the address @ EM0 + (phase 5); it executes the end of the CX0 code (phase 6).
  • the invention thus makes it possible to enrich the code CX0 by the code CX1 of the function fl.
  • the hypervisor H reserves space not only for the executable code CX1, but also for the branch instruction JMP @ EM0 +.
  • the hypervisor H moves one or more consecutive instructions INS0 located at the address @ EM0 of the code CX0 before the code CX1, in other words at an address @ EM1- preceding the memory space EM1.
  • the hypervisor registers, at the address @ RET1 of the last return instruction of the code CX1, a branch instruction JMP @ EM0 + at the address @ EM0 + which followed the address @ EM0 INS0 instructions in the CX0 code before they are moved.
  • the hypervisor then replaces in the code CX0, the instruction (s) moved INS0 by a branch instruction at the address @ EM1- preceding the memory space EM1 of the first code CX1, in other words at the address where the instructions were displaced.
  • This example is particularly interesting when we want to probe the return of a function from a calling function.
  • one or more NOP-type instructions are stored at the @ RET1 address, and the H hypervisor stores the JMP @ EM0 + instruction in the kernel memory of the VM virtual machine, just after the CX1 code.
  • FIG. 5 is a flowchart showing additional steps of the generation and installation method according to the invention, implemented by the hypervisor H according to another embodiment of the invention.
  • the additional steps are intended to enable the CX1 executable code to be called by CX0 executable code installed in the kernel memory of the virtual machine, using additional AGR memory space, known as aggregation.
  • the hypervisor H initializes the aggregation memory AGR, for example by allocating a memory page to it and filling it with null instructions of the NOP type.
  • the hypervisor H moves, at the end of the aggregation space
  • the hypervisor H records at the start of the aggregation space AGR, a branch instruction JMP @ EM1 to the address of the memory space EM1 of the code CX1.
  • the hypervisor H replaces at the address @ RET1 a last return instruction of the code CX1 by a branch instruction JMP @ AGR + at an address @ AGR + in the consecutive AGR aggregation memory space to that of the JMP @ EM1 branch instruction.
  • the hypervisor H replaces in the code CX0, the displaced instruction (s) INS0 by a JMP @AGR instruction for branching to the address of the aggregation memory AGR.
  • FIG. 6A illustrates the memory of the virtual machine MV following the implementation by the hypervisor H of the installation method according to the mode described with reference to FIG. 5.
  • Figure 6A shows memory spaces in which the CX0 code, CX1 code, and AGR aggregation space are stored.
  • the displaced INS0 instructions are replaced by the JMP @AGR instruction for branching to the AGR aggregation space.
  • the processor connects to the start of the aggregation memory AGR, and executes the first instructions of the AGR aggregation space. This connection is illustrated by phase 2 of FIG. 6A.
  • the processor then plugs in at the start of the CX1 code (phase 3) and begins executing this CX1 code (phase 4).
  • the processor then connects to the @ AGR + address of the aggregation memory (phase 5).
  • the processor then executes NOP instructions (phase 6) then the displaced instructions INS0.
  • the processor connects to the address @ EM0 + of the CX0 code (phase 7) and then ends the execution of the CX0 code of the fO function (phase 8).
  • the hypervisor H moves to the start of (or before) the aggregation memory space AGR one or more INS0 instructions of the CX0 code. Then it records, after the INS0 instruction of the aggregation memory space, a first JMP @ EM1 instruction for branching into the memory space of the CX1 function, and records at the end of the aggregation memory space AGR a JMP @ EM0 + instruction for branching at the address @ EM0 + which followed the INS0 instructions in the CX0 code before they were moved.
  • the hypervisor H replaces the last return instruction of code CX1 by a branch instruction at an @ AGR + address immediately following that of the first branch instruction.
  • the hypervisor H replaces, in the code CX0, the displaced instruction (s) INS0 by a JMP @ INS0 instruction for branching to the displaced instruction (s) INS0, after their displacement.
  • This exemplary embodiment is particularly interesting when we want to probe the return of a function from a calling function.
  • the JMP @ EM0 + branch instruction is placed at the end of the AGR aggregation space, separated from the first JMP @ EM1 instruction by empty NOP-type instructions.
  • these intermediate NOP instructions can be replaced by instructions for branching into other additional codes to enrich the CX0 code by these additional codes in addition to the CX1 code, as described below with reference to FIG. 7.
  • the JMP @ EM0 + branch instruction can follow the first JMP @ EM1 instruction directly.
  • FIG. 7 is a flowchart showing the different steps of a method for generating and installing, in the kernel K of a virtual machine MV, at least one additional executable code CX2, in accordance with an embodiment of the 'invention. This process is implemented by the H.
  • the following steps are intended to install another CX2 executable code into the K kernel memory and be able to run it from the CX0 code, after executing the CX1 code, using AGR aggregation memory.
  • the hypervisor H records, in the aggregation memory AGR, after the JMP @ EM1 instruction for branching to the memory space occupied by the code CX1, a JMP @ EM2 instruction for branching to the memory space EM2 occupied by the code CX2.
  • the hypervisor H replaces a code return instruction CX2 by a branch instruction JMP @ AGR ++ at an address of the aggregation memory AGR consecutive to that of the branch instruction JMP @ EM2 to the EM2 memory space.
  • the invention thus makes it possible to enrich the code CX0 with the executable codes CX1 and CX2.
  • FIG. 8 illustrates an architecture for organizing the memory in the virtual machine MV following the implementation by the hypervisor H of the installation method according to the mode described with reference to FIG. 7.
  • the displaced instructions INS0 comprise one or more branch instructions, for example JMP, CALL, etc.
  • Such instructions include a memory displacement ("offset") to reference the destination of the branch.
  • the INS0 instructions, stored at address 0100 are 50 bytes long, have a branch instruction with an 80-byte offset (JMP OFF 80) pointing to address 0180.
  • the destination of the branches is no longer the same as that initially intended. Indeed, due to the movement of the INS0 instructions, the destination of the branches changes, since it is calculated according to the address of the branch instruction.
  • a branch instruction included in the moved INS0 instructions is changed to point to the added branch instruction ILI, which points to the initial @CIB (0180) intended for before the INS0 instructions were moved.
  • the JMP OFF 80 branch instruction moved to address 300 is modified by an instruction of the same JMP OFF 50 type pointing to address 0350 where the ILI unconditional branch instruction is recorded.
  • the unconditional branching instructions (JMP OFF -170) are added after the JMP branching instruction EM0 + when the displaced instructions INS0 are found after the executable code CX1 or after l AGR aggregator memory space.
  • the INSOR instruction is of the conditional branch instruction type and if the corresponding conditions are not verified, the rest of the execution remains valid because the branch indicated in the INSOR instruction will not be carried out and l
  • the JMP EM0 + branch instruction allows the virtual machine MV to execute the rest of the first CX0 code.
  • the branching instructions are added before the displaced INS0 instructions when the latter are located before the CX1 executable code or before the AGR aggregator memory space.
  • the methods of the present invention have been experienced by implementation on VM virtual machines which use the operating system Linux, Debian version 7, and / or Windows, version 7 (registered trademarks). Other versions of these systems are possible. In addition, other operating systems are possible, such as FreeBSD, NetBSD, and OpenBSD (registered trademarks).
  • the installation device CMP has the architecture of a computer, as illustrated in FIG. 10. It comprises in particular a processor 7, a random access memory 8, a read only memory 9, a non-volatile flash memory 10 in a particular embodiment of the invention, as well as communication means 11. Such means are known per se and are not described in more detail here.
  • the read-only memory 9 of the CMP device according to the invention constitutes a recording medium according to the invention, readable by the processor 7 and on which the hypervisor H according to the invention is recorded.
  • the CMP device memory 10 is used to store variables used for performing the steps of the methods of the invention, such as CFG_MV configuration data, CS source code, etc.
  • the hypervisor H defines functional and software modules, configured to install an executable code in a kernel K of a virtual machine MV. These functional modules are based on and / or control the hardware elements 7-11 of the CMP device mentioned above.
  • the hypervisor H implements the invention.
  • certain steps of the invention can be implemented in external software, ie external to the hypervisor, and others implemented by the hypervisor.
  • the generation of the executable code from the source code and configuration data can be implemented by the external software and the installation of the executable code in the memory of the virtual machine can be implemented by the hypervisor. .

Abstract

This method for generating and installing an executable code (CX1) of at least a first function (f1) in the memory of a core (K) of a virtual machine (MV) is implemented by a hypervisor (H), and comprises the steps of: - obtaining (E001) a source code (CS1) comprising at least the first function (f1); - obtaining (E010) configuration data (CFG_MV) of the virtual machine, the configuration data including at least one address (@F, @D) in a memory of the core of the virtual machine (MV) of a function or of data referenced by the source code (CS1); - obtaining (E020) a code that can be executed by compiling (CS1) the source code (CS1) using the configuration data (CFG_MV); - calling (E030) a memory allocation function (malloc_MV) of the virtual machine, in order to reserve a space (EM1) in the memory of the core of the virtual machine (MV) for an executable code (CX1) corresponding to said object code; - obtaining the executable code (CX1) by assembling the object code using the configuration data (CFG_MV) and a result (@EM1) of the call (E030) to the memory allocation function; and - recording (E040) the executable code (CX1) in the memory space (EM).

Description

Procédé et dispositif mettant en œuvre ce procédé pour générer et installer un code exécutable dans la mémoire d’un noyau d’une machine virtuelle depuis un hyperviseur Method and device implementing this method to generate and install executable code in the memory of a kernel of a virtual machine from a hypervisor
L’invention se rapporte au domaine général des logiciels informatiques. Elle concerne plus particulièrement la gestion des fonctions exécutées par une machine virtuelle. The invention relates to the general field of computer software. It relates more particularly to the management of functions executed by a virtual machine.
Dans le contexte actuel, l’utilisation de machines virtuelles est très répandue pour mutualiser et optimiser l’utilisation de ressources physiques d’un serveur, pour isoler des logiciels et augmenter la sécurité de leur utilisation, et pour s'abstraire des caractéristiques des machines physiques sur lesquelles les machines virtuelles sont exécutées. In the current context, the use of virtual machines is very widespread to pool and optimize the use of physical resources of a server, to isolate software and increase the security of their use, and to abstract from the characteristics of the machines. on which the virtual machines run.
Il est connu d’utiliser un hyperviseur pour instancier et gérer une ou plusieurs machines virtuelles sur une même machine physique. It is known to use a hypervisor to instantiate and manage one or more virtual machines on the same physical machine.
Mais l’état actuel de la technique n’offre pas de solution satisfaisante pour surveiller les fonctions qui s’exécutent dans la mémoire du noyau d’une machine virtuelle. En effet, les techniques existantes actuelles sont exclusivement « in-VM » : la technique de sondage ou « probing » nécessite d’injecter un code dans une machine virtuelle depuis celle-ci ; cela nécessite un accès administrateur à la machine virtuelle. Une autre technique d’observation existante consiste à positionner des points d’observation dans une machine virtuelle. Cependant, lors de l’observation, la machine virtuelle est arrêtée, ce qui impacte les performances de la machine virtuelle. But the current state of the art does not provide a satisfactory solution for monitoring the functions that run in the kernel memory of a virtual machine. Indeed, the current existing techniques are exclusively "in-VM": the probing technique or "probing" requires injecting code into a virtual machine from it; this requires administrator access to the virtual machine. Another existing observation technique is to position observation points in a virtual machine. However, during observation, the virtual machine is stopped, which impacts the performance of the virtual machine.
Exposé de l’invention Disclosure of the invention
L’invention vise un procédé de génération et d’installation d’un code exécutable d’au moins une première fonction dans la mémoire d’un noyau d’une machine virtuelle, ce procédé étant mis en œuvre par un hyperviseur et comprenant des étapes de : The invention relates to a method for generating and installing an executable code of at least a first function in the memory of a kernel of a virtual machine, this method being implemented by a hypervisor and comprising steps from:
- obtention d’un code source comprenant au moins la première fonction ; - obtaining a source code comprising at least the first function;
- obtention de données de configuration de la machine virtuelle, ces données de configuration comportant au moins une adresse dans une mémoire du noyau de la machine virtuelle, d’une fonction ou de données référencées par le code source ; - Obtaining virtual machine configuration data, this configuration data comprising at least one address in a memory of the kernel of the virtual machine, a function or data referenced by the source code;
- obtention d’un code objet par compilation du code source en utilisant les données de configuration; - obtaining an object code by compiling the source code using the configuration data;
- appel d’une fonction d’allocation de mémoire de la machine virtuelle, pour réserver un espace dans la mémoire du noyau de la machine virtuelle pour un code exécutable correspondant au code objet ; - obtention d’un code exécutable par assemblage et édition de liens du code objet en utilisant les données de configuration et un résultat de l’appel de la fonction d’allocation de mémoire ; et calling a memory allocation function of the virtual machine, to reserve a space in the memory of the kernel of the virtual machine for an executable code corresponding to the object code; - Obtaining an executable code by assembling and editing links of the object code using the configuration data and a result of the call of the memory allocation function; and
- enregistrement du code exécutable dans ledit espace mémoire. - recording of the executable code in said memory space.
Corrélativement, l'invention vise un dispositif de génération et d’installation d’un code exécutable d’au moins une première fonction dans une mémoire d’un noyau d’une machine virtuelle, ce dispositif comportant la machine virtuelle et un hyperviseur, ledit hyperviseur comportant un module apte à mettre en œuvre un procédé de génération et d’installation selon l’invention. Correspondingly, the invention is aimed at a device for generating and installing an executable code of at least a first function in a memory of a kernel of a virtual machine, this device comprising the virtual machine and a hypervisor, said device. hypervisor comprising a module capable of implementing a generation and installation method according to the invention.
Le code exécutable ainsi obtenu sera parfois appelé « premier code exécutable ». The executable code thus obtained will sometimes be called “first executable code”.
Les caractéristiques et avantages du procédé d’installation selon l’invention présentés ci-après s’appliquent de la même façon au dispositif d’installation selon l’invention, et vice versa. The characteristics and advantages of the installation method according to the invention presented below apply in the same way to the installation device according to the invention, and vice versa.
Dans la description, lorsqu’on dira qu’une instruction A est suivie par une instruction B, ou qu’une instruction B est consécutive à une instruction A, cela signifie soit que l’instruction A est suivie directement par l’instruction B, soit que les instructions A et B sont séparées par des instructions vides de type NOP (pour « No OPeration » en anglais). In the description, when we say that an instruction A is followed by an instruction B, or that an instruction B is consecutive to an instruction A, this means either that the instruction A is followed directly by the instruction B, or that the instructions A and B are separated by empty instructions of the NOP type (for "No OPeration" in English).
Ainsi, et d’une façon générale, l’invention propose en premier lieu une solution pour générer et installer depuis un hyperviseur un code exécutable dans la mémoire du noyau d’une machine virtuelle. Thus, and in general, the invention first of all provides a solution for generating and installing from a hypervisor executable code in the memory of the kernel of a virtual machine.
L’invention étant mise en œuvre par l'hyperviseur, celui-ci peut surveiller les fonctions qui s’exécutent dans la machine virtuelle et installer le nouveau code exécutable dans la mémoire du noyau sans arrêter la machine virtuelle. Since the invention is implemented by the hypervisor, the hypervisor can monitor the functions running in the virtual machine and install the new executable code into kernel memory without shutting down the virtual machine.
Grâce à la prise en compte des données de configuration, le code exécutable obtenu est spécifique à la machine virtuelle. Lorsque l’hyperviseur instancie plusieurs machines virtuelles, il peut générer et installer pour chacune de ces machines virtuelles, un code exécutable spécifique, généré à partir du même code source. Ainsi le sondage ou « probing » d’une machine virtuelle devient un mécanisme à la demande (« on-demand ») et à la volée (« on-the- fly »), indépendant de ce qui existe dans la machine virtuelle initialement, c’est-à-dire au moment de son développement ou/et de son instanciation initiale. Le sondage se fait depuis l’hyperviseur, et non plus depuis la machine virtuelle au moyen d’un compte administrateur. By taking into account the configuration data, the executable code obtained is specific to the virtual machine. When the hypervisor instantiates multiple virtual machines, it can generate and install for each of these virtual machines a specific executable code, generated from the same source code. Thus the poll or “probing” of a virtual machine becomes an on-demand (“on-demand”) and on-the-fly (“on-the-fly”) mechanism, independent of what exists in the virtual machine initially, that is to say at the time of its development or / and its initial instantiation. The survey is done from the hypervisor, and no longer from the virtual machine using an administrator account.
Conformément à l’invention, l’hyperviseur peut être de type natif (installé directement sur une machine physique), ou de type hôte (installé sur un système d’exploitation donné, qui est lui-même installé sur une machine physique). Le mécanisme de l’invention peut être utilisé sur n’importe quel système d’exploitation et sur n’importe quel type de machine virtuelle : machine virtuelle « classique » ou machine virtuelle contenant un container ou un uni kernel. Pour mémoire, un uni kernel est un petit noyau dans lequel est intégrée une seule application. Un tel mécanisme de sondage sur un unikernel permet ainsi de sonder des fonctions minimalistes, telles des fonctions réseau. According to the invention, the hypervisor can be of the native type (installed directly on a physical machine), or of the host type (installed on a given operating system, which is itself installed on a physical machine). The mechanism of the invention can be used on any operating system and on any type of virtual machine: "classic" virtual machine or virtual machine containing a container or a uni kernel. For the record, a uni kernel is a small kernel in which a single application is integrated. Such a probing mechanism on a unikernel thus makes it possible to probe minimalist functions, such as network functions.
Dans un mode de réalisation de l’invention, le procédé de génération et d’installation d’un code exécutable d’au moins une première fonction comporte en outre des étapes de : In one embodiment of the invention, the method of generating and installing an executable code of at least a first function further comprises the steps of:
- obtention de l’adresse d’une dernière instruction de retour du premier code exécutable ; - obtaining the address of a last return instruction of the first executable code;
- déplacement à cette adresse d’au moins une instruction d’un deuxième code exécutable installé dans la mémoire du noyau de la machine virtuelle ; - moving to this address at least one instruction of a second executable code installed in the memory of the kernel of the virtual machine;
- enregistrement dans une adresse de cette mémoire, après l’instruction déplacée, d’une instruction de branchement à une adresse consécutive à l’adresse de ces instructions déplacées dans le deuxième code avant leur déplacement ; et - recording in an address of this memory, after the moved instruction, a branch instruction at a consecutive address to the address of these instructions moved in the second code before their movement; and
- remplacement dans le deuxième code, de l’instruction déplacée par une instruction de branchement à l’espace mémoire du premier code exécutable. - replacement in the second code, of the instruction moved by a branch instruction to the memory space of the first executable code.
L’invention permet ainsi d’enrichir le deuxième code exécutable par le premier code exécutable. Lorsque le processeur du dispositif d’installation selon l’invention exécute le deuxième code, il est redirigé pour exécuter le premier code, puis exécute ensuite la fin du deuxième code. The invention thus makes it possible to enrich the second executable code with the first executable code. When the processor of the installation device according to the invention executes the second code, it is redirected to execute the first code, and then executes the end of the second code.
Le procédé étant mis en œuvre par l’hyperviseur, celui-ci peut contrôler que la fonction à enrichir ne s’exécute pas pour modifier son code exécutable comme mentionné ci-avant pour permettre son enrichissement. L’invention permet ainsi d’enrichir une fonction s’exécutant dans le noyau d’une machine virtuelle sans interrompre cette machine virtuelle. Since the method is implemented by the hypervisor, the latter can check that the function to be enriched is not executed to modify its executable code as mentioned above to allow its enrichment. The invention thus makes it possible to enrich a function running in the kernel of a virtual machine without interrupting this virtual machine.
A titre d’exemple, le premier code peut mettre en œuvre un sondage pour effectuer des statistiques sur l’utilisation du deuxième code. For example, the first code can implement a survey to perform statistics on the use of the second code.
Alternativement, le premier code peut correspondre à une fonction de gestion d’autorisations pour augmenter la sécurité de l’utilisation du deuxième code. Alternatively, the first code can correspond to an authorization management function to increase the security of the use of the second code.
En choisissant l’instruction déplacée, il est possible de modifier le moment de la redirection de l’exécution du deuxième code vers l'exécution du premier code. By choosing the moved instruction, it is possible to change the timing of the redirection from the execution of the second code to the execution of the first code.
Il est à noter que les étapes de déplacement et d’enregistrement peuvent être mises en œuvre simultanément, ou l’une après l’autre, sans contrainte sur l’ordre de leurs mises en œuvre. Note that the moving and recording steps can be performed simultaneously, or one after the other, without constraint on the order of their implementation.
Nous rappelons qu’une instruction de branchement, appelée aussi instruction de renvoi, ou de saut (instruction « jump » en anglais) est une instruction qui permet lorsqu'elle est exécutée, un renvoi sans retour, vers une adresse mémoire comportant une instruction à exécuter. We recall that a branch instruction, also called a return instruction, or a jump instruction is an instruction which allows when it is executed, a return without return, to a memory address comprising an instruction to be executed.
Dans un autre mode de réalisation, le procédé selon l’invention comporte en outre des étapes de : In another embodiment, the method according to the invention further comprises steps of:
- déplacement, à une adresse précédant l’espace mémoire du premier code exécutable, d’au moins une instruction d’un deuxième code exécutable installé dans la mémoire du noyau de la machine virtuelle ; - displacement, to an address preceding the memory space of the first executable code, of at least one instruction of a second executable code installed in the memory of the kernel of the virtual machine;
- enregistrement à une adresse d’une dernière instruction de retour du premier code exécutable, d’une instruction de branchement à une adresse consécutive à l’adresse des instructions dans le deuxième code exécutable avant leur déplacement ; et - recording at an address of a last return instruction of the first executable code, of a branch instruction at a consecutive address to the address of the instructions in the second executable code before their movement; and
- remplacement, dans le deuxième code exécutable, de l’instruction déplacée, par une instruction de branchement à ladite adresse précédant l’espace mémoire du premier code. - replacement, in the second executable code, of the moved instruction, by a branch instruction at said address preceding the memory space of the first code.
Dans un autre mode de réalisation de l’invention, un espace d’agrégation est utilisé pour installer le premier code exécutable. Dans ce mode, le procédé comporte en outre des étapes de : In another embodiment of the invention, an aggregation space is used to install the first executable code. In this mode, the method further comprises steps of:
- déplacement dans un espace mémoire dit d’agrégation, d’une instruction d’un deuxième code exécutable installé dans une mémoire du noyau de la machine virtuelle, cette instruction étant suivie par une instruction de branchement à une adresse qui suivait ces instructions dans le deuxième code avant leur déplacement ; - displacement in a memory space called aggregation, of an instruction of a second executable code installed in a memory of the kernel of the virtual machine, this instruction being followed by a branch instruction to an address which followed these instructions in the second code before their displacement;
- enregistrement dans l’espace mémoire d’agrégation avant l’instruction déplacée, d’une première instruction de branchement audit espace mémoire du premier code exécutable, l’instruction du deuxième code exécutable étant déplacée vers la fin ou le début de l’espace d’agrégation de sorte à laisser de l’espace pour enregistrer la première instruction de branchement à l’espace mémoire du premier code, et à réserver de l’espace pour d’autres instructions de branchement à des espaces mémoire de codes exécutables supplémentaires, pour enrichir le deuxième code avec ces codes supplémentaires ; - recording in the aggregation memory space before the instruction moved, of a first instruction for branching to said memory space of the first executable code, the instruction of the second executable code being moved to the end or the start of the space aggregation so as to leave space for recording the first branching instruction in the memory space of the first code, and to reserve space for other branching instructions in additional executable code memory spaces, to enrich the second code with these additional codes;
- remplacement d’une dernière instruction de retour du premier code par une deuxième instruction de branchement à une adresse dans l’espace mémoire d’agrégation, consécutive à celle de la première instruction de branchement ; et - replacement of a last return instruction of the first code by a second branch instruction at an address in the aggregation memory space, consecutive to that of the first branch instruction; and
- remplacement dans le deuxième code, de l’instruction déplacée par une instruction de branchement à l’espace mémoire d’agrégation. - replacement in the second code, of the instruction moved by a branch instruction to the aggregation memory space.
L’ordre des étapes d’enregistrement et de remplacement n’est pas limitatif. The order of the recording and replacement steps is not exhaustive.
Ce mode de réalisation permet d’organiser la mémoire du noyau de la machine virtuelle de sorte à pouvoir faire, à partir du deuxième code, un ou plusieurs renvois vers un ou plusieurs autres codes exécutables, en insérant des instructions de branchement dans l’espace mémoire d’agrégation. Conformément à ce mode de réalisation, l’instruction du deuxième code est déplacée dans l’espace d’agrégation, de préférence vers sa fin de sorte à laisser de l’espace pour enregistrer la première instruction de branchement à l’espace mémoire du premier code, et éventuellement enregistrer d’autres instructions de branchement à des espaces mémoire de codes exécutables supplémentaires, pour enrichir le deuxième code en outre avec ces codes supplémentaires. This embodiment makes it possible to organize the memory of the kernel of the virtual machine so as to be able to make, from the second code, one or more references to one or more other executable codes, by inserting branching instructions in space. aggregation memory. In accordance with this embodiment, the instruction of the second code is moved into the aggregation space, preferably towards its end so as to leave space for recording the first branch instruction in the memory space of the first. code, and possibly record other branching instructions to additional executable code memory spaces, to further enrich the second code with these additional codes.
Dans un mode de réalisation, le procédé selon l’invention comporte en outre des étapes de : In one embodiment, the method according to the invention further comprises steps of:
- déplacement dans un espace mémoire dit d’agrégation, d’au moins une instruction d’un deuxième code exécutable installé dans une mémoire du noyau ladite machine virtuelle ; - displacement in a memory space called aggregation, of at least one instruction of a second executable code installed in a kernel memory of said virtual machine;
- enregistrement dans l’espace mémoire d’agrégation, d’une première instruction de branchement à l’espace mémoire du premier code, suivie par une instruction de branchement à une adresse qui suivait lesdites instructions dans le deuxième code avant leur déplacement, l’instruction du deuxième code exécutable étant déplacée vers la fin ou le début de l’espace d’agrégation de sorte à laisser de l’espace pour enregistrer la première instruction de branchement à l’espace mémoire du premier code, et à réserver de l’espace pour d’autres instructions de branchement à des espaces mémoire de codes exécutables supplémentaires, pour enrichir le deuxième code avec ces codes supplémentaires ; - recording in the aggregation memory space, of a first instruction for branching into the memory space of the first code, followed by a branching instruction at an address which followed said instructions in the second code before their displacement, the instruction of the second executable code being moved to the end or the beginning of the aggregation space so as to leave space to record the first branch instruction to the memory space of the first code, and to reserve some space for other branching instructions to additional executable code memory spaces, to enrich the second code with these additional codes;
- remplacement d’une dernière instruction de retour du premier code par une deuxième instruction de branchement à une adresse dans l’espace mémoire d’agrégation, immédiatement consécutive à celle de ladite première instruction de branchement ; et - replacement of a last return instruction of the first code by a second branch instruction at an address in the aggregation memory space, immediately following that of said first branch instruction; and
- remplacement dans le deuxième code, de ladite au moins une instruction déplacée par une instruction de branchement à l’adresse de l’instruction déplacée dans l’espace d’agrégation. - replacement in the second code, of said at least one instruction moved by a branch instruction to the address of the instruction moved in the aggregation space.
Conformément à ce mode de réalisation, l’instruction du deuxième code est déplacée dans l’espace d’agrégation, de préférence à son début de sorte à laisser de l’espace pour enregistrer la première instruction de branchement à l’espace mémoire du premier code, et éventuellement enregistrer d’autres instructions de branchement à des espaces mémoire de codes exécutables supplémentaires, pour enrichir le deuxième code en outre avec ces codes supplémentaires. In accordance with this embodiment, the instruction of the second code is moved in the aggregation space, preferably at its start so as to leave space for recording the first branch instruction in the memory space of the first. code, and possibly record other branching instructions to additional executable code memory spaces, to further enrich the second code with these additional codes.
Dans un mode de réalisation de l’invention, l’étape d’appel de la fonction d’allocation de mémoire prend en considération la taille d’une dite instruction de branchement en plus de la taille du premier code. Ainsi, une marge est prévue pour cette instruction dans l’espace mémoire du premier code exécutable. Dans un mode de réalisation dans lequel ladite au moins une instruction déplacée comporte au moins une instruction d’origine de branchement ou d’appel avec un décalage d’adresse vers une adresse cible, ledit procédé selon l’invention comportant des étapes de : In one embodiment of the invention, the step of calling the memory allocation function takes into consideration the size of a said branch instruction in addition to the size of the first code. Thus, a margin is provided for this instruction in the memory space of the first executable code. In one embodiment in which said at least one moved instruction comprises at least one original branch or call instruction with an address shift towards a target address, said method according to the invention comprising steps of:
- enregistrement, dans une zone atteignable par une instruction du type de l’instruction d’origine (branchement court, branchement long, appel court, appel long, branchement inconditionnel ou conditionnel,...) dans la mémoire du noyau de la machine virtuelle, d’une instruction de branchement long inconditionnel à l’adresse cible ; et - recording, in an area reachable by an instruction of the type of the original instruction (short branch, long branch, short call, long call, unconditional or conditional branch, ...) in the kernel memory of the virtual machine , an unconditional long branch instruction at the target address; and
- modification de l’instruction d’origine par une instruction modifiée de même type pointant vers cette instruction de branchement long inconditionnel. - modification of the original instruction by a modified instruction of the same type pointing to this unconditional long branch instruction.
Ainsi, le pointage vers l'adresse cible est maintenu même en mettant en œuvre l'étape de déplacement de la ou les instructions du deuxième code. Ce mode de réalisation permet de mettre en place un mécanisme de sondage optimisé. Thus, the pointing to the target address is maintained even by implementing the step of moving the instruction (s) of the second code. This embodiment makes it possible to set up an optimized probing mechanism.
Dans un mode particulier de mise en œuvre, le procédé selon l’invention permet l’installation d’au moins un code exécutable supplémentaire dans la mémoire du noyau de la machine virtuelle. Il comporte des étapes de : In a particular embodiment, the method according to the invention allows the installation of at least one additional executable code in the memory of the kernel of the virtual machine. It includes stages of:
- enregistrement dans l’espace mémoire d’agrégation, après l’instruction de branchement à l’espace mémoire du premier code exécutable, d’une troisième instruction de branchement à un espace mémoire du code exécutable supplémentaire ; et - recording in the aggregation memory space, after the instruction to branch to the memory space of the first executable code, of a third instruction to branch to a memory space of the additional executable code; and
- remplacement d’une instruction de retour du code supplémentaire par une instruction de branchement à une adresse dans l’espace mémoire d’agrégation, consécutive à celle de ladite troisième instruction de branchement. - replacement of an additional code return instruction by a branch instruction at an address in the aggregation memory space, consecutive to that of said third branch instruction.
Le deuxième code peut ainsi être enrichi par le premier code exécutable, et par le code exécutable supplémentaire. L’invention permet d’enrichir un code par autant d’autres codes exécutables. The second code can thus be enriched by the first executable code, and by the additional executable code. The invention makes it possible to enrich a code with as many other executable codes.
L’invention vise également un programme d’ordinateur sur un support d’enregistrement, ce programme étant susceptible d’être mis en œuvre dans un ordinateur ou dans un dispositif de génération et d’installation conforme à l’invention, ce programme comportant des instructions adaptées à la mise en œuvre d’un procédé de génération et d’installation tel que décrit ci-dessus. The invention also relates to a computer program on a recording medium, this program being capable of being implemented in a computer or in a generation and installation device in accordance with the invention, this program comprising instructions adapted to the implementation of a generation and installation method as described above.
Ce programme peut utiliser n’importe quel langage de programmation, et être sous la forme de code machine, code source, code objet, ou de code intermédiaire entre code source et code objet, tel que dans une forme partiellement compilée, ou dans n’importe quelle autre forme souhaitable. This program can use any programming language, and be in the form of machine code, source code, object code, or code intermediate between source code and object code, such as in a partially compiled form, or in n ' any other desirable shape.
En particulier, ce programme peut être en langage Java, supporté par l’hyperviseur selon l’invention. En particulier, ce programme peut être exécuté par un microcontrôleur pC (« micro- Controller » en anglais). In particular, this program can be in Java language, supported by the hypervisor according to the invention. In particular, this program can be executed by a microcontroller pC (“microcontroller” in English).
L’invention vise aussi des supports d'information ou d’enregistrement lisibles par un ordinateur, et comportant des instructions du programme d'ordinateur tel que mentionné ci- dessus. The invention also relates to information or recording media readable by a computer, and comprising instructions of the computer program as mentioned above.
Les supports d'information ou d’enregistrement peuvent être n'importe quelle entité ou dispositif capable de stocker les programmes. Par exemple, les supports peuvent comporter un moyen de stockage, tel qu'une ROM, par exemple un CD ROM ou une ROM de circuit microélectronique, ou encore un moyen d'enregistrement magnétique, par exemple une disquette (floppy disk) ou un disque dur, ou une mémoire flash. Information or recording media can be any entity or device capable of storing programs. For example, the media can include a storage means, such as a ROM, for example a CD ROM or a microelectronic circuit ROM, or else a magnetic recording means, for example a floppy disk or a disk. hard, or flash memory.
D'autre part, les supports d'information ou d’enregistrement peuvent être des supports transmissibles tels qu'un signal électrique ou optique, qui peut être acheminé via un câble électrique ou optique, par lien radio, par lien optique sans fil ou par d'autres moyens. On the other hand, the information or recording media can be transmissible media such as an electrical or optical signal, which can be routed via an electrical or optical cable, by radio link, by wireless optical link or by other ways.
Le programme selon l'invention peut être en particulier téléchargé sur un réseau de type Internet. The program according to the invention can in particular be downloaded from an Internet type network.
Alternativement, chaque support d'informations ou d’enregistrement peut être un circuit intégré dans lequel le programme est incorporé, le circuit étant adapté pour exécuter ou pour être utilisé dans l'exécution du procédé de génération et d’installation selon l’invention. Alternatively, each information or recording medium can be an integrated circuit in which the program is incorporated, the circuit being adapted to execute or to be used in the execution of the generation and installation method according to the invention.
Brève description des dessins Brief description of the drawings
D’autres caractéristiques et avantages de la présente invention ressortiront de la description faite ci-dessous, en référence aux dessins annexés qui en illustrent un exemple de réalisation dépourvu de tout caractère limitatif. Sur les figures : la figure 1 illustre une architecture fonctionnelle d'un dispositif de génération et d'installation d’un code exécutable conforme à l'invention, selon un mode de réalisation de l'invention ; la figure 2 est un organigramme représentant des étapes d’un procédé de génération et d'installation d’un code exécutable conforme à l'invention, mis en œuvre selon un mode de réalisation ; la figure 3 est un organigramme représentant des étapes supplémentaires d’un procédé de génération et d'installation d’un code exécutable conforme à l'invention, mis en œuvre selon un premier mode de réalisation de l’invention ; la figure 4 A illustre une architecture de l'organisation de la mémoire d'une machine virtuelle avant la mise en œuvre du procédé de génération et d'installation d’un code exécutable conforme à l'invention, selon le mode de réalisation de la figure 3 ; la figure 4B illustre une architecture de l'organisation de la mémoire d'une machine virtuelle suite à la mise en œuvre du procédé de génération et d'installation d’un code exécutable conforme à l'invention, selon le mode de réalisation de la figure 3 ; la figure 4C illustre une architecture de l'organisation de la mémoire d'une machine virtuelle suite à la mise en œuvre du procédé de génération et d'installation d’un code exécutable conforme à l'invention, selon une variante du mode de réalisation de la figure 3 ; la figure 5 est un organigramme représentant des étapes supplémentaires d’un procédé de génération et d'installation d’un code exécutable conforme à l'invention, mis en œuvre selon un deuxième mode de réalisation de l’invention ; la figure 6 A illustre une architecture de l'organisation de la mémoire d'une machine virtuelle suite à la mise en œuvre du procédé de génération et d'installation d’un code exécutable conforme à l'invention, selon le mode de réalisation de la figure 5 ; la figure 6B illustre une architecture de l'organisation de la mémoire d'une machine virtuelle suite à la mise en œuvre du procédé de génération et d'installation d’un code exécutable conforme à l'invention, selon une variante du mode de réalisation de la figure 5 ; la figure 7 est un organigramme représentant des étapes d’un procédé de génération et d'installation d'un code supplémentaire conforme à l'invention, mis en œuvre selon un mode de réalisation de l’invention ; la figure 8 illustre une architecture de l'organisation de la mémoire d'une machine virtuelle suite à la mise en œuvre du procédé de génération et d'installation conforme à l'invention, selon le mode de réalisation de la figure 7 ; la figure 9 illustre un mode particulier de réalisation de l’invention dans lequel les instructions déplacées comportent des instructions de branchement ou d’appel avec décalage d’ adresse ; et la figure 10 illustre l’architecture matérielle d’un dispositif de génération et d'installation selon un mode de réalisation de l’invention. Other characteristics and advantages of the present invention will emerge from the description given below, with reference to the appended drawings which illustrate an exemplary embodiment thereof without any limiting nature. In the figures: FIG. 1 illustrates a functional architecture of a device for generating and installing an executable code in accordance with the invention, according to one embodiment of the invention; FIG. 2 is a flowchart representing steps of a method for generating and installing an executable code in accordance with the invention, implemented according to one embodiment; FIG. 3 is a flowchart representing additional steps of a method for generating and installing an executable code in accordance with the invention, implemented according to a first embodiment of the invention; FIG. 4A illustrates an architecture of the organization of the memory of a virtual machine before the implementation of the method for generating and installing an executable code in accordance with the invention, according to the embodiment of the figure 3; FIG. 4B illustrates an architecture of the organization of the memory of a virtual machine following the implementation of the method for generating and installing an executable code in accordance with the invention, according to the embodiment of the figure 3; FIG. 4C illustrates an architecture of the organization of the memory of a virtual machine following the implementation of the method for generating and installing an executable code in accordance with the invention, according to a variant of the embodiment of Figure 3; FIG. 5 is a flowchart representing additional steps of a method for generating and installing an executable code in accordance with the invention, implemented according to a second embodiment of the invention; FIG. 6 A illustrates an architecture of the organization of the memory of a virtual machine following the implementation of the method for generating and installing an executable code in accordance with the invention, according to the embodiment of figure 5; FIG. 6B illustrates an architecture of the organization of the memory of a virtual machine following the implementation of the method for generating and installing an executable code in accordance with the invention, according to a variant of the embodiment of Figure 5; FIG. 7 is a flowchart representing steps of a method for generating and installing an additional code in accordance with the invention, implemented according to an embodiment of the invention; FIG. 8 illustrates an architecture of the organization of the memory of a virtual machine following the implementation of the generation and installation method according to the invention, according to the embodiment of FIG. 7; FIG. 9 illustrates a particular embodiment of the invention in which the displaced instructions comprise branch or call instructions with address offset; and FIG. 10 illustrates the hardware architecture of a generation and installation device according to one embodiment of the invention.
Description détaillée des modes de réalisation de l’invention Detailed description of the embodiments of the invention
La figure 1 illustre une architecture fonctionnelle d'un dispositif de génération et d’installation CMP conforme à un mode de réalisation de l'invention. Ce dispositif est configuré pour mettre en œuvre un procédé conforme à l'invention. Figure 1 illustrates a functional architecture of a CMP generation and installation device according to one embodiment of the invention. This device is configured to implement a method in accordance with the invention.
Le dispositif d’installation CMP comporte une machine physique PHY, tel qu’un ordinateur, sur laquelle un hyperviseur H est installé. L’hyperviseur H est adapté pour gérer l’allocation des ressources physiques du serveur entre différentes instances de machines virtuelles et pour pouvoir créer, instancier, libérer et placer des machines virtuelles MV, MV’ et MV”. The installation device CMP comprises a physical machine PHY, such as a computer, on which a hypervisor H is installed. The H hypervisor is suitable for managing the allocation of the physical resources of the server between different instances of machines virtual machines and to be able to create, instantiate, release and place virtual machines MV, MV 'and MV ”.
Les machines virtuelles peuvent utiliser différents systèmes d’exploitation. Chacun des systèmes d’exploitation des machines virtuelles comporte au moins un noyau (en anglais « kernel »). On note par exemple K, le noyau de la machine virtuelle MV, plus précisément du système d’exploitation de la machine virtuelle MV. Virtual machines can use different operating systems. Each of the virtual machine operating systems has at least one kernel. For example, we denote by K, the kernel of the virtual machine MV, more precisely of the operating system of the virtual machine MV.
Plusieurs machines virtuelles peuvent être instanciées par l'hyperviseur H. L’hyperviseur H peut installer des codes exécutables dans une ou plusieurs de ces machines virtuelles, de façon personnalisée pour chacune de ces machines virtuelles. Dans cette description, et pour des raisons de simplification, nous décrivons des modes de réalisation dans lesquels l’hyperviseur H installe un ou plusieurs codes exécutables dans une seule machine virtuelle MV. Several virtual machines can be instantiated by the H hypervisor. The H hypervisor can install executable codes in one or more of these virtual machines, in a personalized way for each of these virtual machines. In this description, and for reasons of simplicity, we describe embodiments in which the hypervisor H installs one or more executable codes in a single virtual machine MV.
La figure 2 est un organigramme représentant les différentes étapes d’un procédé de génération et d’installation d’un code exécutable CX1, appelé habituellement « sonde », d’au moins une fonction fl dans le noyau d’une machine virtuelle, conformément à un mode de réalisation de l'invention. Ce procédé est mis en œuvre par l’hyperviseur H de la figure 1. FIG. 2 is a flowchart representing the different steps of a method for generating and installing an executable code CX1, usually called a “probe”, of at least one function f1 in the kernel of a virtual machine, in accordance with to one embodiment of the invention. This process is implemented by the hypervisor H in figure 1.
Au cours d'une étape E001, l’hyperviseur H obtient le code source CS1 d’une sonde comprenant au moins le code source d’une fonction fl. Ce code CS1 peut comporter plusieurs fonctions et données internes à la sonde, et référencer d’autres fonctions, et/ou données externes à la sonde qui appartiennent donc à la machine virtuelle. During a step E001, the hypervisor H obtains the source code CS1 from a probe comprising at least the source code of a function fl. This CS1 code can include several functions and data internal to the probe, and reference other functions, and / or data external to the probe, which therefore belong to the virtual machine.
L’hyperviseur H est configuré pour installer le code exécutable CX1 de la sonde, obtenu à partir de ce code source CS1, dans le noyau K de la machine virtuelle MV, ce code CX1 étant spécifique à cette machine virtuelle. The H hypervisor is configured to install the CX1 executable code of the probe, obtained from this CS1 source code, in the K kernel of the VM virtual machine, this CX1 code being specific to this virtual machine.
A cet effet, au cours d’une étape E010, l’hyperviseur H obtient des données de configuration CFG_MV de la machine virtuelle MV, ces données de configuration comportant au moins une adresse @F d’une fonction F appelée par le code source CS1 dans la mémoire de la machine virtuelle MV, ou une adresse @D d’une donnée D référencée par le code source CS1 dans la mémoire de la machine virtuelle MV. To this end, during a step E010, the hypervisor H obtains configuration data CFG_MV of the virtual machine MV, these configuration data comprising at least one @F address of a function F called by the source code CS1 in the memory of the virtual machine MV, or an @D address of a data item D referenced by the source code CS1 in the memory of the virtual machine MV.
A titre d’exemple, lorsque le dispositif CMP utilise un système d’exploitation de type Finux, les données de configuration CFG_MV peuvent être comprises dans un fichier de type « system.map », comprenant une liste exhaustive des fonctions du système d’exploitation de la machine virtuelle MV ainsi que, pour chacune de ces fonctions (F), l’adresse mémoire (@F) de l’espace mémoire dans lequel cette fonction est enregistrée. By way of example, when the CMP device uses an operating system of the Finux type, the configuration data CFG_MV can be included in a file of the “system.map” type, comprising an exhaustive list of the functions of the operating system. of the virtual machine MV as well as, for each of these functions (F), the memory address (@F) of the memory space in which this function is recorded.
Fes données de configuration CFG_MV peuvent comprendre une information sur la structure des données enregistrées dans la machine virtuelle MV, par exemple sur la façon dont un descripteur de processus est structuré : identifiant du processus, processus suivant, précédent, etc. The CFG_MV configuration data can include information on the structure of the data recorded in the VM virtual machine, for example on how a process descriptor is structured: process identifier, next process, previous process, etc.
Au cours d’une étape E020, l’hyperviseur H compile le code source CS1 en utilisant les données de configuration CFG_MV pour obtenir un code objet. During a step E020, the hypervisor H compiles the source code CS1 using the configuration data CFG_MV to obtain an object code.
Au cours d’une étape E030, l’hyperviseur H appelle une fonction malloc_MV de la machine virtuelle MV pour allouer un espace mémoire EM1 dans la mémoire du noyau de la machine virtuelle MV au moins suffisant pour accueillir le code exécutable CX1. On note @EM1 l’adresse de début de cet espace mémoire EM1 dans la machine virtuelle VM. During a step E030, the hypervisor H calls a malloc_MV function of the virtual machine MV to allocate a memory space EM1 in the memory of the kernel of the virtual machine MV at least sufficient to accommodate the executable code CX1. We denote @ EM1 the start address of this memory space EM1 in the virtual machine VM.
L’hyperviseur H édite ensuite les liens (en anglais « link ») et assemble le code objet pour obtenir le code exécutable CX1 en utilisant les données de configuration CFG_MV et un résultat de l’appel (E030) à la fonction malloc_MV, notamment l’adresse @EM1 de l’espace EM1. Ainsi, le code exécutable CX1 est spécifique à la machine virtuelle MV ; en effet, l’édition de liens repose sur la configuration de la machine virtuelle MV. The hypervisor H then edits the links (in English "link") and assembles the object code to obtain the executable code CX1 using the configuration data CFG_MV and a result of the call (E030) to the malloc_MV function, in particular l '@ EM1 address of the EM1 space. Thus, the executable code CX1 is specific to the virtual machine MV; in effect, linking relies on the configuration of the VM virtual machine.
Au cours d’une étape E040, l’hyperviseur H enregistre le code exécutable CX1 dans la machine virtuelle MV, dans l’espace mémoire EM1 alloué à l’étape E030. During a step E040, the hypervisor H records the executable code CX1 in the virtual machine MV, in the memory space EM1 allocated in step E030.
La figure 3 est un organigramme représentant des étapes supplémentaires du procédé de génération et d’installation selon l’invention, ces étapes étant mises en œuvre par l’hyperviseur H, conformément à un mode particulier de réalisation de l'invention. FIG. 3 is a flowchart showing additional steps of the generation and installation method according to the invention, these steps being implemented by the hypervisor H, in accordance with a particular embodiment of the invention.
Ces étapes supplémentaires visent à permettre l’appel du code exécutable CX1 de la fonction fl, c’est-à-dire l’appel de la sonde, par un code exécutable CX0 d’une autre fonction fO, ce code exécutable CX0 étant installé dans un espace EM0 de la mémoire du noyau la machine virtuelle MV, conformément à la description faite en relation avec la figure 2. These additional steps aim to allow the call of the executable code CX1 of the function fl, that is to say the call of the probe, by an executable code CX0 of another function fO, this executable code CX0 being installed in a space EM0 of the memory of the kernel the virtual machine MV, in accordance with the description given in relation to FIG. 2.
Le code exécutable CX0 de la fonction sondée fO peut être une fonction préexistante dans le noyau de la machine virtuelle MV. Par exemple, ce code CX0 peut être le code d’une fonction fO de lecture de fichier depuis un disque. Ce procédé est mis en œuvre par l’hyperviseur H de la figure 1. The executable code CX0 of the probed function fO can be a pre-existing function in the kernel of the virtual machine MV. For example, this CX0 code can be the code for a disk file reading fO function. This process is implemented by the hypervisor H in figure 1.
La figure 4 A représente la mémoire de la machine virtuelle VM avant l’exécution des étapes de la figure 3 : Figure 4A shows the memory of the virtual machine VM before performing the steps in Figure 3:
- le code CX0 démarre à l’adresse @EM0 du début de l’espace mémoire EM0 ; - the CX0 code starts at address @ EM0 at the start of the EM0 memory space;
- le code CX0 comporte des instructions INS0 consécutives dans la fonction fO ; - the code CX0 comprises consecutive INS0 instructions in the function fO;
- l’adresse de la mémoire virtuelle suivant ces instructions INS0 est notée @EM0+ ;- the virtual memory address following these INS0 instructions is noted @ EM0 +;
- le code CX1 démarre à l’adresse @EM1 ; - the code CX1 starts at the address @ EM1;
- le code CX1 se termine par une instruction de retour RET, l’adresse de cette instruction étant notée @RET1. Au cours d’une étape E045, l’hyperviseur H repère dans la mémoire du noyau de la machine virtuelle MV l’adresse @RET1 de la dernière instruction de retour (de type RET ou return) du code CX1 de la fonction fl. On entend par dernière instruction de retour, l’instruction de retour dont l’adresse est la plus grande. - code CX1 ends with a return instruction RET, the address of this instruction being noted @ RET1. During a step E045, the hypervisor H locates in the memory of the kernel of the virtual machine MV the address @ RET1 of the last return instruction (of the RET or return type) of the code CX1 of the function fl. The term “last return instruction” is understood to mean the return instruction with the largest address.
Au cours d’une étape E050, l’hyperviseur H déplace une ou plusieurs instructions consécutives INS0 se trouvant à l’adresse @EM0 du code CX0 à l’adresse @RET1, écrasant ainsi l’instruction de retour de la fonction fl. Les instructions INS0 du code CX0 sont destinées à être exécutées à la place de l’instruction de retour RET du code CX1. L’instruction ou les instructions déplacées INS0 peuvent être enregistrées exactement à l’adresse @RET1. En variante, une ou plusieurs instructions de type NOP sont enregistrées à l’adresse @RET1 et les instructions déplacées INS0 sont enregistrées après ces instructions NOP. On rappelle que les instructions NOP (en anglais No Operation) sont des instructions milles qui dictent au processeur de n’effectuer aucune action. During a step E050, the hypervisor H moves one or more consecutive instructions INS0 located at address @ EM0 from code CX0 to address @ RET1, thus overwriting the return instruction of function fl. The INS0 instructions of the CX0 code are intended to be executed in place of the RET return instruction of the CX1 code. The INS0 instruction or moved instructions can be stored exactly at the @ RET1 address. As a variant, one or more NOP type instructions are recorded at the address @ RET1 and the displaced INS0 instructions are recorded after these NOP instructions. Remember that the NOP (in English No Operation) instructions are thousand instructions which dictate to the processor not to take any action.
Au cours d’une étape E060, l’hyperviseur H enregistre dans la mémoire du noyau de la machine virtuelle MV, juste après les instructions INS0 déplacées, une instruction JMP @EM0+ de branchement à l’adresse @EM0+ qui suivait l’adresse @EM0 des instructions INS0 dans le code CX0 avant leur déplacement. During a step E060, the hypervisor H records in the memory of the kernel of the virtual machine MV, just after the displaced INS0 instructions, a branch instruction JMP @ EM0 + at the address @ EM0 + which followed the address @ EM0 of the INS0 instructions in the CX0 code before they are moved.
Au cours d’une étape E070, l’hyperviseur H remplace dans le code CX0, la ou les instructions INS0 par une instruction JMP @EM1 de branchement à l’adresse @EM1 du début de l’espace mémoire EM1 où est enregistré le code CX1. Ainsi le code CX1 de la fonction fl, installé par l’hyperviseur, est exécuté avant l’exécution du code CX0 de la fonction fO. During a step E070, the hypervisor H replaces, in the code CX0, the instruction (s) INS0 by a JMP @ EM1 instruction for branching to the address @ EM1 at the start of the memory space EM1 where the code is recorded CX1. Thus the CX1 code of the fl function, installed by the hypervisor, is executed before the execution of the CX0 code of the fO function.
La figure 4B illustre le contenu de la mémoire de la machine virtuelle MV suite à la mise en œuvre par l’hyperviseur H du procédé d’installation décrit en référence aux figures 1 à 4A. FIG. 4B illustrates the content of the memory of the virtual machine MV following the implementation by the hypervisor H of the installation method described with reference to FIGS. 1 to 4A.
Suite à la mise en œuvre du procédé de l’invention, lorsque la machine virtuelle MV commence à exécuter le code exécutable CX0 de la fonction fO (phase 1 de la figure 4B), le processeur du dispositif CMP exécute l’instruction JMP @EM1 et se branche au début du code exécutable de la fonction fl (phase 2). Following the implementation of the method of the invention, when the virtual machine MV begins to execute the executable code CX0 of the function fO (phase 1 of FIG. 4B), the processor of the device CMP executes the instruction JMP @ EM1 and connects to the start of the executable code of the function fl (phase 2).
Le processeur exécute, au cours d’une phase 3, le code CX1 de la fonction fl sauf l’instruction de retour RET, écrasée, puis les instructions INS0 déplacées, puis il se branche à l’adresse @EM0+ (phase 5) ; il exécute la fin du code CX0 (phase 6). L’invention permet ainsi d’enrichir le code CX0 par le code CX1 de la fonction fl. The processor executes, during phase 3, the CX1 code of the fl function except the return instruction RET, overwritten, then the displaced INS0 instructions, then it connects to the address @ EM0 + (phase 5); it executes the end of the CX0 code (phase 6). The invention thus makes it possible to enrich the code CX0 by the code CX1 of the function fl.
Dans ce mode de réalisation, au cours de l’étape E030 d’appel à la fonction d’allocation de mémoire malloc_MV, l’hyperviseur H réserve de la place non seulement pour le code exécutable CX1, mais aussi pour l'instruction de branchement JMP @EM0+. Dans un autre exemple de ce mode de réalisation représenté à la figure 4C, l’hyperviseur H déplace une ou plusieurs instructions consécutives INS0 se trouvant à l’adresse @EM0 du code CX0 avant le code CX1, autrement dit à une adresse @EM1- précédant l’espace mémoire EM1. In this embodiment, during step E030 for calling the malloc_MV memory allocation function, the hypervisor H reserves space not only for the executable code CX1, but also for the branch instruction JMP @ EM0 +. In another example of this embodiment shown in FIG. 4C, the hypervisor H moves one or more consecutive instructions INS0 located at the address @ EM0 of the code CX0 before the code CX1, in other words at an address @ EM1- preceding the memory space EM1.
Dans l’exemple de la figure 4C, l’hyperviseur enregistre, à l’adresse @RET1 de la dernière instruction de retour du code CX1, une instruction JMP @EM0+ de branchement à l’adresse @EM0+ qui suivait l’adresse @EM0 des instructions INS0 dans le code CX0 avant leur déplacement. L’hyperviseur remplace ensuite dans le code CX0, la ou les instructions déplacées INS0 par une instruction de branchement à l’adresse @EM1- précédant l’espace mémoire EM1 du premier code CX1, autrement dit à l’adresse où les instructions ont été déplacées. In the example of figure 4C, the hypervisor registers, at the address @ RET1 of the last return instruction of the code CX1, a branch instruction JMP @ EM0 + at the address @ EM0 + which followed the address @ EM0 INS0 instructions in the CX0 code before they are moved. The hypervisor then replaces in the code CX0, the instruction (s) moved INS0 by a branch instruction at the address @ EM1- preceding the memory space EM1 of the first code CX1, in other words at the address where the instructions were displaced.
Cet exemple est particulièrement intéressant lorsque l’on veut sonder le retour d’une fonction depuis une fonction appelante. This example is particularly interesting when we want to probe the return of a function from a calling function.
En variante, une ou plusieurs instructions de type NOP sont enregistrées à l’adresse @RET1, et l’hyperviseur H enregistre l’instruction JMP @EM0+ dans la mémoire du noyau de la machine virtuelle MV, juste après le code CX1. Alternatively, one or more NOP-type instructions are stored at the @ RET1 address, and the H hypervisor stores the JMP @ EM0 + instruction in the kernel memory of the VM virtual machine, just after the CX1 code.
La figure 5 est un organigramme représentant des étapes supplémentaires du procédé de génération et d’installation selon l’invention, mis en œuvre par l’hyperviseur H conformément à un autre mode de réalisation de l'invention. Les étapes supplémentaires visent à permettre l’appel du code exécutable CX1 par un code exécutable CX0 installé dans la mémoire du noyau de la machine virtuelle, en utilisant un espace mémoire supplémentaire AGR, dit d’ agrégation. FIG. 5 is a flowchart showing additional steps of the generation and installation method according to the invention, implemented by the hypervisor H according to another embodiment of the invention. The additional steps are intended to enable the CX1 executable code to be called by CX0 executable code installed in the kernel memory of the virtual machine, using additional AGR memory space, known as aggregation.
La mémoire de la machine virtuelle MV avant l’exécution des étapes de la figure 5 est identique à celle de la figure 4A déjà décrite. The memory of the virtual machine MV before the execution of the steps of Figure 5 is identical to that of Figure 4A already described.
Au cours d’une étape E0500, l’hyperviseur H initialise la mémoire d’agrégation AGR, par exemple en lui allouant une page mémoire et en la remplissant par des instructions nulles de type NOP. During a step E0500, the hypervisor H initializes the aggregation memory AGR, for example by allocating a memory page to it and filling it with null instructions of the NOP type.
Au cours d’une étape E052, l’hyperviseur H déplace, à la fin de l’espace d’agrégationDuring a step E052, the hypervisor H moves, at the end of the aggregation space
AGR : AGR:
- une ou plusieurs instructions INS0 du code CX0 ; - one or more INS0 instructions of code CX0;
- suivies par une instruction JMP @EM0+ de branchement à l’adresse @EM0+ qui suivait les instructions INS0 dans le code CX0 avant leur déplacement. - followed by a JMP @ EM0 + branch instruction at address @ EM0 + which followed the INS0 instructions in the CX0 code before they were moved.
Au cours d’une étape E064, l’hyperviseur H enregistre au début de l’espace d’agrégation AGR, une instruction de branchement JMP @EM1 à l’adresse de l’espace mémoire EM1 du code CX1. Au cours d’une étape E066, l’hyperviseur H remplace à l’adresse @RET1 une dernière instruction de retour du code CX1 par une instruction de branchement JMP @AGR+ à une adresse @AGR+ dans l’espace mémoire d’agrégation AGR consécutive à celle de l’instruction de branchement JMP @EM1. During a step E064, the hypervisor H records at the start of the aggregation space AGR, a branch instruction JMP @ EM1 to the address of the memory space EM1 of the code CX1. During a step E066, the hypervisor H replaces at the address @ RET1 a last return instruction of the code CX1 by a branch instruction JMP @ AGR + at an address @ AGR + in the consecutive AGR aggregation memory space to that of the JMP @ EM1 branch instruction.
Au cours d’une étape E072, l’hyperviseur H remplace dans le code CX0, la ou les instructions déplacées INS0 par une instruction JMP @AGR de branchement à l’adresse de la mémoire d’agrégation AGR. During a step E072, the hypervisor H replaces in the code CX0, the displaced instruction (s) INS0 by a JMP @AGR instruction for branching to the address of the aggregation memory AGR.
La figure 6A illustre la mémoire de la machine virtuelle MV suite à la mise en œuvre par l’hyperviseur H du procédé d’installation selon le mode décrit en référence à la figure 5. FIG. 6A illustrates the memory of the virtual machine MV following the implementation by the hypervisor H of the installation method according to the mode described with reference to FIG. 5.
La figure 6A montre des espaces mémoire dans lesquels sont enregistrés le code CX0, le code CX1, et l’espace d’agrégation AGR. Dans l’espace mémoire du code CX0, les instructions déplacées INS0 sont remplacées par l’instruction JMP @AGR de branchement à l’espace d’agrégation AGR. Figure 6A shows memory spaces in which the CX0 code, CX1 code, and AGR aggregation space are stored. In the memory space of code CX0, the displaced INS0 instructions are replaced by the JMP @AGR instruction for branching to the AGR aggregation space.
Dans l’espace mémoire EM1 correspondant au code CX1, se trouve le code CX1 privé de l’instruction de retour RET, suivi directement ou après des instructions de type NOP, de l’instruction JMP @AGR+ de branchement à une instruction NOP de l’espace d’agrégation AGR. In the memory space EM1 corresponding to the code CX1, is the private code CX1 of the return instruction RET, followed directly or after instructions of the NOP type, by the JMP @ AGR + instruction for connection to an NOP instruction of the AGR aggregation space.
Dans l’espace d’agrégation AGR, se trouve l’instruction JMP @EM1 de branchement à l’espace mémoire EM1 du code CX1, suivie d’instructions NOP, suivies de la ou des instructions déplacées INS0, puis de l’instruction JMP @EM0+ de branchement vers l’adresse @EM0+ qui suivait les instructions INS0 dans le code CX0 avant leur déplacement. In the AGR aggregation space, there is the JMP @ EM1 instruction for branching to the EM1 memory space of the CX1 code, followed by NOP instructions, followed by the displaced instruction (s) INS0, then by the JMP instruction @ EM0 + connection to the @ EM0 + address which followed the INS0 instructions in the CX0 code before they were moved.
Suite à la mise en œuvre du mode de réalisation de la figure 6A, lorsque la machine virtuelle MV commence à exécuter le code CX0 (phase 1), le processeur se branche au début de la mémoire d’agrégation AGR, et exécute les premières instructions de l’espace d’agrégation AGR. Ce branchement est illustré par la phase 2 de la figure 6A. Following the implementation of the embodiment of FIG. 6A, when the virtual machine MV starts to execute the code CX0 (phase 1), the processor connects to the start of the aggregation memory AGR, and executes the first instructions of the AGR aggregation space. This connection is illustrated by phase 2 of FIG. 6A.
Le processeur se branche alors au début du code CX1 (phase 3) et il commence l’exécution de ce code CX1 (phase 4). The processor then plugs in at the start of the CX1 code (phase 3) and begins executing this CX1 code (phase 4).
Le processeur se branche alors à l’adresse @AGR+ de la mémoire d’agrégation (phase 5). The processor then connects to the @ AGR + address of the aggregation memory (phase 5).
Le processeur exécute alors des instructions NOP (phase 6) puis les instructions déplacées INS0. The processor then executes NOP instructions (phase 6) then the displaced instructions INS0.
Ensuite, le processeur se branche à l’adresse @EM0+ du code CX0 (phase 7) puis termine l’exécution du code CX0 de la fonction fO (phase 8). Then, the processor connects to the address @ EM0 + of the CX0 code (phase 7) and then ends the execution of the CX0 code of the fO function (phase 8).
La fonction fO est ainsi enrichie par la fonction fl . Dans un autre exemple de ce mode de réalisation représenté sur la figure 6B, l’hyperviseur H déplace au début de (ou avant) l’espace mémoire d’agrégation AGR une ou plusieurs instructions INS0 du code CX0. Puis il enregistre, après l’instruction INS0 de l’espace mémoire d’agrégation, une première instruction JMP @EM1 de branchement à l’espace mémoire de la fonction CX1, et enregistre à la fin de l’espace mémoire d’agrégation AGR une instruction JMP@EM0+ de branchement à l’adresse @EM0+ qui suivait les instructions INS0 dans le code CX0 avant leur déplacement. L’hyperviseur H remplace la dernière instruction de retour du code CX1 par une instruction de branchement à une adresse @AGR+ immédiatement consécutive à celle de la première instruction de branchement. L’hyperviseur H remplace dans le code CX0, la ou les instructions déplacées INS0 par une instruction JMP @INS0 de branchement à la ou les instructions déplacées INS0, après leur déplacement. Cet exemple de réalisation est particulièrement intéressant lorsque l’on veut sonder le retour d’une fonction depuis une fonction appelante. The function fO is thus enriched by the function fl. In another example of this embodiment shown in FIG. 6B, the hypervisor H moves to the start of (or before) the aggregation memory space AGR one or more INS0 instructions of the CX0 code. Then it records, after the INS0 instruction of the aggregation memory space, a first JMP @ EM1 instruction for branching into the memory space of the CX1 function, and records at the end of the aggregation memory space AGR a JMP @ EM0 + instruction for branching at the address @ EM0 + which followed the INS0 instructions in the CX0 code before they were moved. The hypervisor H replaces the last return instruction of code CX1 by a branch instruction at an @ AGR + address immediately following that of the first branch instruction. The hypervisor H replaces, in the code CX0, the displaced instruction (s) INS0 by a JMP @ INS0 instruction for branching to the displaced instruction (s) INS0, after their displacement. This exemplary embodiment is particularly interesting when we want to probe the return of a function from a calling function.
Dans cet exemple, l'instruction de branchement JMP @EM0+ est placée à la fin de l'espace d'agrégation AGR, séparée de la première instruction JMP @EM1 par des instructions vides de type NOP. De cette façon, ces instructions intermédiaires NOP peuvent être remplacées par des instructions de branchement à d’autres codes supplémentaires pour enrichir le code CX0 par ces codes supplémentaires en plus du code CX1, tel que décrit ci-après en référence à la figure 7. Alternativement, lorsqu’il n’y a pas de codes supplémentaires, l'instruction de branchement JMP @EM0+ peut suivre la première instruction JMP @EM1 directement. In this example, the JMP @ EM0 + branch instruction is placed at the end of the AGR aggregation space, separated from the first JMP @ EM1 instruction by empty NOP-type instructions. In this way, these intermediate NOP instructions can be replaced by instructions for branching into other additional codes to enrich the CX0 code by these additional codes in addition to the CX1 code, as described below with reference to FIG. 7. Alternatively, when there are no additional codes, the JMP @ EM0 + branch instruction can follow the first JMP @ EM1 instruction directly.
La figure 7 est un organigramme représentant les différentes étapes d’un procédé de génération et d’installation, dans le noyau K d’une machine virtuelle MV, d’au moins un code exécutable supplémentaire CX2, conformément à un mode de réalisation de l'invention. Ce procédé est mis en œuvre par l’hyperviseur H. FIG. 7 is a flowchart showing the different steps of a method for generating and installing, in the kernel K of a virtual machine MV, at least one additional executable code CX2, in accordance with an embodiment of the 'invention. This process is implemented by the H.
Dans ce mode de réalisation, nous supposons qu’un code CX0 est installé dans la mémoire de la machine virtuelle MV et qu’un code CX1 a été également installé dans le noyau K de la machine virtuelle MV selon le mode décrit en référence aux figures 5 et 6 A (ou 6B). In this embodiment, we assume that a CX0 code is installed in the memory of the virtual machine MV and that a CX1 code has also been installed in the kernel K of the virtual machine MV according to the mode described with reference to the figures 5 and 6 A (or 6B).
Les étapes suivantes visent à installer un autre code exécutable CX2 dans la mémoire du noyau K et à pouvoir l'exécuter à partir du code CX0, après l’exécution du code CX1, en utilisant la mémoire d’ agrégation AGR. The following steps are intended to install another CX2 executable code into the K kernel memory and be able to run it from the CX0 code, after executing the CX1 code, using AGR aggregation memory.
Au cours d’une étape E067, l’hyperviseur H enregistre, dans la mémoire d’agrégation AGR, après l’instruction JMP @EM1 de branchement à l’espace mémoire occupé par le code CX1, une instruction JMP @EM2 de branchement à l’espace mémoire EM2 occupé par le code CX2. Au cours d’une étape E068, l’hyperviseur H remplace une instruction de retour du code CX2 par une instruction de branchement JMP @AGR++ à une adresse de la mémoire d’agrégation AGR consécutive à celle de l’instruction JMP @EM2 de branchement à l’espace mémoire EM2. During a step E067, the hypervisor H records, in the aggregation memory AGR, after the JMP @ EM1 instruction for branching to the memory space occupied by the code CX1, a JMP @ EM2 instruction for branching to the memory space EM2 occupied by the code CX2. During a step E068, the hypervisor H replaces a code return instruction CX2 by a branch instruction JMP @ AGR ++ at an address of the aggregation memory AGR consecutive to that of the branch instruction JMP @ EM2 to the EM2 memory space.
L’invention permet ainsi d’enrichir le code CX0 par les codes exécutables CX1 et CX2.The invention thus makes it possible to enrich the code CX0 with the executable codes CX1 and CX2.
D’autres codes exécutables supplémentaires CXi peuvent être installés et enrichir la fonction CX0 en utilisant l’espace d’agrégation AGR, selon le mode de réalisation décrit en référence à la figure 7. Other additional CXi executable codes can be installed and enrich the CX0 function using the AGR aggregation space, according to the embodiment described with reference to Figure 7.
La figure 8 illustre une architecture d’organisation de la mémoire dans la machine virtuelle MV suite à la mise en œuvre par l’hyperviseur H du procédé d’installation selon le mode décrit en référence à la figure 7. FIG. 8 illustrates an architecture for organizing the memory in the virtual machine MV following the implementation by the hypervisor H of the installation method according to the mode described with reference to FIG. 7.
Dans un exemple de réalisation décrit en référence à la figure 9, les instructions déplacées INS0 comprennent une ou plusieurs instructions de branchement, par exemple JMP, CALL, etc. De telles instructions comprennent un déplacement en mémoire (« offset ») pour référencer la destination du branchement. Dans l’exemple de la figure 9, les instructions INS0, enregistrées à l’adresse 0100, de 50 octets, comportent une instruction de branchement avec un offset de 80 octets (JMP OFF 80) pointant vers l’adresse 0180. In an exemplary embodiment described with reference to FIG. 9, the displaced instructions INS0 comprise one or more branch instructions, for example JMP, CALL, etc. Such instructions include a memory displacement ("offset") to reference the destination of the branch. In the example of Figure 9, the INS0 instructions, stored at address 0100, are 50 bytes long, have a branch instruction with an 80-byte offset (JMP OFF 80) pointing to address 0180.
Lorsque les instructions INS0 qui comprennent de tels branchements sont déplacées, la destination des branchements n’est plus la même que celle initialement prévue. En effet, du fait du déplacement des instructions INS0, la destination des branchements change, puisqu’elle est calculée en fonction de l’adresse de l’instruction de branchement. When the INS0 instructions which include such branches are moved, the destination of the branches is no longer the same as that initially intended. Indeed, due to the movement of the INS0 instructions, the destination of the branches changes, since it is calculated according to the address of the branch instruction.
On suppose ici que les instructions INS0 sont déplacées à l’adresse 0300. It is assumed here that the INS0 instructions are moved to address 0300.
Afin de pallier à cet inconvénient, il est prévu d’ajouter avant ou après les instructions déplacées INS0 autant d’instructions ILI de branchements longs inconditionnels qu’il y a d’instructions de branchement ou d’appels dans les instructions déplacées INS0. Chacune des instructions de branchement long inconditionnel ajoutée pointe vers une destination cible @CIB pointée par une instruction de branchement d’origine INSOR comprise dans les instructions déplacées INS0, avant leur déplacement. In order to overcome this drawback, it is planned to add before or after the displaced INS0 instructions as many unconditional long-branch ILI instructions as there are branch instructions or calls in the displaced INS0 instructions. Each of the added unconditional long branch instructions points to a target destination @CIB pointed to by an original INSOR branch instruction included in the displaced INS0 instructions, before they are moved.
Dans l’exemple décrit ici, on enregistre à l’adresse 0350, correspondant à la fin des instructions déplacées une instruction de branchement long inconditionnel JMP OFF -170 pointant vers l’adresse cible 0180. In the example described here, we record at address 0350, corresponding to the end of the displaced instructions, an unconditional long branch instruction JMP OFF -170 pointing to the target address 0180.
Une instruction de branchement comprise dans les instructions déplacées INS0 est modifiée de manière à pointer vers l’instruction de branchement ajoutée ILI, qui pointe vers la destination initiale @CIB (0180) prévue avant le déplacement des instructions INS0. Dans l’exemple décrit ici, l’instruction de branchement JMP OFF 80 déplacée à l’adresse 300 est modifiée par une instruction de même type JMP OFF 50 pointant vers l’adresse 0350 où est enregistrée l’instruction de branchement inconditionnel ILI. A branch instruction included in the moved INS0 instructions is changed to point to the added branch instruction ILI, which points to the initial @CIB (0180) intended for before the INS0 instructions were moved. In the example described here, the JMP OFF 80 branch instruction moved to address 300 is modified by an instruction of the same JMP OFF 50 type pointing to address 0350 where the ILI unconditional branch instruction is recorded.
Dans un premier cas correspondant à l’exemple de la figure 9, les instructions de branchement inconditionnel (JMP OFF -170) sont ajoutées après l’instruction de branchement JMP EM0+ lorsque les instructions déplacées INS0 se trouvent après le code exécutable CX1 ou après l’espace mémoire agrégateur AGR. De cette façon, même si l'instruction INSOR est de type instruction de branchement conditionnel et si les conditions correspondantes ne sont pas vérifiées, la suite de l'exécution reste valide car le branchement indiqué dans l'instruction INSOR ne sera pas effectué et l'instruction de branchement JMP EM0+ permet à la machine virtuelle MV d'exécuter la suite du premier code CX0. In a first case corresponding to the example of figure 9, the unconditional branching instructions (JMP OFF -170) are added after the JMP branching instruction EM0 + when the displaced instructions INS0 are found after the executable code CX1 or after l AGR aggregator memory space. In this way, even if the INSOR instruction is of the conditional branch instruction type and if the corresponding conditions are not verified, the rest of the execution remains valid because the branch indicated in the INSOR instruction will not be carried out and l The JMP EM0 + branch instruction allows the virtual machine MV to execute the rest of the first CX0 code.
Dans un deuxième cas, les instructions de branchement sont ajoutées avant les instructions déplacées INS0 lorsque celles-ci se trouvent avant le code exécutable CX1 ou avant l’espace mémoire agrégateur AGR. In a second case, the branching instructions are added before the displaced INS0 instructions when the latter are located before the CX1 executable code or before the AGR aggregator memory space.
Les procédés de la présente invention ont été expérimentés par une mise en œuvre sur des machines virtuelles MV qui utilisent le système d’opération Linux, Debian version 7, et/ou Windows, version 7 (marques déposées). D’autres versions de ces systèmes sont envisageables. En outre, d’autres systèmes d’exploitation sont envisageables, tels que les systèmes FreeBSD, NetBSD, et OpenBSD (marques déposées). The methods of the present invention have been experienced by implementation on VM virtual machines which use the operating system Linux, Debian version 7, and / or Windows, version 7 (registered trademarks). Other versions of these systems are possible. In addition, other operating systems are possible, such as FreeBSD, NetBSD, and OpenBSD (registered trademarks).
Dans les modes de réalisation décrits ici, le dispositif d’installation CMP a l’architecture d’un ordinateur, telle qu’illustrée à la figure 10. Elle comprend notamment un processeur 7, une mémoire vive 8, une mémoire morte 9, une mémoire flash non volatile 10 dans un mode particulier de réalisation de l’invention, ainsi que des moyens de communication 11. De tels moyens sont connus en soi et ne sont pas décrits plus en détail ici. In the embodiments described here, the installation device CMP has the architecture of a computer, as illustrated in FIG. 10. It comprises in particular a processor 7, a random access memory 8, a read only memory 9, a non-volatile flash memory 10 in a particular embodiment of the invention, as well as communication means 11. Such means are known per se and are not described in more detail here.
La mémoire morte 9 de dispositif CMP selon l’invention constitue un support d’enregistrement conforme à l’invention, lisible par le processeur 7 et sur lequel est enregistré l’hyperviseur H conforme à l’invention. The read-only memory 9 of the CMP device according to the invention constitutes a recording medium according to the invention, readable by the processor 7 and on which the hypervisor H according to the invention is recorded.
La mémoire 10 de dispositif CMP permet d’enregistrer des variables utilisées pour l’exécution des étapes des procédés de l’invention, telles que les données de configuration CFG_MV, le code source CS, etc. The CMP device memory 10 is used to store variables used for performing the steps of the methods of the invention, such as CFG_MV configuration data, CS source code, etc.
L’hyperviseur H définit des modules fonctionnels et logiciels, configurés pour installer un code exécutable dans un noyau K d’une machine virtuelle MV. Ces modules fonctionnels s’appuient sur et/ou commandent les éléments matériels 7-11 du dispositif CMP cités précédemment. Dans les modes de réalisations décrits, l’hyperviseur H met en œuvre l’invention. Dans un autre exemple de réalisation, certaines étapes de l’invention peuvent être mises en œuvre dans un logiciel externe, i.e. externe à l’hyperviseur, et d’autres mises en œuvre par l’hyperviseur. Par exemple, la génération du code exécutable à partir du code source et des données de configuration peut être mise en œuvre par le logiciel externe et l’installation du code exécutable dans la mémoire de la machine virtuelle peut être mise en œuvre par l’hyperviseur. The hypervisor H defines functional and software modules, configured to install an executable code in a kernel K of a virtual machine MV. These functional modules are based on and / or control the hardware elements 7-11 of the CMP device mentioned above. In the embodiments described, the hypervisor H implements the invention. In another exemplary embodiment, certain steps of the invention can be implemented in external software, ie external to the hypervisor, and others implemented by the hypervisor. For example, the generation of the executable code from the source code and configuration data can be implemented by the external software and the installation of the executable code in the memory of the virtual machine can be implemented by the hypervisor. .

Claims

REVENDICATIONS
1. Procédé de génération et d’installation d’un code exécutable (CX1, CX2) d’au moins une première fonction (fl) dans la mémoire d’un noyau (K) d’une machine virtuelle (MV), ledit procédé étant mis en œuvre par un hyperviseur (H), et comprenant des étapes de : 1. A method of generating and installing an executable code (CX1, CX2) of at least a first function (fl) in the memory of a kernel (K) of a virtual machine (MV), said method being implemented by a hypervisor (H), and comprising steps of:
- obtention (E001) d’un code source (CS1) comprenant au moins la première fonction- obtaining (E001) a source code (CS1) comprising at least the first function
(fl) ; (fl);
- obtention (E010) de données de configuration (CFG_MV) de ladite machine virtuelle, lesdites données de configuration comportant au moins une adresse (@F, @D) dans une mémoire du noyau de la machine virtuelle (MV) d’une fonction ou de données référencées par ledit code source (CS1) ; - obtaining (E010) configuration data (CFG_MV) of said virtual machine, said configuration data comprising at least one address (@F, @D) in a memory of the kernel of the virtual machine (MV) of a function or data referenced by said source code (CS1);
- obtention (E020) d’un code objet par compilation dudit code source (CS1) en utilisant lesdites données de configuration (CFG_MV) ; - obtaining (E020) an object code by compiling said source code (CS1) using said configuration data (CFG_MV);
- appel (E030) d’une fonction d’allocation de mémoire (malloc_MV) de ladite machine virtuelle, pour réserver un espace (EM1) dans la mémoire du noyau de la machine virtuelle- call (E030) of a memory allocation function (malloc_MV) of said virtual machine, to reserve a space (EM1) in the kernel memory of the virtual machine
(MV) pour un code exécutable (CX1) correspondant audit code objet ; (MV) for an executable code (CX1) corresponding to said object code;
- obtention dudit code exécutable (CX1) par assemblage dudit code objet en utilisant lesdites données de configuration (CFG_MV) et un résultat (@EM1) dudit appel (E030) à la fonction d’allocation de mémoire ; et - enregistrement (E040) dudit code exécutable (CX1) dans ledit espace mémoire (EM1). - obtaining said executable code (CX1) by assembling said object code using said configuration data (CFG_MV) and a result (@ EM1) of said call (E030) to the memory allocation function; and - recording (E040) of said executable code (CX1) in said memory space (EM1).
2. Procédé de génération et d’installation d’un code exécutable (CX1) selon la revendication 1 , ce procédé comportant en outre des étapes de : 2. A method of generating and installing an executable code (CX1) according to claim 1, this method further comprising the steps of:
- obtention (E045) de l’adresse (@RET1) d’une dernière instruction de retour dudit code exécutable (CX1) ; - obtaining (E045) the address (@ RET1) of a last return instruction of said executable code (CX1);
- déplacement (E050) à ladite adresse (@RET1), d’au moins une instruction (INS0) d’un deuxième code exécutable (CX0) installé dans la mémoire du noyau de ladite machine virtuelle ; - displacement (E050) to said address (@ RET1), of at least one instruction (INS0) of a second executable code (CX0) installed in the kernel memory of said virtual machine;
- enregistrement (E060) dans une adresse de ladite mémoire, après ladite au moins une instruction déplacée (INS0), d’une instruction de branchement à une adresse (@EM0+) consécutive à l’adresse (@EM0) des instructions (INS0) dans ledit deuxième code (CX0) avant leur déplacement ; et - recording (E060) in an address of said memory, after said at least one moved instruction (INS0), of a branch instruction to an address (@ EM0 +) consecutive to the address (@ EM0) of the instructions (INS0) in said second code (CX0) before their displacement; and
- remplacement (E070) dans ledit deuxième code (CX0), de ladite au moins une instruction déplacée (INS0) par une instruction de branchement audit espace mémoire (EM1) dudit code exécutable (CX1). - replacement (E070) in said second code (CX0), of said at least one displaced instruction (INS0) by a branch instruction to said memory space (EM1) of said executable code (CX1).
3. Procédé de génération et d’installation d’un code exécutable (CX1) selon la revendication 1 , ce procédé comportant en outre des étapes de : 3. A method of generating and installing an executable code (CX1) according to claim 1, this method further comprising the steps of:
- déplacement, à une adresse (@EM1-) précédant l’espace mémoire (EM1) dudit code exécutable (CX1), d’au moins une instruction (INS0) d’un deuxième code exécutable (CX0) installé dans la mémoire du noyau de ladite machine virtuelle ; - displacement, to an address (@ EM1-) preceding the memory space (EM1) of said executable code (CX1), of at least one instruction (INS0) of a second executable code (CX0) installed in the memory of the kernel of said virtual machine;
- enregistrement à une adresse (@RET1) d’une dernière instruction de retour dudit code exécutable (CX1), d’une instruction de branchement à une adresse (@EM0+) qui suivait l’adresse (@EM0) des instructions (INS0) dans le deuxième code (CX0) avant leur déplacement ; et - recording at an address (@ RET1) of a last return instruction of said executable code (CX1), of a branch instruction at an address (@ EM0 +) which followed the address (@ EM0) of the instructions (INS0) in the second code (CX0) before their displacement; and
- remplacement dans ledit deuxième code (CX0), de ladite au moins une instruction déplacée(INSO) par une instruction de branchement à ladite adresse (@EM1-) précédant l’espace mémoire (EM1). - replacement in said second code (CX0), of said at least one displaced instruction (INSO) by a branch instruction at said address (@ EM1-) preceding the memory space (EM1).
4. Procédé de génération et d’installation d’un code exécutable (CX1) selon la revendication 1 comportant en outre des étapes de : 4. A method of generating and installing an executable code (CX1) according to claim 1 further comprising steps of:
- déplacement (E052) dans un espace mémoire dit d’agrégation (AGR), d’au moins une instruction (INS0) d’un deuxième code exécutable (CX0) installé dans une mémoire du noyau ladite machine virtuelle, ces instructions étant suivies par une instruction de branchement à une adresse (@EM0+) qui suivait lesdites instructions (INS0) dans ledit deuxième code (CX0) avant leur déplacement ; - displacement (E052) in a memory space called aggregation (AGR), of at least one instruction (INS0) of a second executable code (CX0) installed in a memory of the kernel said virtual machine, these instructions being followed by a branch instruction at an address (@ EM0 +) which followed said instructions (INS0) in said second code (CX0) before their displacement;
- enregistrement (E064) dans ledit espace mémoire d’agrégation (AGR), avant ladite au moins une instruction déplacée (INS0), d’une première instruction de branchement audit espace mémoire (EM1) dudit code (CX1) exécutable, l’instruction du deuxième code exécutable étant déplacée vers la fin ou le début de l’espace d’agrégation de sorte à laisser de l’espace pour enregistrer la première instruction de branchement à l’espace mémoire du premier code, et à réserver de l’espace pour d’autres instructions de branchement à des espaces mémoire de codes exécutables supplémentaires, pour enrichir le deuxième code avec ces codes supplémentaires ; - remplacement (E066) d’une dernière instruction de retour dudit code (CX1) par une deuxième instruction de branchement à une adresse (@AGR+) dans ledit espace mémoire d’agrégation, consécutive à celle de ladite première instruction de branchement ; et - recording (E064) in said aggregation memory space (AGR), before said at least one displaced instruction (INS0), of a first connection instruction to said memory space (EM1) of said executable code (CX1), the instruction of the second executable code being moved to the end or the start of the aggregation space so as to leave space for recording the first branching instruction to the memory space of the first code, and to reserve space for other branching instructions to additional executable code memory spaces, to enrich the second code with these additional codes; - replacement (E066) of a last return instruction of said code (CX1) by a second branch instruction at an address (@ AGR +) in said aggregation memory space, consecutive to that of said first branch instruction; and
- remplacement (E072) dans ledit deuxième code (CX0), de ladite au moins une instruction déplacée (INS0) par une instruction de branchement audit espace mémoire d’agrégation (AGR). - replacement (E072) in said second code (CX0), of said at least one displaced instruction (INS0) by a branch instruction to said aggregation memory space (AGR).
5. Procédé de génération et d’installation d’un code exécutable (CX1) selon la revendication 1 comportant en outre des étapes de : 5. A method of generating and installing an executable code (CX1) according to claim 1 further comprising steps of:
- déplacement dans un espace mémoire dit d’agrégation (AGR), d’au moins une instruction (INS0) d’un deuxième code exécutable (CX0) installé dans une mémoire du noyau ladite machine virtuelle ; - displacement in a memory space called aggregation (AGR), of at least one instruction (INS0) of a second executable code (CX0) installed in a kernel memory of said virtual machine;
- enregistrement, dans ledit espace mémoire d’agrégation (AGR), d’une première instruction de branchement audit espace mémoire (EM1) dudit code (CX1) suivie par une instruction de branchement à une adresse (@EM0+) qui suivait lesdites instructions (INS0) dans ledit deuxième code (CX0) avant leur déplacement, l’instruction du deuxième code exécutable étant déplacée vers la fin ou le début de l’espace d’agrégation de sorte à laisser de l’espace pour enregistrer la première instruction de branchement à l’espace mémoire du premier code, et à réserver de l’espace pour d’autres instructions de branchement à des espaces mémoire de codes exécutables supplémentaires, pour enrichir le deuxième code avec ces codes supplémentaires ; - recording, in said aggregation memory space (AGR), of a first connection instruction to said memory space (EM1) of said code (CX1) followed by a connection instruction to an address (@ EM0 +) which followed said instructions ( INS0) in said second code (CX0) before their displacement, the instruction of the second executable code being moved towards the end or the beginning of the aggregation space so as to leave space to record the first branch instruction in the memory space of the first code, and in reserving space for other branching instructions to memory spaces of additional executable codes, in order to enrich the second code with these additional codes;
- remplacement d’une dernière instruction de retour dudit code (CX1) par une deuxième instruction de branchement à une adresse (@AGR+) dans ledit espace mémoire d’agrégation, immédiatement consécutive à celle de ladite première instruction de branchement ; et - remplacement dans ledit deuxième code (CX0), de ladite au moins une instruction déplacée(INSO) par une instruction de branchement à l’adresse de ladite au moins une instruction déplacée (INS0) dans ledit espace d’agrégation (AGR). - Replacement of a last return instruction of said code (CX1) by a second branch instruction at an address (@ AGR +) in said aggregation memory space, immediately following that of said first branch instruction; and - replacement in said second code (CX0) of said at least one displaced instruction (INSO) by a branch instruction to the address of said at least one displaced instruction (INS0) in said aggregation space (AGR).
6. Procédé de génération et d’installation d’un code exécutable (CX1) selon l’une des revendications 2 à 5 dans lequel ladite étape (E030) d’appel de la fonction d’allocation de mémoire prend en considération la taille d’une dite instruction de branchement en plus de la taille dudit code exécutable (CX1). 6. A method of generating and installing an executable code (CX1) according to one of claims 2 to 5 wherein said step (E030) of calling the memory allocation function takes into consideration the size d. 'a said branch instruction in addition to the size of said executable code (CX1).
7. Procédé de génération et d’installation d’un code exécutable (CX1) selon l’une quelconque des revendication 4 à 6, pour installer au moins un code exécutable supplémentaire (CX2) dans la mémoire du noyau (K) de ladite machine virtuelle (MV), ledit procédé comportant des étapes de : 7. A method of generating and installing an executable code (CX1) according to any one of claims 4 to 6, to install at least one additional executable code (CX2) in the memory of the kernel (K) of said machine. virtual (MV), said method comprising steps of:
- enregistrement (E067) dans ledit espace mémoire d’agrégation (AGR), après ladite instruction de branchement à l’espace mémoire du code exécutable (CX1), d’une troisième instruction de branchement à un espace mémoire (EM2) du code exécutable supplémentaire (CX2) ; et - remplacement (E068) d’une instruction de retour dudit code supplémentaire (CX2) par une instruction de branchement à une adresse (@AGR++) dudit espace mémoire d’agrégation, consécutive à celle de ladite troisième instruction de branchement. - recording (E067) in said aggregation memory space (AGR), after said instruction for branching into the memory space of the executable code (CX1), of a third instruction for branching into a memory space (EM2) of the executable code additional (CX2); and - replacement (E068) of a return instruction of said additional code (CX2) by a branch instruction at an address (@ AGR ++) of said aggregation memory space, consecutive to that of said third branch instruction.
8. Procédé de génération et d’installation d’un code exécutable (CX1) selon l’une quelconque des revendications 2 à 7 dans lequel ladite au moins une instruction déplacée (INS0) comporte au moins une instruction d’origine de branchement ou d’appel avec un décalage d’ adresse vers une adresse cible, ledit procédé comportant des étapes de : 8. A method of generating and installing an executable code (CX1) according to any one of claims 2 to 7 wherein said at least one displaced instruction (INS0) comprises at least one original branch or d instruction. 'call with an address offset to a target address, said method comprising the steps of:
- enregistrement, dans une zone (Z) atteignable par une instruction du type de ladite instruction d’origine dans la mémoire du noyau de la machine virtuelle, d’une instruction de branchement long inconditionnel à G adresse cible ; et - recording, in an area (Z) reachable by an instruction of the type of said original instruction in the memory of the kernel of the virtual machine, of an unconditional long branch instruction at G target address; and
- modification de ladite instruction d’origine par une instruction modifiée de même type pointant vers ladite instruction de branchement long inconditionnel. - modification of said original instruction by a modified instruction of the same type pointing to said unconditional long branch instruction.
9. Dispositif de génération et d’installation d’un code exécutable (CX1) d’au moins une première fonction dans une mémoire d’un noyau (K) d’une machine virtuelle (MV), ledit dispositif comportant la machine virtuelle et un hyperviseur (H), ledit hyperviseur comportant un module (MOD) apte à mettre en œuvre un procédé de génération et d’installation d’un code exécutable (CX1) selon l’une des revendications 1 à 8. 9. Device for generating and installing an executable code (CX1) of at least a first function in a memory of a kernel (K) of a virtual machine (MV), said device comprising the virtual machine and a hypervisor (H), said hypervisor comprising a module (MOD) capable of implementing a method for generating and installing an executable code (CX1) according to one of claims 1 to 8.
10. Programme d’ordinateur (Prog) comportant des instructions pour l’exécution d’un procédé de génération et d’installation d’un code exécutable (CX1) selon l’une des revendications 1 à 8 lorsque ledit programme est exécuté par un ordinateur. 10. Computer program (Prog) comprising instructions for the execution of a method for generating and installing an executable code (CX1) according to one of claims 1 to 8 when said program is executed by a computer.
11. Support d’enregistrement lisible par un ordinateur sur lequel est enregistré le programme d’ordinateur (Prog) selon la revendication 10 11. A recording medium readable by a computer on which the computer program (Prog) according to claim 10 is recorded
PCT/FR2020/052346 2019-12-23 2020-12-08 Method and device implementing said method for generating and installing an executable code in the memory of a core of a virtual machine from a hypervisor WO2021130420A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
FRFR1915489 2019-12-23
FR1915489A FR3105507B1 (en) 2019-12-23 2019-12-23 Method and device implementing this method for generating and installing executable code in the memory of a kernel of a virtual machine from a hypervisor

Publications (1)

Publication Number Publication Date
WO2021130420A1 true WO2021130420A1 (en) 2021-07-01

Family

ID=70804666

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/FR2020/052346 WO2021130420A1 (en) 2019-12-23 2020-12-08 Method and device implementing said method for generating and installing an executable code in the memory of a core of a virtual machine from a hypervisor

Country Status (2)

Country Link
FR (1) FR3105507B1 (en)
WO (1) WO2021130420A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113448690A (en) * 2021-08-27 2021-09-28 阿里云计算有限公司 Monitoring method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060026577A1 (en) * 2004-07-31 2006-02-02 Dinechin Christophe D Method and system for replacing instructions and instruction blocks in computer code
WO2017203147A1 (en) * 2016-05-24 2017-11-30 Orange Method for identifying at least one function of an operating system kernel
US20190324882A1 (en) * 2018-04-20 2019-10-24 Draios, Inc. Programmatic container monitoring

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060026577A1 (en) * 2004-07-31 2006-02-02 Dinechin Christophe D Method and system for replacing instructions and instruction blocks in computer code
WO2017203147A1 (en) * 2016-05-24 2017-11-30 Orange Method for identifying at least one function of an operating system kernel
US20190324882A1 (en) * 2018-04-20 2019-10-24 Draios, Inc. Programmatic container monitoring

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
O'REILLLY: "4. Compiling, Linking, and Locating - Programming Embedded Systems, 2nd Edition [Book]", 1 October 2006 (2006-10-01), XP055727033, Retrieved from the Internet <URL:https://www.oreilly.com/library/view/programming-embedded-systems/0596009836/ch04.html> [retrieved on 20200902] *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113448690A (en) * 2021-08-27 2021-09-28 阿里云计算有限公司 Monitoring method and device
CN113448690B (en) * 2021-08-27 2022-02-01 阿里云计算有限公司 Monitoring method and device

Also Published As

Publication number Publication date
FR3105507B1 (en) 2023-11-03
FR3105507A1 (en) 2021-06-25

Similar Documents

Publication Publication Date Title
US20200065124A1 (en) Shortening just-in-time code warm up time of docker containers
EP2649522B1 (en) Method for providing an application as a library in a virtual machine
Nedelcu Nginx http server
WO2012000949A1 (en) Selective compiling method, device, and corresponding computer program product
CN107506221A (en) Application program updating method, apparatus and equipment
US20190377662A1 (en) Identifying a source file for use in debugging compiled code
US11709810B1 (en) Delivery of digital information to a remote device
EP2649523A1 (en) Method for compiling an intermediate code of an application
WO2021130420A1 (en) Method and device implementing said method for generating and installing an executable code in the memory of a core of a virtual machine from a hypervisor
US8196093B2 (en) Apparatus and method for componentizing legacy system
EP2453356A1 (en) Method, computer program and device for securing byte code to be run by a virtual machine
FR2871590A1 (en) METHOD FOR LOADING OBJECT-ORIENTED INTERMEDIATE LANGUAGE SOFTWARE IN A PORTABLE DEVICE.
FR2765363A1 (en) METHOD AND SYSTEM FOR CONTROLLING THE USE OF A SOFTWARE
WO2019180376A1 (en) Method and system for creating an image of an application
CN116069366A (en) Client application program updating method and device, storage medium and electronic equipment
EP4302213A1 (en) Method and module for installing a mitigation program in the kernel of a computing device
CN107667343B (en) System and method for loading on-demand resources
US20210382705A1 (en) Systems and methods for seamless software migration
EP3411821B1 (en) Method for storing content, method for consulting content, method for managing content and content readers
EP4018313B1 (en) Data collector in an electronic device
WO2023161105A1 (en) Method and module for detecting attempted cyber attacks in a fleet of computers
WO2023160327A1 (en) Container image management
EP2414931B1 (en) Method of managing the memory of a computerized system
EP1280057A1 (en) Method of dynamic customization of an application program
Membrey et al. Pi Media Center

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20842272

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20842272

Country of ref document: EP

Kind code of ref document: A1