public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Gregory Price <gourry.memverge@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org,
	krisman@collabora.com, tglx@linutronix.de, luto@kernel.org,
	oleg@redhat.com, ebiederm@xmission.com,
	akpm@linux-foundation.org, adobriyan@gmail.com, corbet@lwn.net,
	shuah@kernel.org, Gregory Price <gregory.price@memverge.com>
Subject: Re: [PATCH 1/3] ptrace,syscall_user_dispatch: Implement Syscall User Dispatch Suspension
Date: Wed, 18 Jan 2023 18:16:23 +0100	[thread overview]
Message-ID: <Y8gpZ+T/re7mEDjB@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20230109153348.5625-2-gregory.price@memverge.com>

On Mon, Jan 09, 2023 at 10:33:46AM -0500, Gregory Price wrote:
> @@ -36,6 +37,10 @@ bool syscall_user_dispatch(struct pt_regs *regs)
>  	struct syscall_user_dispatch *sd = &current->syscall_dispatch;
>  	char state;
>  
> +	if (IS_ENABLED(CONFIG_CHECKPOINT_RESTORE) &&
> +			unlikely(current->ptrace & PT_SUSPEND_SYSCALL_USER_DISPATCH))
> +		return false;
> +
>  	if (likely(instruction_pointer(regs) - sd->offset < sd->len))
>  		return false;
>  

So by making syscall_user_dispatch() return false, we'll make
syscall_trace_enter() continue to handle things, and supposedly you want
to land in ptrace_report_syscall_entry(), right?

> diff --git a/kernel/ptrace.c b/kernel/ptrace.c
> index 54482193e1ed..a6ad815bd4be 100644
> --- a/kernel/ptrace.c
> +++ b/kernel/ptrace.c
> @@ -370,6 +370,11 @@ static int check_ptrace_options(unsigned long data)
>  	if (data & ~(unsigned long)PTRACE_O_MASK)
>  		return -EINVAL;
>  
> +	if (unlikely(data & PTRACE_O_SUSPEND_SYSCALL_USER_DISPATCH)) {
> +		if (!IS_ENABLED(CONFIG_CHECKPOINT_RESTART))
> +			return -EINVAL;
> +	}

Should setting this then not also depend on having
SYSCALL_WORK_SYSCALL_TRACE set? Because without that, you get 'funny'
things.

  reply	other threads:[~2023-01-18 17:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-09 15:33 [RFC PATCH 0/3] Checkpoint Support for Syscall User Dispatch Gregory Price
2023-01-09 15:33 ` [PATCH 1/3] ptrace,syscall_user_dispatch: Implement Syscall User Dispatch Suspension Gregory Price
2023-01-18 17:16   ` Peter Zijlstra [this message]
     [not found]     ` <CAD3UvdSpOMAOUm1CYJ5vOyEsiVZCQdiWaTmXjq1vWVFq1DhQ0w@mail.gmail.com>
2023-01-18 19:49       ` Gregory Price
2023-01-18 20:40         ` Peter Zijlstra
2023-01-09 15:33 ` [PATCH 2/3] fs/proc/array: Add Syscall User Dispatch to proc status Gregory Price
2023-01-17 13:01   ` kernel test robot
2023-01-09 15:33 ` [PATCH 3/3] prctl,syscall_user_dispatch: add a getter for configuration info Gregory Price
2023-01-12 18:15   ` Andrei Vagin
2023-01-12 22:51     ` Gregory Price
2023-01-13  8:28   ` Bagas Sanjaya
  -- strict thread matches above, loose matches on Subject: below --
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y8gpZ+T/re7mEDjB@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=corbet@lwn.net \
    --cc=ebiederm@xmission.com \
    --cc=gourry.memverge@gmail.com \
    --cc=gregory.price@memverge.com \
    --cc=krisman@collabora.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=oleg@redhat.com \
    --cc=shuah@kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox