-
Notifications
You must be signed in to change notification settings - Fork 608
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cr-restore: rseq: dynamically handle *libc with rseq #1937
cr-restore: rseq: dynamically handle *libc with rseq #1937
Conversation
Before this patch we assumed that CRIU is compiled against the same GLibc as it runs with. But as we see from real world examples like checkpoint-restore#1935 it's not always true. The idea of this patch is to detect rseq configuration for the main CRIU process and use it to unregister rseq for all further child processes. It's correct, because we restore pstree using clone*() syscalls, don't use exec*() (!) syscalls, so rseq gets inherited in the kernel and rseq configuration remains the same for all children processes. This will prevent issues like this: checkpoint-restore#1935 Suggested-by: Florian Weimer <[email protected]> Signed-off-by: Alexander Mikhalitsyn <[email protected]>
Would it make sense to remove the glibc-specific code, so that the generic code receives wider test coverage? If you fork & ptrace anyway to get other things, the additional overhead will be really small, I assume. |
Let's use dynamic approach to detect built-in *libc rseq in all cases, and "old" static approach as a fallback path if the user kernel lacks support of ptrace_get_rseq_conf feature. Suggested-by: Florian Weimer <[email protected]> Signed-off-by: Alexander Mikhalitsyn <[email protected]>
agreed, Florian. Have done ;) I've left "old approach" only as a fallback |
Codecov Report
@@ Coverage Diff @@
## criu-dev #1937 +/- ##
============================================
+ Coverage 68.98% 70.63% +1.64%
============================================
Files 128 130 +2
Lines 33349 33574 +225
============================================
+ Hits 23005 23714 +709
+ Misses 10344 9860 -484
Continue to review full report at Codecov.
|
LGTM |
Before this patch we assumed that CRIU is compiled against
the same GLibc as it runs with. But as we see from real
world examples like #1935 it's not always true.
The idea of this patch is to detect rseq configuration
for the main CRIU process and use it to unregister
rseq for all further child processes. It's correct,
because we restore pstree using clone*() syscalls,
don't use exec*() (!) syscalls, so rseq gets inherited
in the kernel and rseq configuration remains the same
for all children processes.
This will prevent issues like this:
#1935
Suggested-by: Florian Weimer [email protected]
Signed-off-by: Alexander Mikhalitsyn [email protected]