public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Darren Hart <dvhart@infradead.org>
To: Bhuvanesh_Surachari@mentor.com
Cc: tglx@linutronix.de, peterz@infradead.org, mingo@kernel.org,
	dave@stgolabs.net, akpm@linux-foundation.org,
	linux@rasmusvillemoes.dk, viresh.kumar@linaro.org,
	luto@amacapital.net, bigeasy@linutronix.de,
	mtk.manpages@gmail.com, linux-kernel@vger.kernel.org,
	Andy Lowe <Andy_Lowe@mentor.com>
Subject: Re: [PATCH] futex: Prevent pi_state from double freeing in case of error
Date: Fri, 18 Dec 2015 15:08:03 -0800	[thread overview]
Message-ID: <20151218230803.GE15346@malice.jf.intel.com> (raw)
In-Reply-To: <1450428223-7655-1-git-send-email-Bhuvanesh_Surachari@mentor.com>

On Fri, Dec 18, 2015 at 02:13:43PM +0530, Bhuvanesh_Surachari@mentor.com wrote:
> From: Bhuvanesh Surachari <bhuvanesh_surachari@mentor.com>
> 
> In case of error from rt_mutex_start_proxy_lock pi_state is freed
> twice in futex_requeue function. Hence removing free_pi_state in
> else branch and branching to the location where pi_state is freed.
> 
> Signed-off-by: Bhuvanesh Surachari <Bhuvanesh_Surachari@mentor.com>
> Signed-off-by: Andy Lowe <Andy_Lowe@mentor.com>

Apparently inadvertently introduced by:

commit 30a6b8031fe14031ab27c1fa3483cb9780e7f63c
    futex: Fix a race condition between REQUEUE_PI and task death

Reviewed-by: Darren Hart <dvhart@linux.intel.com>

> ---
>  kernel/futex.c |    1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/kernel/futex.c b/kernel/futex.c
> index 684d754..264b3f2 100644
> --- a/kernel/futex.c
> +++ b/kernel/futex.c
> @@ -1815,7 +1815,6 @@ retry_private:
>  			} else if (ret) {
>  				/* -EDEADLK */
>  				this->pi_state = NULL;
> -				free_pi_state(pi_state);
>  				goto out_unlock;
>  			}
>  		}
> -- 
> 1.7.9.5
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 

-- 
Darren Hart
Intel Open Source Technology Center

      parent reply	other threads:[~2015-12-18 23:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-18  8:43 [PATCH] futex: Prevent pi_state from double freeing in case of error Bhuvanesh_Surachari
2015-12-18 14:55 ` Davidlohr Bueso
2015-12-19 18:24   ` Thomas Gleixner
2015-12-20  5:21     ` Darren Hart
2015-12-21 17:42       ` Davidlohr Bueso
2015-12-23 14:56     ` Bhuvanesh
2015-12-23 18:07       ` Thomas Gleixner
2015-12-18 23:08 ` Darren Hart [this message]

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=20151218230803.GE15346@malice.jf.intel.com \
    --to=dvhart@infradead.org \
    --cc=Andy_Lowe@mentor.com \
    --cc=Bhuvanesh_Surachari@mentor.com \
    --cc=akpm@linux-foundation.org \
    --cc=bigeasy@linutronix.de \
    --cc=dave@stgolabs.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=luto@amacapital.net \
    --cc=mingo@kernel.org \
    --cc=mtk.manpages@gmail.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=viresh.kumar@linaro.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