Commit graph

12117 commits

Author SHA1 Message Date
Andrei Vagin
3ffae7028e docs: update Shared Memory documentation
- Explain the use of internal inode numbers (shmid) for anonymous sharing
- Detail the restoration of shared anonymous regions via memfd_create()
- Describe the 'master' vs 'slave' roles and futex synchronization
- Document System V IPC and file-backed shared mapping restoration
- Add references to kcmp and memory dumping optimizations

Signed-off-by: Andrei Vagin <avagin@google.com>
2026-06-04 11:29:31 -07:00
Andrei Vagin
1cf6de3140 docs: update Service Descriptors documentation
- Detail the top-down allocation strategy using RLIMIT_NOFILE
- Explain per-process isolation (service_fd_id) for shared FD tables
- Document the relocation mechanism (F_DUPFD_CLOEXEC, dup3)
- Describe the 'sfds_protected' flag and safety invariants
- List common Service FD types (LOG, IMG, RPC, TRANSPORT, etc.)

Signed-off-by: Andrei Vagin <avagin@google.com>
2026-06-04 11:29:31 -07:00
Andrei Vagin
42d84ec3af docs: update Restorer Context documentation
- Explain the necessity of a dedicated context for memory swapping
- Describe the shared restorer mapping and mremap-based re-positioning
- Detail the safe hole detection strategy to avoid VMA conflicts
- Document the final transition via sigreturn
- Highlight the characteristics of the freestanding PIE blob

Signed-off-by: Andrei Vagin <avagin@google.com>
2026-06-04 11:29:31 -07:00
Andrei Vagin
39f7aa6801 docs: update Restartable Sequences documentation
- Explain the sensitivity of rseq state to process execution
- Document the use of PTRACE_GET_RSEQ_CONF and external peeking
- Detail the critical requirement to unregister the restorer's own rseq
- Explain how re-registration and rseq_cs restoration ensure automatic kernel fixups
- Update kernel requirements (v5.13 for automated detection)

Signed-off-by: Andrei Vagin <avagin@google.com>
2026-06-04 11:29:31 -07:00
Andrei Vagin
7088ea61f0 docs: update Pidfd documentation
- Explain stable identification vs numeric PIDs
- Detail restoration of alive vs dead processes
- Document the 'helper process' trick for dead pidfds
- Explain the transition from anonymous inodes to pidfs (kernel v6.9+)
- Clarify current limitations (PIDFD_THREAD)

Signed-off-by: Andrei Vagin <avagin@google.com>
2026-06-04 11:29:31 -07:00
Andrei Vagin
192fef5745 docs: update Pidfd Store documentation
- Explain the PID reuse problem during iterative migration
- Document the use of pidfd_open() for race-free identification
- Detail the 'socket trick' for persistent FD storage via SCM_RIGHTS
- Explain the identity verification process in subsequent iterations
- List required kernel features (pidfd_open, pidfd_getfd)

Signed-off-by: Andrei Vagin <avagin@google.com>
2026-06-04 11:29:31 -07:00
Andrei Vagin
4a55bbd95d docs: update PID Restoration documentation
- Explain the legacy ns_last_pid interface and its limitations
- Detail the modern clone3() with set_tid mechanism (kernel v5.5+)
- Describe the benefits of atomic PID assignment and nested namespace support
- Mention automatic feature detection via Kerndat
- Document implementation using architecture-specific assembly wrappers

Signed-off-by: Andrei Vagin <avagin@google.com>
2026-06-04 11:29:31 -07:00
Andrei Vagin
fef712f9cf docs: update Pending Signals documentation
- Document the use of PTRACE_PEEKSIGINFO (kernel v3.10+) for dumping
- Explain the distinction between shared and private pending signals
- Detail the batch processing of signal queues
- Explain the usage of rt_sigqueueinfo and rt_tgsigqueueinfo for restoration
- Clarify the importance of PTRACE_GETSIGMASK

