Back to results
US 10,310,863 B1Granted
Patching functions in use on a running computer system
AssigneeRed Hat, Inc.
InventorsJoshua Nathan Poimboeuf, Steven David Rostedt
Life of this patent
Estimating the term…
Abstract
A mechanism for patching functions in use on a running computer system. A method includes modifying an original function to call a hot patch function. The hot patch function transfers execution control from the original function to a replacement function.
Claims17
A method comprising:
- receiving a call to an original function;
- modifying, by a processing device, the original function to call a hot patch function to transfer execution control from the original function to a replacement function by changing an initial instruction in the original function that specifies no operation to be executed to specifying that the call to the hot patch function is to be executed, wherein the hot patch function is conditionally applied to replace the original function in view of a number of calls to the original function that have been received by applying the hot patch function for a particular call for every defined number of calls that have been received and not applying the hot patch function for remaining calls for every defined number of calls that have been received;
- changing, by the processing device, a value of a pointer, in a data structure identifying a plurality of original functions used by an operating system, from an original memory location associated with the original function to a replacement memory location associated with the replacement function;
- executing, by the processing device, the replacement function using the pointer to the replacement memory location associated with the replacement function in the data structure identifying the plurality of original functions used by the operating system;
- and
- returning, by the processing device, to a caller of the original function in response to executing the replacement function.
3 more elements
A system comprising:
- a memory;
- a processing device, operatively coupled with the memory, to:
- receive a call to an original function;
- modify the original function to call a hot patch function to transfer execution control from the original function to a replacement function by changing an initial instruction in the original function that specifies no operation to be executed to specifying that the call to the hot patch function is to be executed, wherein the hot patch function is conditionally applied to replace the original function in view of a number of calls to the original function that have been received by applying the hot patch function for a particular call for every defined number of calls that have been received and not applying the hot patch function for remaining calls for every defined number of calls that have been received;
- change a value of a pointer, in a data structure identifying a plurality of original functions used by an operating system, from an original memory location associated with the original function to a replacement memory location associated with the replacement function;
- execute the replacement function using the pointer to the replacement memory location associated with the replacement function in the data structure identifying the plurality of original functions used by the operating system;
- and
- return to a caller of the original function in response to executing the replacement function.
5 more elements
A non-transitory machine-readable storage medium comprising data, when accessed by a processing device, cause the processing device to:
- receive a call to an original function;
- modify, by the processing device, the original function to call a hot patch function to transfer execution control from the original function to a replacement function by changing an initial instruction in the original function that specifies no operation to be executed to specifying that the call to the hot patch function is to be executed, wherein the hot patch function is conditionally applied to replace the original function in view of a number of calls to the original function that have been received by applying the hot patch function for a particular call for every defined number of calls that have been received and not applying the hot patch function for remaining calls for every defined number of calls that have been received;
- change, by the processing device, a value of a pointer, in a data structure identifying a plurality of original functions used by an operating system, from an original memory location associated with the original function to a replacement memory location associated with the replacement function;
- execute, by the processing device, the replacement function using the pointer to the replacement memory location associated with the replacement function in the data structure identifying the plurality of original functions used by the operating system;
- and
- return, by the processing device, to a caller of the original function in response to executing the replacement function.
3 more elements
Dependencies are inferred from the claim text.