criu

BPF Maps

BPF maps are kernel objects that store data used by BPF programs, typically in the form of key-value pairs. Applications access these maps via file descriptors. Checkpointing and restoring BPF maps involves serializing both their metadata and their data contents.

How CRIU Handles BPF Maps

Metadata Serialization

CRIU collects essential map attributes from several sources:

Data Serialization

To preserve the map’s contents, CRIU relies on batch operations:

Supported Map Types

CRIU currently supports data serialization for the following BPF map types:

For other map types, CRIU may be able to restore the map itself (metadata) but not its contents, depending on kernel support for batch operations on those types.

Frozen Maps

If a BPF map was marked as read-only (frozen) using bpf_map_freeze(), CRIU detects this state from fdinfo and reapplies the freeze during restoration after the data has been repopulated.

To-Do