All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] Checkpoint Support for Syscall User Dispatch
@ 2023-01-18 20:10 Gregory Price
  2023-01-18 20:10 ` [PATCH 1/3] ptrace,syscall_user_dispatch: Implement Syscall User Dispatch Suspension Gregory Price
                   ` (2 more replies)
  0 siblings, 3 replies; 21+ messages in thread
From: Gregory Price @ 2023-01-18 20:10 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-fsdevel, linux-doc, linux-kselftest, krisman, tglx, luto,
	oleg, peterz, ebiederm, akpm, adobriyan, corbet, shuah,
	Gregory Price


v2: Implements the getter/setter interface in ptrace rather than prctl

Syscall user dispatch makes it possible to cleanly intercept system
calls from user-land.  However, most transparent checkpoint software
presently leverages some combination of ptrace and system call
injection to place software in a ready-to-checkpoint state.

If Syscall User Dispatch is enabled at the time of being quiesced,
injected system calls will subsequently be interposed upon and
dispatched to the task's signal handler.

This patch set implements 3 features to enable software such as CRIU
to cleanly interpose upon software leveraging syscall user dispatch.

- Implement PTRACE_O_SUSPEND_SYSCALL_USER_DISPATCH, akin to a similar
  feature for SECCOMP.  This allows a ptracer to temporarily disable
  syscall user dispatch, making syscall injection possible.

- Implement an fs/proc extension that reports whether Syscall User
  Dispatch is being used in proc/status.  A similar value is present
  for SECCOMP, and is used to determine whether special logic is
  needed during checkpoint/resume.

- Implement a getter interface for Syscall User Dispatch config info.
  To resume successfully, the checkpoint/resume software has to
  save and restore this information.  Presently this configuration
  is write-only, with no way for C/R software to save it.
	This was done in ptrace because syscall user dispatch is not part of
  uapi.  The syscall_user_dispatch_config structure was added to the
  ptrace exports.


Signed-off-by: Gregory Price <gregory.price@memverge.com>

Gregory Price (3):
  ptrace,syscall_user_dispatch: Implement Syscall User Dispatch
    Suspension
  fs/proc/array: Add Syscall User Dispatch to proc status
  ptrace,syscall_user_dispatch: add a getter/setter for sud
    configuration

 .../admin-guide/syscall-user-dispatch.rst     |  5 +-
 fs/proc/array.c                               |  8 +++
 include/linux/ptrace.h                        |  2 +
 include/linux/syscall_user_dispatch.h         | 19 +++++++
 include/uapi/linux/ptrace.h                   | 16 +++++-
 kernel/entry/syscall_user_dispatch.c          | 54 +++++++++++++++++++
 kernel/ptrace.c                               | 14 +++++
 7 files changed, 116 insertions(+), 2 deletions(-)

-- 
2.39.0


