Efficient deployment of multiple hotfix resources
By using inactive logic patch slots in computing devices to allocate hot patches and recycle resources, the problem of inefficient binary file patching is solved, and the application and security statement of unlimited number of hot patches is realized, ensuring the efficiency and security of patching is achieved. .
Patent Information
- Application Number
- CN201980039900.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2018-06-15
- Filing Date
- 2019-06-07
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2039-06-07
AI Technical Summary
When performing binary file patching, the prior art faces the problem that hot patch requests exceed the fixed number of logical patch slots, resulting in inefficient patching and difficulty in applying a large number of hot patches without restarting.
Hot patching of binary files is achieved by assigning hot patches in a computing device using inactive logic patch slots and recycling slot resources under specific conditions, ensuring that logic slots are recycled for a limited time to support an unlimited number of hot patches application.
Implements hot patches that are larger than the number of logical patch slots without restarting, ensuring resource recycled for a limited time, reducing memory overhead, supporting unlimited amount of hot patches, and providing a strong security statement to prevent certain types of attacks .
Smart Images

Figure CN112384893B_ABST
Abstract
Description
Background Art
[0001] Virtualization technology can be applied in a variety of scenarios. For example, virtualization technology can be applied to extract physical computing resources from guest partitions to make the utilization of physical computing resources more efficient, to make guest partitions portable across physical devices, to protect physical computing resources from malicious and / or erroneous code running in guest partitions, to protect secrets, to enforce security requirements or policies, etc. In virtualization and other technologies, hot patching can be used to patch binary files without rebooting. Summary of the invention
[0002] This summary is provided to introduce some concepts in a brief manner, which will be further described in the detailed description below. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
[0003] Briefly, the disclosed technology is generally directed to patching of binary files in execution. In one example of the technology, multiple hot patch requests are received at separate times. In some examples, each of the multiple hot patch requests includes a corresponding hot patch for hot patching the binary file in execution. In some examples, the cardinality of the multiple hot patches requested is greater than a fixed number of logical patch slots. In some examples, as the binary file in execution continues to execute, each time a request to apply a hot patch to the binary file in execution is received, the corresponding hot patch is assigned to an inactive logical patch slot in the fixed number of logical patch slots. In some examples, the corresponding hot patch is executed from the assigned logical patch slot to hot patch the binary file in execution based on the corresponding hot patch.
[0004] Other aspects and applications of the disclosed technology will be appreciated upon reading and understanding the drawings and description. BRIEF DESCRIPTION OF THE DRAWINGS
[0005] Non-limiting and non-exhaustive examples of the present disclosure are described with reference to the following drawings. In the drawings, unless otherwise specified, like reference numerals represent like parts in the various drawings. These drawings are not necessarily drawn to scale.
[0006] For a better understanding of the present disclosure, reference will be made to the following detailed description, which will be read in conjunction with the accompanying drawings, in which:
[0007] Figure 1 is a physical diagram illustrating one example of a suitable computing device in accordance with aspects of the disclosed technology;
[0008] Figure 2 is a logical diagram illustrating the example computing device according to aspects of the disclosed technology;
[0009] Figure 3 An example process according to aspects of the disclosed technology is shown; and
[0010] Figure 4A-4B Another example process in accordance with aspects of the disclosed technology is shown. DETAILED DESCRIPTION
[0011] The following description provides specific details for a thorough understanding of various examples of the present technology and for enabling descriptions of various examples of the present technology. Those skilled in the art will appreciate that the present technology can be practiced without many such details. In some cases, well-known structures and functions are not shown or described in detail to avoid unnecessarily obscuring the description of examples of the present technology. The terms used in this disclosure are intended to be interpreted in a broad and reasonable manner, even if they are used in conjunction with the detailed description of certain examples of the present technology. Although certain terms may be emphasized below, in the embodiment section, any term intended to be interpreted in any limiting manner will be disclosed and clearly defined. Throughout the specification and claims, the following terms have at least the meanings clearly associated here, unless otherwise specified in the context. The meanings determined below do not necessarily limit these terms, but only provide illustrative examples for these terms. For example, each of the terms "based on" and "on the basis of..." is not exclusive and is equivalent to the term "at least partially based on", and includes selections based on additional factors, some of which may not be described herein. For another example, the term "by means" is not exclusive and is equivalent to the term "at least partially by means of", and includes selections by means of additional factors, some of which may not be described herein. The meaning of "in" includes "in" and "on". The phrases "in one embodiment" or "in an example" as used herein do not necessarily refer to the same embodiment or example, although it may. The use of a particular textual numerical designation does not imply the presence of a numerical designation of a lower value. For example, the statement "a widget selected from a group containing a third foo and a fourth bar" does not itself mean that there are at least three foo elements, nor does it mean that there are at least four bar elements. Singular references are intended only for clarity of reading and include plural references unless plural references are explicitly excluded. The term "or" is inclusive of the "or" operator unless expressly stated otherwise. For example, the phrase "A or B" means "A, B, or A and B". As used herein, the terms "component" and "system" are intended to include various combinations of hardware, software, or hardware and software. Thus, for example, a system or component may be a process, a process executed on a computing device, a computing device, or a portion thereof.
[0012] In short, the disclosed technology generally relates to patching of binary files in execution. In one example of the technology, multiple hot patch requests are received at separate times. In some examples, each of the multiple hot patch requests includes a corresponding hot patch to hot patch the binary file in execution. In some examples, the cardinality of the multiple hot patches requested is greater than the fixed number of logical patch slots. In some examples, as the binary file in execution continues to execute, each time a request to apply a hot patch to the binary file in execution is received, the corresponding hot patch is assigned to an inactive logical patch slot in a fixed number of logical patch slots. In some examples, the corresponding hot patch is executed from the assigned logical patch slot to hot patch the binary file in execution based on the corresponding hot patch.
[0013] Hot patching may refer to patching that occurs without restarting. In some examples, hot patching of an executing binary file is completed using a logical patch slot in which the patch is placed. The executing binary file may be a hypervisor and / or an operating system kernel, and the executable binary file may have a limited execution guarantee. There may be a limited number of logical patch slots, such as two logical patch slots. These logical patch slots may be in addition to the logical base slot, in which a version of the booted executable binary file image is placed. In response to a new hot patch, in some examples, the hot patch is assigned to an inactive slot, and the hot patch is executed from the slot, so that the code and data in the executing binary file can be patched. In response to a second hot patch, in some examples, the hot patch is similarly applied to an inactive slot, and then a snapshot of the image version is taken. The snapshot can then be used to determine the number of threads running in the current patch generation and the versions of all loaded images.
[0014] In some examples, each hot patch has a corresponding reference counter that is set to the number of threads running based on the current patch generation. Each of the threads running in the current patch generation can be signaled to unwind and rewind the call stack of the thread. In response to the thread completing the rewind, in some examples, the thread will naturally enable the newly patched function when appropriate. Therefore, the corresponding reference counter for the current patch generation is decremented by one.
[0015] Once the reference counter generated for the patch reaches zero, in some examples, the logical slot is reclaimed and set to inactive, and all resources associated with the logical slot can be reclaimed. The logical slot can then be used for subsequent hot patching. In some examples, based on the limited execution guarantee, the logical slot is guaranteed to be reclaimed within a certain limited amount of time. In this way, an unlimited number of hot patches can be applied without restarting, even if the number of logical slots is limited.
[0016] Illustrative Computing Devices
[0017] Figure 1 is a diagram illustrating one example of a physical view of a computing device 100 in which various aspects of the present technology may be practiced. Computing device 100 may be nearly any type of general or specific purpose computing device. For example, computing device 100 may be a user device, such as a desktop computer, a laptop computer, a tablet computer, a display device, a camera, a printer, or a smartphone. Likewise, computing device 100 may also be a server device, such as an application server computer, a virtual computing host, or a file server computer. Computing device 100 may also be an IoT device connected to a network to receive IoT services. Likewise, computing device 100 may be a server device, such as an application server computer, a virtual computing host, or a file server computer. Figure 2 shown in or with reference to Figure 2 Examples of the devices shown. Figure 1 As shown, computing device 100 includes processing circuitry 110, operating memory 120, memory controller 130, data storage memory 150, input interface 160, output interface 170, and network adapter 180. Each of these previously listed components of computing device 100 includes at least one hardware element.
[0018] The computing device 100 includes at least one processing circuit 110 configured to execute instructions, such as instructions for implementing the workload, processing, or technology described herein. The processing circuit 110 may include a microprocessor, a microcontroller, a graphics processor, a coprocessor, a field programmable gate array, a programmable logic device, a signal processor, or any other circuit suitable for processing data. The processing circuit 110 is an example of a core. During the operation of the computing device 100, the above instructions together with other data (e.g., data sets, metadata, operating system instructions, etc.) may be stored in an operating memory 120. The operating memory 120 may also include any of a variety of data storage devices / components, such as volatile memory, semi-volatile memory, random access memory, static memory, cache, buffer, or other media for storing information during operation. In one example, when the computing device 100 is powered off, the operating memory 120 does not retain information. Instead, the computing device 100 may be configured to transfer instructions from a non-volatile data storage component (e.g., data storage memory 150) to the operating memory 120 as part of a boot or other loading process.
[0019] The operating memory 120 may include a fourth generation double data rate (DDR4) memory, a third generation double data rate (DDR3) memory, other dynamic random access memory (DRAM), a high bandwidth memory (HBM), a hybrid memory cube memory, a 3D stack memory, a static random access memory (SRAM), or other memory, and such memory may include one or more memory circuits integrated into a DIMM, SIMM, SODIMM, or other package. Such operating memory modules or devices may be organized according to channels, ranks, and banks. For example, the operating memory device may be coupled to the processing circuit 110 in a channel via the memory controller 130. An example of the computing device 100 may include one or two DIMMs per channel, one or two ranks per channel. The operating memory within a rank may be operated using a shared clock and a shared address and command bus. Similarly, the operating memory device may be organized into several banks, where the bank may be viewed as an array addressed by rows and columns. Based on this organization of the operating memory, the physical address within the operating memory may be referenced by a tuple of channels, ranks, banks, rows, and columns.
[0020] Notwithstanding the above discussion, the operational memory 120 does not specifically include or contain a communications medium, any communications medium, or any signal per se.
[0021] The memory controller 130 is configured to interface the processing circuit 110 to the operating memory 120. For example, the memory controller 130 may be configured to interface commands, addresses, and data between the operating memory 120 and the processing circuit 110. The memory controller 130 may also be configured to abstract certain aspects of memory management from the processing circuit 110 or otherwise manage certain aspects of memory management for the processing circuit 110. Although the memory controller 130 is shown as a single memory controller separate from the processing circuit 110, in other examples, multiple memory controllers may be used, the memory controller may be integrated with the operating memory 120, or the like. Further, the memory controller may be integrated into the processing circuit 110. These and other variations are possible.
[0022] In computing device 100, data storage memory 150, input interface 160, output interface 170, and network adapter 180 are interfaced to processing circuit 110 by bus 140. Figure 1 The bus 140 is shown as a single passive bus, but other configurations such as a collection of buses, a collection of point-to-point links, input / output controllers, bridges, other interface circuits, or any collection thereof may also be suitable for interfacing the data storage memory 150, input interface 160, output interface 170, or network adapter 180 with the processing circuit 110.
[0023] In computing device 100, data storage memory 150 is used for long-term non-volatile data storage. Data storage memory 150 may include any of a variety of non-volatile data storage devices / components, such as non-volatile memory, disks, disk drives, hard disk drives, solid-state hard disk drives, or any other medium that can be used for non-volatile storage of information. However, data storage memory 150 specifically does not include or contain communication media, any communication media, or any signal itself. In contrast to operating memory 120, data storage memory 150 is used by computing device 100 for non-volatile long-term data storage, rather than for data storage during runtime.
[0024] Likewise, computing device 100 may include or be coupled to any type of processor-readable media, such as processor-readable storage media (e.g., operating memory 120 and data storage memory 150) and communication media (e.g., communication signals and radio waves). Although the term processor-readable storage media includes operating memory 120 and data storage memory 150, throughout the specification and claims, whether used in the singular or plural, the term "processor-readable storage medium" is defined herein such that the term "processor-readable storage medium" specifically excludes and does not include communication media, any communication media, or any signal itself. However, the term "processor-readable storage medium" does include processor cache, random access memory (RAM), register memory, and the like.
[0025] The computing device 100 also includes an input interface 160, which can be configured to enable the computing device 100 to receive input from a user or from other devices. In addition, the computing device 100 includes an output interface 170, which can be configured to provide output from the computing device 100. In one example, the output interface 170 includes a frame buffer, a graphics processor, a graphics processor or an accelerator, and is configured to render a display to be presented on a separate intuitive display device (such as a monitor, a projector, a virtual computing client computer, etc.). In another example, the output interface 170 includes an intuitive display device and is configured to render and present the display for viewing. In another example, the input interface 160 and / or the output interface 170 may include a universal asynchronous receiver-transmitter (UART), a serial peripheral interface (SPI), an internal integrated circuit ("I2C"), a general purpose input / output (GPIO), and / or the like. In addition, the input interface 160 and / or the output interface 170 may include, or interface any number or type of external devices.
[0026] In the example shown, computing device 100 is configured to communicate with other computing devices or entities via network adapter 180. Network adapter 180 may include a wired network adapter, such as an Ethernet adapter, a token ring adapter, or a digital subscriber line (DSL) adapter. Network adapter 180 may also include a wireless network adapter, such as a WiFi adapter, a Bluetooth adapter, a ZigBee adapter, a Long Term Evolution (LTE) adapter, or a 5G adapter.
[0027] Although computing device 100 is shown with certain components configured in a particular arrangement, these components and arrangements are merely one example of a computing device in which the present technology may be used. In other examples, data storage memory 150, input interface 160, output interface 170, or network adapter 180 may be coupled directly to processing circuit 110, or via an input / output controller, bridge, or other interface circuit. Other variations of the present technology are possible.
[0028] Some examples of computing device 100 include at least one memory (e.g., operating memory 120) adapted to store runtime data and at least one processor (e.g., processing circuitry 110) adapted to execute processor executable code that, in response to execution, enables computing device 100 to perform actions.
[0029] like Figure 1 As shown in , the memory controller 130 may include one or more operating memories 120 that interconnect multiple processing circuits 110 and connect the processing circuits 110 to a bus 140, such as the Internet or an intranet. For example, the operating memory 120 may include a switch, a router, a hub, a network controller, or other network elements. In some examples, the processing circuits 110 may be organized into racks, action zones, groups, sets, or other appropriate partitions. For example, in the example shown, the processing circuits 110 are grouped into three host sets, which are identified as first, second, and third host sets 112a-112c, respectively. In the example shown, each of the host sets 112a-112c is respectively operably coupled to a corresponding operating memory 120a-120c, which is generally referred to as a "top of rack" or "TOR" network node. The TOR operating memory 120a-120c can then be operably coupled to additional operating memory 120 to form a computer network in a hierarchical, flat, grid, or other appropriate type of topology that allows communication between the processing circuit 110 and the bus 140. In other examples, multiple host sets 112-112c may share a single operating memory 120. The processing circuit 110 can be nearly any type of general-purpose or special-purpose computing device. For example, these computing devices can be user devices, such as desktop computers, laptop computers, tablet computers, display devices, cameras, printers, or smart phones. However, in a data center environment, these computing devices can be server devices, such as application server computers, virtual computing hosts, or file server computers. In addition, the processing circuit 110 can be configured separately to provide computing, storage, and / or other appropriate computing services.
[0030] In some examples, one or more of the processing circuits 110 are IoT devices, devices that include part or all of an IoT support service, devices that include part or all of an application backend, or the like, as discussed in more detail below.
[0031] Figure 2 2 is an example of a logical view of a computing device 200 in which various aspects of the present technology may be practiced. The computing device 200 may be Figure 1 An example of a computing device 100 in FIG. Figure 2 In the illustration of FIG. 2 , the logical components of computing device 200 include guest partitions 211 - 213 , supervisory partition 230 , and physical resources 241 - 243 .
[0032] Physical resources 241-243 may include any type of physical components, such as processor components, input / output (I / O) components, and / or other components or devices. For example, physical resources 241-243 may include any suitable combination of physical components, such as those combined with Figure 1 Although shown as part of computing device 200, one or more physical resources 241-243 (e.g., one or more data storage memories) may be implemented external to computing device 200. Various components or modules running on computing device 200 - including supervisory partition 23 - may access functionality provided via physical resources 241-243 directly and / or indirectly via other components or modules.
[0033] Supervisor partition 230 may generate any number of guest partitions, for example, guest partitions 211-213. Each of guest partitions 211-213 may be a virtual machine VM, a virtualized application, a VBS execution environment, a user mode process, and / or the like. For example, guest partition 211 is shown as a VM having an operating system (OS) 221 and an application 222, guest partition 212 is shown as a virtualized application, and guest partition 224 is shown as having a process 224 executed therefrom.
[0034] Each guest partition 211-213 is an isolated logical unit from which an operating system and / or other software is executed. Each of the guest partitions 211-213 may also include a guest virtual processor. The software running in each of the guest partitions 211-213 is isolated from the software running in each of the other guest partitions. For example, the software running in each of the guest partitions 211-213 cannot access, and does not need to be aware of, the software running in each of the various other guest partitions. Physical resources 241-243 are virtualized to the guest partitions 211-213, and access to the physical resources 241-243 is managed by the supervisory partition 230.
[0035] As shown, computing device 100 includes supervisory partition 230. Supervisory partition 230 may include a hypervisor, such as a virtual machine monitor that manages access to functions provided by physical resources 241-243. In another example, supervisory partition 230 is a kernel or kernel mode process of an OS, such as an OS using VBS.
[0036] In some examples, hot patching within computing device 200 may occur based on logical slots within supervisor partition 230. For example, in some examples, supervisor partition 230 uses base slot 290 for a hypervisor and uses patch slot 291 and patch slot 292 for hot patching the hypervisor.
[0037] Examples of computing device 100 and / or computing device 200 may be hot-patched as follows.
[0038] In some examples, hot patching of an executing binary is accomplished using a logical slot in which the patch is placed. The executing binary may be an executing hypervisor and / or an executing operating system kernel, and the executable binary may have a limited execution guarantee. In some examples, the executing binary is an executing hypervisor, which is an executing operating system kernel. There may be a finite number (i.e., cardinality) of slots, such as two slots (e.g., Figure 2 These logical patch slots may be in addition to the logical base slots (e.g., Figure 2 A slot other than the base slot 290) of the booted program is located in the logical base slot, and a version of the binary file image being executed by the booted program is placed in the logical base slot. During booting, the binary file can be executed from the base slot. Figure 2 Base slot 290, patch slots 291 and 292 are shown, but this is merely an example, and in various examples, the slots may be in various suitable locations in computing device 100 and / or computing device 200, such as in some examples, located at Figure 2 In the OS kernel within OS221.
[0039] In some examples, a logical slot is actually a virtual address (VA) region that may or may not be backed by a physical page. In some examples, a logical slot is actually a VA plus a physical address (PA).
[0040] In response to a new hot patch to be applied, in some examples, the hot patch is assigned to an inactive slot and the hot patch is executed from the slot, which can patch the code and data in the executing binary. The image can be supplied to the assigned slot, and then the slot becomes active. In response to the slot becoming active, in some examples, all new calls to the patched function are executed from the new slot. In some examples, unpatched functions continue to execute from the old slot. In some examples, past calls from the function to be patched continue to execute from the old slot.
[0041] In response to the second hot patch being applied, in some examples, the hot patch is also applied to the inactive slots, and then a snapshot of the image version is taken. The snapshot can then be used to determine the number of threads running in the current patch generation and the versions of all loaded images.
[0042] In some examples, each hotpatch has a corresponding generation counter, which is actually the hotpatch version in the active hotpatch slot. In some examples, each thread is marked with the generation counter, which indicates the generation to which the thread belongs. The reference counter is set to the number of threads running based on the current patch generation (i.e., the cardinality).
[0043] Each of the threads running in the current patch generation may be signaled to unwind and rewind the thread's call stack. In some examples, the unwinding forces the thread to roll back to the thread's starting state, and the rewinding is a rewind back to the beginning of the thread. In response to the thread completing the rewind, in some examples, the thread naturally enables the newly patched functionality when appropriate and decrements the corresponding reference counter by one.
[0044] In some examples, the unwinding and rewinding occurs at a specific point in the code. For example, in some examples, after the thread has been signaled to unwind and rewind, in response to the thread reaching a passive wait state - for example, in response to the thread being passively waiting in a queue - the unwinding and rewinding occurs. In some examples, while the thread is in an active wait state, the unwinding and rewinding has not yet occurred. An example of an active wait state is waiting for a lock. In some examples, due to the limited execution guarantee, it is guaranteed that the thread will enter the passive wait state within a certain limited predetermined amount of time. In some examples, the thread is part of an executing binary file, and the executing binary file is also managing hot patches; correspondingly, in some examples, when the thread is signaling, the thread is signaling the part of the executing binary file that coordinates hot patches.
[0045] In some examples, once the reference count for a patch reaches 0, this means that all threads for the associated patch have completed their rewind sequences. Correspondingly, in response to the reference count for the patch reaching 0, in some examples, the logical slot is reclaimed and atomically set to inactive, and all resources associated with the logical slot - including pages - may be reclaimed. The logical slot may then be used for subsequent hot patches. In some examples, based on the bounded execution guarantee, the logical slot is guaranteed to be reclaimed within a certain bounded amount of time.
[0046] In this way, in some examples, a number (i.e., a base number) of hot patches greater than the number of logical patch slots can be applied without restarting. Further, in this way, in some examples, an unlimited number of hot patches can be applied without restarting, even if the number of logical slots is limited.
[0047] In some examples, hot patching performed in this way ensures that no thread is executing unsafe code within a limited short time span, and utilizes limited execution guarantees to support an unlimited number of hot patches, which have a limited and bounded memory overhead. Hot patching performed in this way can correspondingly limit the amount of resources including memory required for hot patches, so that the memory cost is independent of the number of hot patches applied in the life cycle. Hot patching performed in this way can allow patching of data, not just code. In some examples, hot patching performed in this way also allows strong security statements made for the purpose of proof. For example, in some examples, once the reference count for a specific patch slot reaches 0, it can be proved that the pre-patch function is now gone. This can be used to prevent certain types of attacks, such as cutting off the stack to force a call to a vulnerable pre-patch function. In some examples, the pre-patch function no longer exists at that time, so that such an attack will not succeed. In various examples, hot patching can be done not only for security, but also for various different appropriate reasons, including adding new features and modifying behaviors for various other appropriate reasons-such as correctness and performance.
[0048] Hot patching performed in this manner can be used for hot patching in any appropriate environment, especially in environments that are sensitive to downtime, such as server environments. Hot patching in this manner can also be used for a variety of other appropriate reasons and environments, including client and mobile environments. For example, hot patching can be used in cloud hosting environments, and can be used in client environments, for example, to avoid frequent periodic reboots for patches on client devices.
[0049] Exemplary Processing
[0050] For the sake of clarity, the processing described herein is described in terms of operations performed in a specific order by a specific device or component of the system. However, it should be noted that other processing is not limited to the order, device or component. For example, certain actions may be performed in different orders, and these actions may be parallel, omitted or supplemented by other actions or features, regardless of whether such order, parallelism, actions or features are described herein. Similarly, any technology described in the present disclosure may be incorporated into the described processing or other processing, regardless of whether the technology is specifically described in conjunction with the processing. The disclosed processing may also be performed on or by other devices, components or systems, regardless of whether such devices, components or systems are described herein. These processing may also be embodied in various ways. For example, they may be embodied in a manufactured article, for example, as a processor-readable instruction stored in a processor-readable storage medium or as a computer-implemented processing. As another example, these processes may be encoded as processor-executable instructions and transmitted via a communication medium.
[0051] Figure 3 An example data flow for process (380) is shown. In some examples, process 380 is performed by a processor of a computing device, for example, Figure 1 The processing circuit 110 or Figure 2 physical resource 241, 242 or 243.
[0052] In the example shown, step 381 occurs first. In step 381, in some examples, a hot patch request is received. In some examples, the cardinality of the requested plurality of hot patches is greater than the fixed number of logical patch slots. As shown, in some examples, step 382 occurs next. In step 382, in some examples, the corresponding hot patch is assigned to an inactive logical patch slot in the fixed number of logical patch slots without restarting the system running the executing binary file. In some examples, if the inactive logical patch slot is not available, the hot patch can be delayed, for example, it can be placed in a queue or other structure for later execution or invalidated.
[0053] In step 383, in some examples, the corresponding hot patch is executed from the allocated logical patch slot to hot patch the executing binary file based on the corresponding hot patch. In some examples, 383 includes submitting the modification to the base and / or patch image indicated, for example, as shown in the instructions associated with the hot patch. As shown in the figure, in some examples, decision block 384 occurs next. In some examples, in decision block 384, a decision is made as to whether there are more requests for hot patches to be received. If so, the processing can return to step 381. If not, the process can then enter a return block, in which other processing continues.
[0054] Figures 4A-4B An example data flow of a process (490) is shown. In some examples, process 490 is performed by a processor of a computing device, for example, Figure 1 The processing circuit 110 or Figure 2 physical resource 241, 242 or 243.
[0055] In the illustrated example, step 491 occurs first. In step 491, in some examples, a request to apply a hot patch to an executing hypervisor is received. In some examples, a plurality of threads are running in a current image of the executing hypervisor. As shown, in some examples, step 492 occurs next. In step 492, in some examples, in response to the request, a reference counter associated with the hot patch is set to a base corresponding to the plurality of threads that are running the current image of the executing hypervisor.
[0056] As shown, in some examples, step 493 occurs next. In step 493, in some examples, hot patching is performed. As shown, in some examples, step 494 occurs next. In step 494, in some examples, the plurality of threads are signaled to unwind and rewind. As shown, in some examples, step 495 occurs next. In step 495, in some examples, each time a thread in the plurality of threads completes rewinding, the reference counter associated with the hot patch is decremented.
[0057] As shown, in some examples, step 496 occurs next. In step 496, in some examples, in response to the reference counter reaching zero, resources associated with the hot patch are reclaimed as the executing binary file continues to execute. In some examples, this reclamation may include marking the logical patch slot associated with the hot patch as reusable alone or in conjunction with other operations. As shown, the process may then enter the return block to continue other processing.
[0058] in conclusion
[0059] Although the above specific embodiments describe certain examples of the present technology and describe the expected best mode, no matter how detailed the above content appears in this article, the present technology can be practiced in many ways. The specific details may vary in implementation, but are still included in the technology described herein. As mentioned above, the specific terms used when describing certain features or aspects of the present technology should not be regarded as implying that the term is being redefined in this article and is limited to any specific characteristics, features or aspects associated with the term. Generally, the terms used in the claims below should not be interpreted as limiting the present technology to the specific examples disclosed herein unless the specific embodiments clearly define such terms. Correspondingly, the actual scope of the present technology includes not only the disclosed examples, but also all equivalent ways of practicing or implementing the present technology.
Claims
1. A device for deploying multiple hot patches, comprising: A device comprising at least one memory and at least one processor, the at least one memory being adapted to store runtime data for the device, the at least one processor being adapted to execute processor executable code, the processor executable code in response to execution enabling the device to perform actions comprising: Providing multiple logical patch slots for patch images for hot patching of executing binaries; receiving a hot patch request, the hot patch request including a hot patch for the binary file being executed; assigning the hot patch to a first logical patch slot of the plurality of logical patch slots based at least in part on the first logical patch slot being inactive; executing the hot patch from the first logical patch slot, causing the first logical patch slot to become active; and Based at least in part on a second logical patch slot of the plurality of logical patch slots being active, unassigning the second logical patch slot, the second logical patch slot being different from the first logical patch slot, the second logical patch slot being associated with a patch generation, wherein unassigning the second logical patch slot comprises: signaling a first thread to unwind and rewind, the first thread being included in a plurality of threads running in the patch generation; In response to the first thread completing rewinding, decrementing a reference counter associated with the second logical patch slot, the reference counter corresponding to a cardinality of the plurality of threads running in the patch generation; In response to the reference counter reaching zero, the second logical patch slot is set to inactive.
2. The device according to claim 1, wherein: The executing binary file is an executing hypervisor. 3 . The apparatus of claim 1 , wherein the plurality of logical patch slots comprises two logical patch slots.
4. The apparatus according to claim 1, wherein the actions further comprise: In response to de-allocating the second logical patch slot, resources associated with the second logical patch slot are reclaimed. 5 . The apparatus of claim 1 , wherein executing the hot patch causes code in the executing binary file to be patched, and wherein executing the hot patch causes data in the executing binary file to be patched. The apparatus of claim 1 , wherein the executing binary file is an executing operating system kernel.
7. The apparatus of claim 6, wherein the executing operating system kernel is an executing hypervisor.
8. The apparatus according to claim 1, wherein the actions further comprise: In response to the execution of the hot patch, a reference counter associated with the hot patch is set to correspond to a cardinality of the plurality of threads. 9 . The apparatus of claim 8 , wherein in response to the first thread completing rewinding, in response to the associated function being called, the first thread enables the associated function according to the patched version of the associated function.
10. The apparatus of claim 8, wherein in response to the signaling of the first thread to unwind and rewind, when the first thread among the plurality of threads reaches a passive wait state, the first thread starts unwinding and rewinding.
11. A method for multiple hot patch deployment, comprising: receiving a specific request to apply a specific hotfix to an executing binary file, wherein a plurality of threads are running in a current image of the executing binary file, wherein the specific request to apply the specific hotfix is received after receiving a prior request to apply a prior hotfix to the executing binary file, and wherein the executing binary file has been executed without restarting at least all of a period between receiving the prior request and receiving the specific request; In response to the specific request to apply the specific hot patch, setting a reference counter associated with the specific hot patch to correspond to a base number of the plurality of threads that are running the current image of the executing binary file; Executing the specific hot patch; signaling a first thread of the plurality of threads to unwind and rewind, wherein the signaling is performed while the first thread is executing in a prior patch generation and while a second thread of the plurality of threads is executing in another patch generation, the prior patch generation corresponding to the prior hot patch, the another patch generation being older than the prior patch generation; Based on the first thread completing the rewinding, decrementing the reference counter associated with the particular hot patch; as well as In response to the reference counter associated with the particular hot patch reaching zero, resources associated with the particular hot patch are reclaimed as execution of the executing binary continues.
12. The method of claim 11, wherein the executing binary file is an executing operating system kernel.
13. The method of claim 11, wherein in response to the first thread completing the rewinding, in response to an associated function being called, the first thread enables the associated function according to a patched version of the associated function.
14. The method of claim 11, wherein in response to the signaling the first thread to unwind and rewind, the first thread among the plurality of threads starts unwinding and rewinding when the first thread reaches a passive wait state. 15 . The method of claim 11 , wherein executing the specific hot patch causes code in the executing binary file to be patched, and wherein executing the specific hot patch causes data in the executing binary file to be patched.
16. A processor-readable storage medium having stored thereon processor-executable code, the processor-executable code, when executed by at least one processor, enabling actions to be performed, the actions comprising: Executing an operating system kernel with limited execution guarantees such that multiple threads are running on a current image of the executing operating system kernel; After the start of execution of a previous hot patch of the executing operating system, and while a first thread among the plurality of threads is running in a different patch generation than a second thread among the plurality of threads, start execution of a specific hot patch for a kernel of the executing operating system, wherein the executing operating system is being executed without at least restarting all of the following period, the period being a period between the start of the execution of the previous hot patch and the start of the execution of the current hot patch; setting a counter associated with the particular hotfix to correspond to a cardinality of the plurality of threads; signaling the first of the plurality of threads to unwind and rewind; Based on the first thread completing the rewinding, decrementing the counter by one; and In response to the counter reaching zero, resources associated with the particular hot patch are reclaimed.
17. The processor-readable storage medium of claim 16, wherein the operating system kernel is a hypervisor.
18. The processor-readable storage medium of claim 16, wherein in response to the first thread of the plurality of threads completing rewinding, in response to an associated function being called, the first thread enables the associated function according to the patched version of the associated function.
19. The processor-readable storage medium of claim 16, wherein in response to the signaling of the first thread to unwind and rewind, the first thread among the plurality of threads starts unwinding and rewinding when the first thread reaches a passive wait state.
20. The processor-readable storage medium of claim 16, wherein execution of the specific hot patch causes code in the executing binary file to be patched, and execution of the specific hot patch causes data in the executing binary file to be patched.