Signed-off-by: Andrei Vagin <avagin@google.com>
2026-06-04 11:29:31 -07:00
Andrei Vagin
db796d33bb docs: update Parasite Code documentation
- Detail the multi-stage infection process using ptrace
- Explain memory exchange optimization via memfd
- Describe the PIE relocation and GOT patching
- Explain the daemon mode and request-response control loop
- Document the 'cure' operation for returning tasks to their original state

Signed-off-by: Andrei Vagin <avagin@google.com>
2026-06-04 11:29:31 -07:00
Andrei Vagin
7443a89884 docs: update Pagemap Cache documentation
- Explain the 2MB sliding window (PMC_SIZE) mechanism
- Describe greedy prefetching for adjacent small VMAs
- Document the usage of ioctl(PAGEMAP_SCAN) on modern kernels
- Clarify cache invalidation strategies during dump phases
- Mention the CRIU_PMC_OFF environment variable for debugging

Signed-off-by: Andrei Vagin <avagin@google.com>
2026-06-04 11:29:31 -07:00
Andrei Vagin
cc02717798 docs: update Optimized Pre-dump Algorithm documentation
- Explain 'splice' (default) vs 'read' (traditional) pre-dump modes
- Detail the zero-copy gifting mechanism using vmsplice() and SPLICE_F_GIFT
- Explain how COW ensures consistency while capturing memory from running tasks
- Describe parallel draining of pages to minimize freeze time

Signed-off-by: Andrei Vagin <avagin@google.com>
2026-06-04 11:29:31 -07:00
Andrei Vagin
55e51add01 docs: update Mount V2 Detailed Algorithm documentation
- Formalize the stages of the Mount V2 engine
- Explain the role of the Root Yard (root_yard_mp)
- Describe pre-fork plain mounting and source resolution
- Detail propagation restoration via MOVE_MOUNT_SET_GROUP
- Explain the final pivot_root and post-fork fixup stages

Signed-off-by: Andrei Vagin <avagin@google.com>
2026-06-04 11:29:31 -07:00
Andrei Vagin
f4fdce3031 docs: update Mount V2 documentation
- Explain the shift from path-based to FD-based mounting
- Detail the use of detached mounts via open_tree() and fsopen()
- Describe propagation grouping via MOVE_MOUNT_SET_GROUP (v5.15+)
- Explain the tree construction and atomic final attachment process
- Update kernel requirements and fallback behavior

Signed-off-by: Andrei Vagin <avagin@google.com>
2026-06-04 11:29:31 -07:00
Andrei Vagin
4c8b25d525 docs: update Mount Points documentation
- Detail key information captured from /proc/pid/mountinfo
- Explain the restoration challenges (dependencies, propagation)
- Document the Mount V2 engine and its benefits
- Explain external mount mapping and auto-detection
- List common issues like overmounts and unsupported filesystems

Signed-off-by: Andrei Vagin <avagin@google.com>
2026-06-04 11:29:31 -07:00
Andrei Vagin
88b8800e49 docs: update Memory Images Deduplication documentation
- Explain the in_parent flag in pagemap entries
- Detail detection of unchanged pages via soft-dirty bit
- Document the --auto-dedup mode for dump and restore
- Describe online disk space reclamation using FALLOC_FL_PUNCH_HOLE
- Clarify image chaining and sparse file support

Signed-off-by: Andrei Vagin <avagin@google.com>
2026-06-04 11:29:31 -07:00
Andrei Vagin
d279bff3b1 docs: update Memory Dumping and Restoring documentation
- Detail the multi-stage dumping approach involving parasite injection
- Explain zero-copy dumping using vmsplice() and SPLICE_F_GIFT
- Describe the use of splice() for efficient image writing and page server transport
- Document VMA re-mapping and content filling during restoration
- Add references to COW preservation and lazy migration (userfaultfd)

