public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: linux-kernel@vger.kernel.org
Cc: linux-tip-commits@vger.kernel.org,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	"Peter Zijlstra (Intel)" <peterz@infradead.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@kernel.org>, x86 <x86@kernel.org>
Subject: Re: [tip: core/urgent] rseq: Reject unknown flags on rseq unregister
Date: Wed, 25 Dec 2019 12:39:32 +0100	[thread overview]
Message-ID: <20191225113932.GD18098@zn.tnic> (raw)
In-Reply-To: <157727033331.30329.17206832903007175600.tip-bot2@tip-bot2>

On Wed, Dec 25, 2019 at 10:38:53AM -0000, tip-bot2 for Mathieu Desnoyers wrote:
> The following commit has been merged into the core/urgent branch of tip:
> 
> Commit-ID:     66528a4575eee9f5a5270219894ab6178f146e84
> Gitweb:        https://git.kernel.org/tip/66528a4575eee9f5a5270219894ab6178f146e84
> Author:        Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
> AuthorDate:    Wed, 11 Dec 2019 11:17:11 -05:00
> Committer:     Ingo Molnar <mingo@kernel.org>
> CommitterDate: Wed, 25 Dec 2019 10:41:20 +01:00
> 
> 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 <mathieu.desnoyers@efficios.com>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> Cc: Linus Torvalds <torvalds@linux-foundation.org>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Link: https://lkml.kernel.org/r/20191211161713.4490-2-mathieu.desnoyers@efficios.com
> Signed-off-by: Ingo Molnar <mingo@kernel.org>
> ---
>  kernel/rseq.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/kernel/rseq.c b/kernel/rseq.c
> index 27c48eb..a4f86a9 100644
> --- a/kernel/rseq.c
> +++ b/kernel/rseq.c
> @@ -310,6 +310,8 @@ SYSCALL_DEFINE4(rseq, struct rseq __user *, rseq, u32, rseq_len,
>  	int ret;
>  
>  	if (flags & RSEQ_FLAG_UNREGISTER) {
> +		if (flags & ~RSEQ_FLAG_UNREGISTER)
> +			return -EINVAL;
>  		/* Unregister rseq for current thread. */
>  		if (current->rseq != rseq || !current->rseq)
>  			return -EINVAL;

Cc: stable perhaps?

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

  reply	other threads:[~2019-12-25 11:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-11 16:17 [PATCH for 5.5 0/3] Restartable Sequences Fixes Mathieu Desnoyers
2019-12-11 16:17 ` [PATCH for 5.5 1/3] rseq: Fix: Reject unknown flags on rseq unregister Mathieu Desnoyers
2019-12-25 10:38   ` [tip: core/urgent] rseq: " tip-bot2 for Mathieu Desnoyers
2019-12-25 11:39     ` Borislav Petkov [this message]
2019-12-26 22:32       ` Mathieu Desnoyers
2020-01-06 19:14         ` Mathieu Desnoyers
2020-01-07 13:35           ` Peter Zijlstra
2019-12-11 16:17 ` [PATCH for 5.5 2/3] rseq: Fix: Unregister rseq for clone CLONE_VM Mathieu Desnoyers
2019-12-25 10:38   ` [tip: core/urgent] rseq: " tip-bot2 for Mathieu Desnoyers
2019-12-11 16:17 ` [PATCH for 5.5 3/3] rseq/selftests: Fix: Namespace gettid() for compatibility with glibc 2.30 Mathieu Desnoyers
2019-12-20  1:44   ` Shuah Khan
2019-12-20 14:48 ` [PATCH for 5.5 0/3] Restartable Sequences Fixes Peter Zijlstra

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=20191225113932.GD18098@zn.tnic \
    --to=bp@alien8.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --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