criu/test
Andrei Vagin 3f37798594
zdtm: add rseq parasite collision avoidance test
Add a transition test to verify that CRIU correctly avoids active rseq
critical sections when selecting an address for parasite code injection
and execution during checkpointing.

If CRIU were to inject parasite blobs or execute parasite syscalls
inside an active restartable sequence critical section, kernel
preemption hooks (`rseq_handle_notify_resume`) would trigger sequence
aborts or fixups, clobbering userspace memory or breaking parasite
execution.

- Emulates a spinning worker loop (`while (futex_get(f) == 0)`) inside
  an active rseq critical section so the thread is consistently inside
  `[start_ip, start_ip + post_commit_offset)` when CRIU initiates
  checkpointing.
- Dynamically sets and clears `__rseq_abi.rseq_cs` inside the assembly
  block (`start_ip`), adhering to the rseq protocol where critical
  section descriptors must only be active during critical section
  execution.
- Configures `abort_ip` to return (`ret`) out of the assembly function
  back to `test_waitsig_rseq()`, where a wrapper loop re-invokes the
  function if C/R is still in progress or an interruption occurs.

Signed-off-by: Andrei Vagin <avagin@google.com>
Reviewed-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@futurfusion.io>
2026-07-20 11:23:01 +02:00
..
compel Run 'make indent' on header files 2021-09-03 10:31:00 -07:00
cuda-checkpoint test: add get-state to mocked cuda-checkpoint tool 2025-03-21 12:40:31 -07:00
exhaustive make: remove checks for python 2 binary 2023-10-22 13:29:25 -07:00
inhfd Remove travis-ci leftovers 2025-11-02 07:48:23 -08:00
javaTests test/javaTests: update org.testng:testng (Maven) 2023-04-15 21:17:21 -07:00
jenkins ci: consolidate action-script tests 2025-11-05 15:41:34 -08:00
libfault zdtm: add support for LD_PRELOAD tests 2024-09-11 16:02:11 -07:00
others test: libcriu: use installed headers and library 2026-07-20 11:23:01 +02:00
pki test: create new tls certificates 2021-09-03 10:31:00 -07:00
plugins zdtm: add inventory test plugins 2025-03-21 12:40:31 -07:00
zdtm zdtm: add rseq parasite collision avoidance test 2026-07-20 11:23:01 +02:00
.gitignore zdtm: Add javaTests output to .gitignore 2021-09-03 10:31:00 -07:00
abrt.sh test/abrt: skip core dumps from the seccomp_filter test 2019-04-20 20:25:26 -07:00
crit-recode.py make: remove checks for python 2 binary 2023-10-22 13:29:25 -07:00
empty-netns-prep.sh test: don't use nsenter in tests 2017-05-19 09:17:20 +03:00
groups.desc zdtm.py: Generator of groups of tests 2015-12-08 14:54:41 +03:00
inhfd.desc zdtm.py: Add inhfd tests for --inherit-fd option 2015-10-19 12:42:01 +03:00
Makefile test/make: remove unused target 2024-09-11 16:02:11 -07:00
pycriu lib: use separate packages for pycriu and crit 2023-11-27 16:47:16 -08:00
umount2.c zdtm: add a program to umount a test root 2016-09-26 15:42:40 +03:00
zdtm.desc test: Get rid of live directory 2016-02-20 13:40:52 +03:00
zdtm.py zdtm: Remove junit_xml leftovers 2025-11-02 07:48:23 -08:00
zdtm_ct.c zdtm: Update netns purpose comment in zdtm_ct. 2023-10-22 13:29:25 -07:00
zdtm_mount_cgroups zdtm: use unique holder for cgroups 2022-04-28 17:53:52 -07:00
zdtm_umount_cgroups zdtm: use unique holder for cgroups 2022-04-28 17:53:52 -07:00