Signed-off-by: Andrei Vagin <avagin@google.com>
2026-06-04 11:29:31 -07:00
Andrei Vagin
bf2f0a2986 docs: update Memory Changes Tracking documentation
- Explain the soft-dirty bit mechanism for tracking modified pages
- Document the usage of ioctl(PAGEMAP_SCAN) for efficient scanning (kernel v6.7+)
- Describe the iterative pre-dump workflow and image chaining
- Detail the consolidation of pages during restoration
- Mention the role of the page server in minimizing disk I/O

Signed-off-by: Andrei Vagin <avagin@google.com>
2026-06-04 11:29:31 -07:00
Andrei Vagin
85e6c3306d docs: update Mac-VLAN documentation
- Explain attribute extraction during checkpointing (Mode, Flags, Parent)
- Detail index preservation using IFLA_NEW_IFINDEX
- Document the --external macvlan[IFNAME]:OUTNAME option
- Improve overall structure and clarity

Signed-off-by: Andrei Vagin <avagin@google.com>
2026-06-04 11:29:31 -07:00
Andrei Vagin
42549734a9 docs: update Kerndat documentation
- Clarify feature detection for system calls, filesystems, and namespaces
- Update persistent caching locations (/run/criu.kdat vs XDG_RUNTIME_DIR)
- Distinguish between kerndat (host capabilities) and inventory (checkpoint metadata)
- Mention 'criu check --extra' for runtime inspection

Signed-off-by: Andrei Vagin <avagin@google.com>
2026-06-04 11:29:31 -07:00
Andrei Vagin
f00fc51a38 docs: update Kcmp Trees documentation
- Explain the kernel pointer comparison mechanism of kcmp()
- Describe the two-level red-black tree optimization (genid + kcmp sub-tree)
- List all supported KCMP_* types (FILE, VM, FILES, FS, EPOLL_TFD, etc.)
- Clarify how genid minimizes expensive system calls

Signed-off-by: Andrei Vagin <avagin@google.com>
2026-06-04 11:29:31 -07:00
Andrei Vagin
1d6cac0bba docs: update Irmap documentation
- Describe the (inode, device) to path resolution problem
- List default heuristic scan hints (/etc, /var/log, etc.)
- Explain user-defined scan paths via --irmap-scan-path
- Detail the pre-dump optimization and irmap-cache.img
- Clarify the status of Irmap vs open_by_handle_at on modern kernels

Signed-off-by: Andrei Vagin <avagin@google.com>
2026-06-04 11:29:31 -07:00
Andrei Vagin
8b43ce4050 docs: update Invisible Files documentation
- Explain path loss scenarios (unlinked, virtual files, mount shadowing)
- Detail the Ghost File strategy (link count 0) and optimization (fiemap)
- Document the Link-Remap strategy (link count > 0) via linkat()
- Explain the PID helper (TASK_HELPER) mechanism for virtual files
- Clarify handling for NFS Silly Rename and OverlayFS

Signed-off-by: Andrei Vagin <avagin@google.com>
2026-06-04 11:29:31 -07:00
Andrei Vagin
48b47d17e7 docs: update Re-opening Nameless Files documentation
- Explain path loss in fsnotify instances
- Describe the open_by_handle_at() mechanism and kernel integration
- Detail the Irmap brute-force scanning strategy
- Mention filesystem-specific behaviors (Tmpfs, OverlayFS)

Signed-off-by: Andrei Vagin <avagin@google.com>
2026-06-04 11:29:31 -07:00
Andrei Vagin
d166406d6f docs: update Descriptor Assignment documentation
- Formalize Master and Slave descriptor roles
- Explain the SCM_RIGHTS distribution mechanism
- Document transport socket naming and 'criu_run_id' usage
- Detail deterministic master selection to avoid deadlocks
- Explain dynamic service FD relocation during collisions

