The invention relates to a security dynamic hot patching device and method based on a privilege calling mechanism, and the method comprises the steps: carrying out the unified management of all patches which can be hot replaced during operation through a patch management module, and achieving the corresponding, version control and life cycle management of the patches and privilege calling numbers; in the patch activation process, a
system only modifies a call path comprising a symbol table or a
function pointer to realize a redirection strategy, so that an original function call
stream is guided to a privilege call skip bridge, and a privilege call mechanism is triggered to execute a patch function; the patch updating realizes version upgrading and multi-patch management by replacing the privilege call number and the mapping table item of the patch; during
rollback, only the binding relation between the call number and the function entry needs to be modified, and the task execution flow is recovered to the original function or the historical version patch; online management and real-time controllable
rollback of the patch are realized; the problem that a dynamic
hotfix technology is difficult to meet the requirements for safety, low invasiveness and
controllability at the same time is solved, safe takeover and dynamic replacement of function calling are achieved, and flexibility and safety are achieved.