The Restorer Context refers to the final stage of the restoration process, where a CRIU process “morphs” itself into the target application. This critical transition is performed by a specialized PIE blob known as the Restorer PIE.
During the final stage of restoration, CRIU must accomplish two conflicting goals:
While these operations are occurring, some code must remain in the address space to execute the necessary munmap() and mmap() system calls. The Restorer PIE is designed to reside in a temporary “safe hole” in the address space—a range that does not conflict with either CRIU’s temporary mappings or the application’s final layout.
mm.img file) to find a contiguous area large enough to hold the restorer code and its stack.mremap() to move the shared restorer blob to its specific safe hole.sigreturn(). The restorer prepares a special signal frame on the stack containing the application’s original register state (including the instruction pointer). The kernel then loads this state, effectively resuming the application from the exact point of the checkpoint.Because the restorer runs in an environment where standard libraries have been unmapped, it is a freestanding Position-Independent Executable. It contains its own minimal assembly-level system call wrappers and does not depend on glibc or any external runtime.
The algorithm for finding the “safe hole” is architecture-specific. It must account for various kernel-mapped regions like the vDSO, the stack, and potential guard pages to ensure that the restorer code never overlaps with memory that the application needs.