summaryrefslogtreecommitdiff
path: root/kernel/rseq.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2025-03-06 22:26:36 +0100
committerIngo Molnar <mingo@kernel.org>2025-03-06 22:26:36 +0100
commit82354fce168c7cb037644bf4443b3e1b7559976c (patch)
tree39e2f997a23ea386e5045acce67e8819690b7036 /kernel/rseq.c
parent7ab02bd36eb444654183ad6c5b15211ddfa32a8f (diff)
parentb1536481c81fb604074da799e4f2d2038a1663f7 (diff)
Merge branch 'sched/urgent' into sched/core, to pick up dependent commits
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/rseq.c')
-rw-r--r--kernel/rseq.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/kernel/rseq.c b/kernel/rseq.c
index 3d136c48cff7..a7d81229eda0 100644
--- a/kernel/rseq.c
+++ b/kernel/rseq.c
@@ -507,9 +507,6 @@ SYSCALL_DEFINE4(rseq, struct rseq __user *, rseq, u32, rseq_len,
return -EINVAL;
if (!access_ok(rseq, rseq_len))
return -EFAULT;
- current->rseq = rseq;
- current->rseq_len = rseq_len;
- current->rseq_sig = sig;
#ifdef CONFIG_DEBUG_RSEQ
/*
* Initialize the in-kernel rseq fields copy for validation of
@@ -522,6 +519,14 @@ SYSCALL_DEFINE4(rseq, struct rseq __user *, rseq, u32, rseq_len,
return -EFAULT;
#endif
/*
+ * Activate the registration by setting the rseq area address, length
+ * and signature in the task struct.
+ */
+ current->rseq = rseq;
+ current->rseq_len = rseq_len;
+ current->rseq_sig = sig;
+
+ /*
* If rseq was previously inactive, and has just been
* registered, ensure the cpu_id_start and cpu_id fields
* are updated before returning to user-space.