Thread (7 messages) 7 messages, 5 authors, 2023-02-10

Re: [PATCH v8 1/1] ptrace,syscall_user_dispatch: checkpoint/restore support for SUD

From: Andrei Vagin <hidden>
Date: 2023-02-09 20:29:54
Also in: lkml

On Tue, Jan 31, 2023 at 7:30 AM Gregory Price [off-list ref] wrote:
Implement ptrace getter/setter interface for syscall user dispatch.

These prctl settings are presently write-only, making it impossible to
implement transparent checkpoint/restore via software like CRIU.

'on_dispatch' field is not exposed because it is a kernel-internal
only field that cannot be 'true' when returning to userland.
Acked-by: Andrei Vagin <redacted>
Signed-off-by: Gregory Price <redacted>
<snip>
quoted hunk ↗ jump to hunk
diff --git a/include/uapi/linux/ptrace.h b/include/uapi/linux/ptrace.h
index 195ae64a8c87..6d2f3b86f932 100644
--- a/include/uapi/linux/ptrace.h
+++ b/include/uapi/linux/ptrace.h
@@ -112,6 +112,15 @@ struct ptrace_rseq_configuration {
        __u32 pad;
 };

+#define PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG 0x4210
+#define PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG 0x4211
+struct syscall_user_dispatch_config {
nit: all structures in this header have the ptrace prefix. I think it
is better to add it to this one too.
+       __u64 mode;
+       __s8 *selector;
+       __u64 offset;
+       __u64 len;
+};
+
 /*
  * These values are stored in task->ptrace_message
  * by ptrace_stop to describe the current syscall-stop.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help