public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Romain Perier <romain.perier@free-electrons.com>
Cc: Arnd Bergmann <arnd@arndb.de>, Ingo Molnar <mingo@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-arch@vger.kernel.org, stable@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Subject: Re: [PATCH] asm-generic/futex: Properly re-enable preemption in futex_atomic_cmpxchg_inatomic()
Date: Thu, 14 Apr 2016 17:44:56 +0200	[thread overview]
Message-ID: <20160414154456.GD2975@worktop.cust.blueprintrf.com> (raw)
In-Reply-To: <1460640963-690-1-git-send-email-romain.perier@free-electrons.com>

On Thu, Apr 14, 2016 at 03:36:03PM +0200, Romain Perier wrote:
> Fixes: d9b9ff8c1889 ("sched/preempt, futex: Disable preemption in UP futex_atomic_cmpxchg_inatomic() explicitly")
> Signed-off-by: Romain Perier <romain.perier@free-electrons.com>
> ---
>  include/asm-generic/futex.h | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/include/asm-generic/futex.h b/include/asm-generic/futex.h
> index e56272c..bf2d34c 100644
> --- a/include/asm-generic/futex.h
> +++ b/include/asm-generic/futex.h
> @@ -108,11 +108,15 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
>  	u32 val;
>  
>  	preempt_disable();
> -	if (unlikely(get_user(val, uaddr) != 0))
> +	if (unlikely(get_user(val, uaddr) != 0)) {
> +		preempt_enable();
>  		return -EFAULT;
> +	}
>  
> -	if (val == oldval && unlikely(put_user(newval, uaddr) != 0))
> +	if (val == oldval && unlikely(put_user(newval, uaddr) != 0)) {
> +		preempt_enable();
>  		return -EFAULT;
> +	}
>  
>  	*uval = val;
>  	preempt_enable();

Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>

  reply	other threads:[~2016-04-14 15:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-14 13:36 [PATCH] asm-generic/futex: Properly re-enable preemption in futex_atomic_cmpxchg_inatomic() Romain Perier
2016-04-14 15:44 ` Peter Zijlstra [this message]
2016-04-14 17:22 ` David Howells
2016-04-21 10:07 ` [tip:locking/urgent] asm-generic/futex: Re-enable " tip-bot for Romain Perier

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=20160414154456.GD2975@worktop.cust.blueprintrf.com \
    --to=peterz@infradead.org \
    --cc=arnd@arndb.de \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=romain.perier@free-electrons.com \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=thomas.petazzoni@free-electrons.com \
    /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