mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "tip-bot2 for Gregory Price" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Gregory Price <gregory.price@memverge.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Oleg Nesterov <oleg@redhat.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: core/entry] syscall_user_dispatch: Split up set_syscall_user_dispatch()
Date: Tue, 18 Apr 2023 08:47:39 -0000	[thread overview]
Message-ID: <168180765934.404.13399191864427617953.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20230407171834.3558-2-gregory.price@memverge.com>

The following commit has been merged into the core/entry branch of tip:

Commit-ID:     43360686328b1f4b7d9dcc883ee9243ad7c16fae
Gitweb:        https://git.kernel.org/tip/43360686328b1f4b7d9dcc883ee9243ad7c16fae
Author:        Gregory Price <gourry.memverge@gmail.com>
AuthorDate:    Fri, 07 Apr 2023 13:18:31 -04:00
Committer:     Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Sun, 16 Apr 2023 14:23:07 +02:00

syscall_user_dispatch: Split up set_syscall_user_dispatch()

syscall user dispatch configuration is not covered by checkpoint/restore.

To prepare for ptrace access to the syscall user dispatch configuration,
move the inner working of set_syscall_user_dispatch() into a helper
function. Make the helper function task pointer based and let
set_syscall_user_dispatch() invoke it with task=current.

No functional change.

Signed-off-by: Gregory Price <gregory.price@memverge.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Link: https://lore.kernel.org/r/20230407171834.3558-2-gregory.price@memverge.com

---
 kernel/entry/syscall_user_dispatch.c | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/kernel/entry/syscall_user_dispatch.c b/kernel/entry/syscall_user_dispatch.c
index 0b6379a..22396b2 100644
--- a/kernel/entry/syscall_user_dispatch.c
+++ b/kernel/entry/syscall_user_dispatch.c
@@ -68,8 +68,9 @@ bool syscall_user_dispatch(struct pt_regs *regs)
 	return true;
 }
 
-int set_syscall_user_dispatch(unsigned long mode, unsigned long offset,
-			      unsigned long len, char __user *selector)
+static int task_set_syscall_user_dispatch(struct task_struct *task, unsigned long mode,
+					  unsigned long offset, unsigned long len,
+					  char __user *selector)
 {
 	switch (mode) {
 	case PR_SYS_DISPATCH_OFF:
@@ -94,15 +95,21 @@ int set_syscall_user_dispatch(unsigned long mode, unsigned long offset,
 		return -EINVAL;
 	}
 
-	current->syscall_dispatch.selector = selector;
-	current->syscall_dispatch.offset = offset;
-	current->syscall_dispatch.len = len;
-	current->syscall_dispatch.on_dispatch = false;
+	task->syscall_dispatch.selector = selector;
+	task->syscall_dispatch.offset = offset;
+	task->syscall_dispatch.len = len;
+	task->syscall_dispatch.on_dispatch = false;
 
 	if (mode == PR_SYS_DISPATCH_ON)
-		set_syscall_work(SYSCALL_USER_DISPATCH);
+		set_task_syscall_work(task, SYSCALL_USER_DISPATCH);
 	else
-		clear_syscall_work(SYSCALL_USER_DISPATCH);
+		clear_task_syscall_work(task, SYSCALL_USER_DISPATCH);
 
 	return 0;
 }
+
+int set_syscall_user_dispatch(unsigned long mode, unsigned long offset,
+			      unsigned long len, char __user *selector)
+{
+	return task_set_syscall_user_dispatch(current, mode, offset, len, selector);
+}

  reply	other threads:[~2023-04-18  8:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-07 17:18 [PATCH v16 0/4] Checkpoint Support for Syscall User Dispatch Gregory Price
2023-04-07 17:18 ` [PATCH v16 1/4] syscall_user_dispatch: helper function to operate on given task Gregory Price
2023-04-18  8:47   ` tip-bot2 for Gregory Price [this message]
2023-04-07 17:18 ` [PATCH v16 2/4] syscall user dispatch: untag selector addresses before access_ok Gregory Price
2023-04-18  8:47   ` [tip: core/entry] syscall_user_dispatch: Untag selector address before access_ok() tip-bot2 for Gregory Price
2023-04-07 17:18 ` [PATCH v16 3/4] ptrace,syscall_user_dispatch: checkpoint/restore support for SUD Gregory Price
2023-04-18  8:47   ` [tip: core/entry] ptrace: Provide set/get interface for syscall user dispatch tip-bot2 for Gregory Price
2023-04-07 17:18 ` [PATCH v16 4/4] selftest,ptrace: Add selftest for syscall user dispatch config api Gregory Price
2023-04-18  8:47   ` [tip: core/entry] selftest, ptrace: " tip-bot2 for Gregory Price

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=168180765934.404.13399191864427617953.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=gregory.price@memverge.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=oleg@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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

all inboxes | Powered by JetHome®