criu/test/zdtm/transition
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
..
epoll.c zdtm/transition/epoll: don't rely on errno in case of zero return 2023-04-15 21:17:21 -07:00
fifo_dyn.c Run 'make indent' on all C files 2021-09-03 10:31:00 -07:00
fifo_dyn.desc test: Get rid of live directory 2016-02-20 13:40:52 +03:00
fifo_loop.c Run 'make indent' on all C files 2021-09-03 10:31:00 -07:00
file_aio.c Run 'make indent' on all C files 2021-09-03 10:31:00 -07:00
file_read.c Run 'make indent' on all C files 2021-09-03 10:31:00 -07:00
fork.c Run 'make indent' on all C files 2021-09-03 10:31:00 -07:00
fork2.c test: Get rid of live directory 2016-02-20 13:40:52 +03:00
ipc.c ci: fix new codespell errors 2023-10-22 13:29:25 -07:00
ipc.desc test: Get rid of live directory 2016-02-20 13:40:52 +03:00
lazy-thp.c ci: fix new codespell errors 2023-10-22 13:29:25 -07:00
Makefile zdtm: add rseq parasite collision avoidance test 2026-07-20 11:23:01 +02:00
maps007.c ci: fix make indent 2023-04-15 21:17:21 -07:00
maps007.desc test: Get rid of live directory 2016-02-20 13:40:52 +03:00
maps008.c Run 'make indent' on all C files 2021-09-03 10:31:00 -07:00
maps008.desc test: add test for anon shmem dedup 2016-09-06 19:31:19 +03:00
netlink00.c Run 'make indent' on all C files 2021-09-03 10:31:00 -07:00
netlink00.desc test: Get rid of live directory 2016-02-20 13:40:52 +03:00
pid_reuse.c zdtm: check that pid-reuse does not break iterative memory dump 2018-07-09 18:26:52 +03:00
pid_reuse.desc zdtm: check that pid-reuse does not break iterative memory dump 2018-07-09 18:26:52 +03:00
pidfd_store_sk.c zdtm: add pidfd store based pid reuse test 2021-09-03 10:31:00 -07:00
pidfd_store_sk.desc zdtm: add pidfd store based pid reuse test 2021-09-03 10:31:00 -07:00
pipe_loop00.c Run 'make indent' on all C files 2021-09-03 10:31:00 -07:00
pipe_shared00.c Run 'make indent' on all C files 2021-09-03 10:31:00 -07:00
ptrace.c clang-format: do automatic comment fixups 2022-04-28 17:53:52 -07:00
ptrace.desc test: Get rid of live directory 2016-02-20 13:40:52 +03:00
rseq01.c zdtm: unregister rseq before zeroing the rseq area 2026-07-19 19:52:27 +02:00
rseq01.desc zdtm: add transition/rseq01 test for amd64 2022-04-28 17:53:52 -07:00
rseq02.c zdtm: add rseq02 transition test with NO_RESTART CS flag 2022-04-28 17:53:52 -07:00
rseq02.desc zdtm: temporary disable rseq02 test 2022-04-28 17:53:52 -07:00
rseq03.c zdtm: add rseq parasite collision avoidance test 2026-07-20 11:23:01 +02:00
rseq03.desc zdtm: add rseq parasite collision avoidance test 2026-07-20 11:23:01 +02:00
shmem.c Run 'make indent' on all C files 2021-09-03 10:31:00 -07:00
socket-tcp.c test: Get rid of live directory 2016-02-20 13:40:52 +03:00
socket-tcp.desc join-ns: Fix join-ns zdtm test 2016-06-01 14:52:21 +03:00
socket-tcp6.c test: Get rid of live directory 2016-02-20 13:40:52 +03:00
socket-tcp6.desc join-ns: Fix join-ns zdtm test 2016-06-01 14:52:21 +03:00
socket_loop00.c Run 'make indent' on all C files 2021-09-03 10:31:00 -07:00
stack.c compel: Add test to check parasite stack setup 2023-04-15 21:17:21 -07:00
thread-bomb.c Run 'make indent' on all C files 2021-09-03 10:31:00 -07:00
thread-bomb.desc test: Get rid of live directory 2016-02-20 13:40:52 +03:00
unix_sock.c Run 'make indent' on all C files 2021-09-03 10:31:00 -07:00