Signed-off-by: Andrei Vagin <avagin@google.com>
2026-06-04 11:29:31 -07:00
Andrei Vagin
9e3cde7b9e docs: update Re-opening Files documentation
- Explain non-blocking techniques for FIFOs
- Detail link-remap and ghost file strategies for unlinked files
- Document mount namespace (mnt_id) and open_ns_root usage
- Explain fown restoration (F_SETOWN_EX, UID switching, F_SETSIG)
- Clarify flag sanitization and O_PATH handling

Signed-off-by: Andrei Vagin <avagin@google.com>
2026-06-04 11:29:31 -07:00
Andrei Vagin
3919b1bdb3 docs: update FSNotify documentation
- Detail the challenges of finding the 'watchee' path
- Explain the use of open_by_handle_at() and Irmap
- Explicitly document that pending events are dropped with a warning
- Explain how spurious events are generated during restore (ghost files)
- Add details for Fanotify inode and mount marks

Signed-off-by: Andrei Vagin <avagin@google.com>
2026-06-04 11:29:31 -07:00
Andrei Vagin
7cda181cf0 docs: update Freezing the Process Tree documentation
- Explain the PTRACE_SEIZE and PTRACE_INTERRUPT sequence
- Detail the transparency of ptrace-stop (TRAP_STOP)
- Document cgroup v1 and v2 freezer mechanisms
- Mention kernel kludges for v1 freezer unreliability
- Clarify the relationship between freezer and ptrace

Signed-off-by: Andrei Vagin <avagin@google.com>
2026-06-04 11:29:31 -07:00
Andrei Vagin
2652af8ba0 docs: update Process Tree Final States documentation
- Formalize TASK_ALIVE, TASK_STOPPED, and TASK_DEAD states
- Explain the rationale for default behaviors in dump/restore
- Mention pre-dump enforcement of the Running state
- Document the use of --leave-stopped for debugging
- Add instructions for resuming trees via SIGCONT and pstree_cont.py

Signed-off-by: Andrei Vagin <avagin@google.com>
2026-06-04 11:29:31 -07:00
Andrei Vagin
20c09d50be docs: update Filesystem Peculiarities documentation
- Explain BTRFS virtual vs physical device ID resolution
- Detail NFS 'Silly Rename' handling for unlinked files
- Document OverlayFS path inconsistencies and linkat() fallback logic
- Clarify legacy AUFS branch path fixes

Signed-off-by: Andrei Vagin <avagin@google.com>
2026-06-04 11:29:31 -07:00
Andrei Vagin
e3126cd73e docs: update File Restoration Engine (fdinfo) documentation
- Formalize the Master and Slave descriptor concepts
- Describe the 'open()' state machine and early FD distribution via SCM_RIGHTS
- Document the inter-process synchronization (set_fds_event, futexes)
- List key dependencies (TTYs, Unix Sockets, Epoll)
- Add notes on Service FDs and restoration ordering

Signed-off-by: Andrei Vagin <avagin@google.com>
2026-06-04 11:29:31 -07:00
Andrei Vagin
50a258193d docs: update FAQ documentation
- Clarify dirty page dumping in read-only mappings
- Add instructions for using 'criu check --extra'
- Detail PID mismatch solutions and internal interfaces (clone3)
- Expand on external Unix socket limitations
- Update guidance for Docker and container filesystem consistency

Signed-off-by: Andrei Vagin <avagin@google.com>
2026-06-04 11:29:31 -07:00
Andrei Vagin
124ac79cec docs: update Dumping Files documentation
- Detail the Linux file object hierarchy (Inode, Dentry, File)
- Explain the SCM_RIGHTS mechanism for retrieving local FD copies
- Describe the gen_id and kcmp optimization for shared file detection
- Clarify the two-tier image storage structure (fdinfo vs specialized images)

Signed-off-by: Andrei Vagin <avagin@google.com>
2026-06-04 11:29:31 -07:00
Andrei Vagin
4524fb86ca docs: update DMTCP comparison documentation
- Formalize the architectural comparison (userspace vs. kernel integration)
- Highlight the dangers of DMTCP's fake PID virtualization
- Explain CRIU's usage of ns_last_pid and clone3 for real PID restoration
- Improve overall technical clarity and structure