^ permalink raw reply	[flat|nested] 21+ messages in thread
* [PATCH v5 0/3] Checkpoint Support for Syscall User Dispatch
@ 2023-01-23  3:29 Gregory Price
  2023-01-23  3:29 ` [PATCH 3/3] ptrace,syscall_user_dispatch: add a getter/setter for sud configuration Gregory Price
  0 siblings, 1 reply; 21+ messages in thread
From: Gregory Price @ 2023-01-23  3:29 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-fsdevel, linux-doc, linux-kselftest, krisman, tglx, luto,
	oleg, peterz, ebiederm, akpm, adobriyan, corbet, shuah,
	Gregory Price

v5: automated test for !defined(GENERIC_ENTRY) failed, fix fs/proc
    use ifdef for GENERIC_ENTRY || TIF_SYSCALL_USER_DISPATCH
    note: syscall user dispatch is not presently supported for
          non-generic entry, but could be implemented. question is
          whether the TIF_ define should be carved out now or then

v4: Whitespace
    s/CHECKPOINT_RESTART/CHECKPOINT_RESUME
    check test_syscall_work(SYSCALL_USER_DISPATCH) to determine if it's
    turned on or not in fs/proc/array and getter interface

v3: Kernel test robot static function fix
    Whitespace nitpicks

v2: Implements the getter/setter interface in ptrace rather than prctl

Syscall user dispatch makes it possible to cleanly intercept system
calls from user-land.  However, most transparent checkpoint software
presently leverages some combination of ptrace and system call
injection to place software in a ready-to-checkpoint state.

If Syscall User Dispatch is enabled at the time of being quiesced,
injected system calls will subsequently be interposed upon and
dispatched to the task's signal handler.

This patch set implements 3 features to enable software such as CRIU
to cleanly interpose upon software leveraging syscall user dispatch.

- Implement PTRACE_O_SUSPEND_SYSCALL_USER_DISPATCH, akin to a similar
  feature for SECCOMP.  This allows a ptracer to temporarily disable
  syscall user dispatch, making syscall injection possible.

- Implement an fs/proc extension that reports whether Syscall User
  Dispatch is being used in proc/status.  A similar value is present
  for SECCOMP, and is used to determine whether special logic is
  needed during checkpoint/resume.

- Implement a getter interface for Syscall User Dispatch config info.
  To resume successfully, the checkpoint/resume software has to
  save and restore this information.  Presently this configuration
  is write-only, with no way for C/R software to save it.

  This was done in ptrace because syscall user dispatch is not part of
  uapi. The syscall_user_dispatch_config structure was added to the
  ptrace exports.

Gregory Price (3):
  ptrace,syscall_user_dispatch: Implement Syscall User Dispatch
    Suspension
  fs/proc/array: Add Syscall User Dispatch to proc status
  ptrace,syscall_user_dispatch: add a getter/setter for sud
    configuration

 .../admin-guide/syscall-user-dispatch.rst     |  5 +-
 fs/proc/array.c                               | 10 ++++
 include/linux/ptrace.h                        |  2 +
 include/linux/syscall_user_dispatch.h         | 19 +++++++
 include/uapi/linux/ptrace.h                   | 16 +++++-
 kernel/entry/syscall_user_dispatch.c          | 51 +++++++++++++++++++
 kernel/ptrace.c                               | 13 +++++
 7 files changed, 114 insertions(+), 2 deletions(-)

-- 
2.39.0


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2023-01-24 21:39 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-18 20:10 [PATCH v2 0/3] Checkpoint Support for Syscall User Dispatch Gregory Price
2023-01-18 20:10 ` [PATCH 1/3] ptrace,syscall_user_dispatch: Implement Syscall User Dispatch Suspension Gregory Price
2023-01-20 10:23   ` Peter Zijlstra
2023-01-20 10:49     ` Damien Le Moal
2023-01-18 20:10 ` [PATCH 2/3] fs/proc/array: Add Syscall User Dispatch to proc status Gregory Price
2023-01-18 20:10 ` [PATCH 3/3] ptrace,syscall_user_dispatch: add a getter/setter for sud configuration Gregory Price
2023-01-18 23:43   ` kernel test robot
2023-01-19  1:06   ` kernel test robot
2023-01-19  1:16   ` kernel test robot
2023-01-19  2:39   ` kernel test robot
2023-01-23  3:29 [PATCH v5 0/3] Checkpoint Support for Syscall User Dispatch Gregory Price
2023-01-23  3:29 ` [PATCH 3/3] ptrace,syscall_user_dispatch: add a getter/setter for sud configuration Gregory Price
2023-01-23 15:41   ` Oleg Nesterov
2023-01-23 18:12     ` Gregory Price
2023-01-23 19:52       ` Oleg Nesterov
2023-01-24 15:59         ` Gregory Price
2023-01-24 16:43           ` Oleg Nesterov
2023-01-24 16:54             ` Gregory Price
2023-01-24 17:58               ` Andrei Vagin
2023-01-24 21:39                 ` Gregory Price
2023-01-24  2:51   ` Andrei Vagin
2023-01-24  3:30     ` Gregory Price

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.