Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1295232

Re: [PATCH] futex: Prevent pi_state from double freeing in case of error

From Darren Hart <dvhart@infradead.org>
Newsgroups linux.kernel
Subject Re: [PATCH] futex: Prevent pi_state from double freeing in case of error
Date 2015-12-19 00:10 +0100
Message-ID <qHcjU-3Fb-3@gated-at.bofh.it> (permalink)
References <qGYTD-3jm-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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
--
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/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] futex: Prevent pi_state from double freeing in case of error <Bhuvanesh_Surachari@mentor.com> - 2015-12-18 09:50 +0100
  Re: [PATCH] futex: Prevent pi_state from double freeing in case of  error Davidlohr Bueso <dave@stgolabs.net> - 2015-12-18 16:00 +0100
    Re: [PATCH] futex: Prevent pi_state from double freeing in case of  error Thomas Gleixner <tglx@linutronix.de> - 2015-12-19 19:30 +0100
      Re: [PATCH] futex: Prevent pi_state from double freeing in case of  error Darren Hart <dvhart@infradead.org> - 2015-12-20 06:30 +0100
        Re: [PATCH] futex: Prevent pi_state from double freeing in case of  error Davidlohr Bueso <dave@stgolabs.net> - 2015-12-21 18:50 +0100
      Re: [PATCH] futex: Prevent pi_state from double freeing in case of  error Bhuvanesh <bhuvanesh_surachari@mentor.com> - 2015-12-23 16:00 +0100
        Re: [PATCH] futex: Prevent pi_state from double freeing in case of  error Thomas Gleixner <tglx@linutronix.de> - 2015-12-23 19:10 +0100
  Re: [PATCH] futex: Prevent pi_state from double freeing in case of  error Darren Hart <dvhart@infradead.org> - 2015-12-19 00:10 +0100

csiph-web