Signed-off-by: Andrei Vagin <avagin@google.com>
2026-06-04 11:29:31 -07:00
Andrei Vagin
c993a747ff docs: update COW memory documentation
- Explain the identification of COW candidates by comparing parent/child VMAs
- Describe the pre-mapping strategy before fork to leverage kernel sharing
- Detail the content verification and manual COW triggering
- Document the use of madvise(MADV_DONTNEED) for final memory layout accuracy
- Clarify current limitations regarding reparenting and VMA movement

Signed-off-by: Andrei Vagin <avagin@google.com>
2026-06-04 11:29:31 -07:00
Andrei Vagin
506559680e docs: update Comparison to other CR projects documentation
- Embed DMTCP description and characteristics
- Update CRIU supported architectures (s390, MIPS, RISC-V, etc.)
- Refine the comparison table for accuracy and modern features
- Add more context for BLCR, PinPlay, and Legacy OpenVZ

Signed-off-by: Andrei Vagin <avagin@google.com>
2026-06-04 11:29:31 -07:00
Andrei Vagin
ae7abf7adf docs: update Code Blobs documentation
- Document the use of 'compel hgen' for header generation
- Update the example header format to include structured relocations
- Describe the 'parasite_blob_desc' setup functions
- Refine the build procedure steps

Signed-off-by: Andrei Vagin <avagin@google.com>
2026-06-04 11:29:31 -07:00
Andrei Vagin
ec36774aea docs: update Checkpoint/Restore architecture documentation
- Clarify freezing mechanisms (PTRACE_INTERRUPT, Freezer CGroup)
- Detail the parasite injection and bootstrap process
- Explain the role of the restorer blob as a PIE and its conflict avoidance
- Document the final transition via sigreturn

Signed-off-by: Andrei Vagin <avagin@google.com>
2026-06-04 11:29:31 -07:00
Andrei Vagin
76c5e865c3 docs: update IP address change documentation
- Explain the core problem of TCP 4-tuple mismatch
- Describe solutions for listening, in-flight, and established sockets
- Document the UPDATE_INETSK plugin hook for programmatic IP remapping
- Add a summary table of options and flags

Signed-off-by: Andrei Vagin <avagin@google.com>
2026-06-04 11:29:31 -07:00
Andrei Vagin
f8cf60f6ca docs: update CGroups documentation
- Document full CGroup v2 support and properties
- Explain CGroup namespace (CLONE_NEWCGROUP) handling
- Clarify the 'soft mode' default and other restoration strategies
- Detail the root mount requirement for bind-mounted subgroups

Signed-off-by: Andrei Vagin <avagin@google.com>
2026-06-04 11:29:31 -07:00
Andrei Vagin
310335a47b docs: update BPF maps documentation
- Explain metadata collection from /proc and BPF syscall
- Describe data serialization using batch operations
- Add details about frozen maps handling
- Clarify current limitations regarding map_extra and BTF

Signed-off-by: Andrei Vagin <avagin@google.com>
2026-06-04 11:29:31 -07:00
Andrei Vagin
a1169d44cf docs: update AIO documentation
- Explain how CRIU restores AIO context IDs and ring buffers
- Describe the tail synchronization technique using dummy /dev/null requests
- Clarify the lack of support for in-flight events and its implications

Signed-off-by: Andrei Vagin <avagin@google.com>
2026-06-04 11:29:31 -07:00
Andrei Vagin
ad16fecf55 docs: update 32-bit tasks C/R documentation
- Replace FIXME with a detailed description of the current approach
- Explain architecture detection using PTRACE_GETREGSET
- Describe the restoration process via sigreturn and mode switching
- Update vsyscall handling details
- Clarify the status of x32 support and TIF_IA32 removal

