Skip to content

Commit 66528a4

Browse files
compudjIngo Molnar
authored andcommitted
rseq: Reject unknown flags on rseq unregister
It is preferrable to reject unknown flags within rseq unregistration rather than to ignore them. It is an oversight caused by the fact that the check for unknown flags is after the rseq unregister flag check. Signed-off-by: Mathieu Desnoyers <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent 46cf053 commit 66528a4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

kernel/rseq.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,8 @@ SYSCALL_DEFINE4(rseq, struct rseq __user *, rseq, u32, rseq_len,
310310
int ret;
311311

312312
if (flags & RSEQ_FLAG_UNREGISTER) {
313+
if (flags & ~RSEQ_FLAG_UNREGISTER)
314+
return -EINVAL;
313315
/* Unregister rseq for current thread. */
314316
if (current->rseq != rseq || !current->rseq)
315317
return -EINVAL;

0 commit comments

Comments
 (0)