CRIU can verify that regular files and shared libraries being restored on the destination host are identical to the ones captured during the checkpoint. This is a critical security and stability feature, as mismatching libraries (e.g., a different version of libc.so) can lead to immediate application crashes or subtle data corruption due to changed offsets and symbols.
File validation is managed via the --file-validation option. CRIU automatically captures metadata for all regular, file-backed mappings during the dump and stores it in the image files.
CRIU supports two primary methods for validating files:
Most modern Linux executables and shared libraries include a GNU Build-ID—a unique, compiler-generated hash stored in a dedicated ELF note section (NT_GNU_BUILD_ID).
BUILD_ID_MAP_SIZE) and extracts the Build-ID hash.filesize)A simpler and faster validation method that only compares the total size of the file in bytes.
stat() call.File validation is enabled by default using the buildid method. You can explicitly configure the behavior using the --file-validation flag:
# Explicitly use Build-ID validation
criu restore --file-validation buildid ...
# Use only file size validation
criu restore --file-validation filesize ...
File validation ensures that the restored process tree runs against the same binary environment it was captured in. This prevents “library injection” scenarios where an attacker might try to force a restored process to run against malicious versions of its original dependencies. It also ensures that internal pointers (such as function addresses) remain valid, as they are often tied to specific library versions.