Signed-off-by: Andrei Vagin <avagin@google.com>
2026-06-04 11:29:31 -07:00
Andrei Vagin
5c6eaebf04 docs: improve formatting in 'under-the-hood' documentation
Signed-off-by: Andrei Vagin <avagin@gmail.com>
Signed-off-by: Andrei Vagin <avagin@google.com>
2026-06-04 11:29:31 -07:00
Andrei Vagin
d0e0ac4520 doc: export under-the-hood documentations from criu.org
Signed-off-by: Andrei Vagin <avagin@gmail.com>
Signed-off-by: Andrei Vagin <avagin@google.com>
2026-06-04 11:29:31 -07:00
Dan Feigin
5141fbcca8 pie: restore VMA pages with native AIO
Private anonymous VMA contents have to be copied inside the PIE
restorer after mappings are placed at their final addresses.
Replace the synchronous preadv loop with a bounded Linux native AIO
window that submits page-read iovecs, reaps completions, and
resubmits short reads.

Keep auto-dedup punching on completed byte ranges and tear down the
AIO context on both success and error paths. The pages fd is
prepared for O_DIRECT before entering the restorer.

VMA page reads are page-aligned by construction: the destination
buffers are page-aligned, the iovec lengths are page multiples, and
the file offsets are page-aligned. O_DIRECT completions are
therefore always a whole number of pages (short reads only occur at
MAX_RW_COUNT or at EOF on page-multiple files), so resubmitting a
short read keeps its offset and buffers aligned without masking the
completion length.

Assisted-by: Claude:claude-sonnet-4-6
Assisted-by: Claude:claude-opus-4-7
Assisted-by: Codex:gpt-5
Signed-off-by: Dan Feigin <dfeigin@nvidia.com>
2026-06-01 14:25:13 -07:00
Dan Feigin
258be469fb shmem: batch page reads with PR_ASYNC
Shared-memory restore currently issues page reads one pagemap entry
at a time. Use the existing PR_ASYNC path to enqueue shmem and
memfd-shmem reads, then flush each batch with one async-queue sync
pass.

Restore shmem, sysv-shmem and memfd-shmem content through a single
flat do_restore_shmem_content() loop that owns its page_read, and
map the memfd the same way as anonymous shmem so both share one
restore path instead of an extra temporary mapping.

Shmem segments are mapped via mmap() (page-aligned addresses) and
the pagemap offsets are PAGE_SIZE multiples, so the batched reads
are page-aligned and need no special O_DIRECT alignment handling.

Assisted-by: Claude:claude-sonnet-4-6
Assisted-by: Claude:claude-opus-4-7
Assisted-by: Codex:gpt-5
Signed-off-by: Dan Feigin <dfeigin@nvidia.com>
2026-06-01 14:25:13 -07:00
Dan Feigin
b665c7333c pagemap/mem: probe O_DIRECT for page reads
Native AIO page restore needs the pages image fd to support direct
I/O, but some filesystems accept O_DIRECT with fcntl() and reject
the first read with EINVAL.

Enable O_DIRECT after the image headers are read, probe with an
aligned read, and fall back to buffered sequential I/O when the
probe reports EINVAL. Cache the result in page_read so normal page
reads do not need a flag lookup per request.

The streamer fd (opts.stream) is excluded from the probe because
its read loop uses arbitrary user buffers that are not aligned for
O_DIRECT.

PAGE_SIZE is not a compile-time constant on aarch64 (sysconf-backed
runtime value to support 4K/16K/64K kernels), so the probe buffer
is allocated with posix_memalign() instead of a stack array with
__attribute__((aligned(PAGE_SIZE))).

The single-page COW comparison buffer in restore_priv_vma_content()
is likewise allocated with posix_memalign() so direct reads into it
are page-aligned; this lets the local read path drop its per-read
bounce buffer.

