criu/test
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
..
compel
cuda-checkpoint
exhaustive
inhfd
javaTests
jenkins
libfault
others
pki
plugins
zdtm zdtm: unregister rseq before zeroing the rseq area 2026-05-22 11:00:24 -07:00
.gitignore
abrt.sh
crit-recode.py
empty-netns-prep.sh
groups.desc
inhfd.desc
Makefile
pycriu
umount2.c
zdtm.desc
zdtm.py
zdtm_ct.c
zdtm_mount_cgroups
zdtm_umount_cgroups