Assisted-by: Claude:claude-sonnet-4-6
Assisted-by: Claude:claude-opus-4-7
Assisted-by: Codex:gpt-5
Signed-off-by: Dan Feigin <dfeigin@nvidia.com>
2026-06-01 14:25:13 -07:00
Dan Feigin
1cb90031d9 compel: add io_destroy syscall
The restorer already has io_setup, io_submit, and io_getevents
syscall wrappers for all supported architectures. Native AIO restore
also needs io_destroy to release the AIO context before leaving the
restorer path.

Add the missing io_destroy syscall entries next to the existing
native AIO syscalls.

Assisted-by: Claude:claude-sonnet-4-6
Signed-off-by: Dan Feigin <dfeigin@nvidia.com>
2026-06-01 14:25:13 -07:00
Adrian Reber
4d76d1acdc ci: shard alpine-test into parallel jobs to reduce CI time
The alpine-test CI job runs all ~483 zdtm tests sequentially three
times (normal, mntns-compat-mode, criu-config), followed by many
non-shardable tests. This dominates overall CI wait time. With only
2 jobs running in parallel (GCC and CLANG) the alpine tests take
around 30 minutes.

Use the existing --test-shard-index and --test-shard-count flags
already built into test/zdtm.py to split the zdtm test suite across
four parallel runners (shards 0-3). A fifth shard runs all
non-shardable tests (lazy pages, fault injection, test/others/*,
rootless, compel, plugins, etc.) independently and in parallel with
the zdtm shards. This increases parallelism from 2 to 10 jobs and
reduces the alpine test wall-clock time from ~30 to ~10 minutes.

Changes:
- run-ci-tests.sh: Build SHARD_OPTS from ZDTM_SHARD_INDEX/COUNT
  env vars and pass them to zdtm.py. Extract all non-shardable
  tests into a run_non_shardable_tests() function. Dispatch based
  on shard index: 0-3 run zdtm slices, 4 runs non-shardable
  tests, unset runs everything sequentially (preserving existing
  behavior). Validate that ZDTM_SHARD_INDEX is set when
  ZDTM_SHARD_COUNT is set.
- Makefile: Pass ZDTM_SHARD_INDEX and ZDTM_SHARD_COUNT into the
  container when set. Split long container run command across
  multiple lines for readability.
- ci.yml: Add shard: [0, 1, 2, 3, 4] to the alpine-test matrix,
  producing 10 jobs (2 compilers x 5 shards). Job labels now show
  descriptive shard names (e.g. "zdtm 1/4", "non-zdtm") instead
  of raw indices.

When sharding is not configured the script behaves identically to
before, so other CI jobs (aarch64, compat, gcov, etc.) are
unaffected.

Assisted-by: Claude:claude-opus-4-6
Signed-off-by: Adrian Reber <areber@redhat.com>
2026-05-24 07:19:51 +01:00
Adrian Reber
da5b7bf829 zdtm: unregister rseq before zeroing the rseq area
Starting with Linux 7.1, the kernel enforces strict read-only field
protection for the rseq V2 ABI. Userspace is no longer allowed to
modify kernel-managed fields (cpu_id_start, cpu_id, node_id, mm_cid)
while rseq is registered. Violations are detected on the next context
switch and the offending process is killed with SIGSEGV.

The rseq01 test was zeroing the entire glibc-registered rseq area
with memset() before calling test_init(), which internally calls
fork(). This corrupted the read-only fields while the glibc rseq
registration was still active, causing the kernel to send SIGSEGV
during the fork.

Fix this by calling unregister_old_rseq() before the memset in both
main() and thread_routine(), so the kernel is no longer monitoring
those fields when they are zeroed. The subsequent register_thread()
call re-registers rseq with the clean area.

Link: 7f00232152

Assisted-by: Claude Code (https://claude.ai/code):claude-opus-4-6
Signed-off-by: Adrian Reber <areber@redhat.com>
2026-05-22 11:00:24 -07:00