[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.00.0910051346230.2646@localhost.localdomain>
Date: Mon, 5 Oct 2009 13:47:39 +0200 (CEST)
From: Thomas Gleixner <tglx@...utronix.de>
To: Peter Zijlstra <a.p.zijlstra@...llo.nl>
cc: Anirban Sinha <ani@...rban.org>, Ingo Molnar <mingo@...e.hu>,
linux-kernel@...r.kernel.org, Darren Hart <dvhltc@...ibm.com>,
Kaz Kylheku <kaz@...gmasystems.com>,
Anirban Sinha <asinha@...gmasystems.com>
Subject: Re: futex question
On Mon, 5 Oct 2009, Peter Zijlstra wrote:
> On Mon, 2009-10-05 at 12:56 +0200, Thomas Gleixner wrote:
> >
> > Looking more into that I think we should check whether the robust list
> > has an entry (lock held) in do_execve() and return -EWOULDBLOCK to
> > luser space. Same if pi_waiters is not empty. Holding a lock and
> > calling execve() is simply broken.
>
> Fine by me ;-)
>
> something like the below?
>
> The question is of course what Ani was doing that triggered this in the
> first place and if he can live with this.. :-)
>
> ---
> fs/exec.c | 16 ++++++++++++++++
> 1 files changed, 16 insertions(+), 0 deletions(-)
>
> diff --git a/fs/exec.c b/fs/exec.c
> index d49be6b..0812ba6 100644
> --- a/fs/exec.c
> +++ b/fs/exec.c
> @@ -1295,6 +1295,22 @@ int do_execve(char * filename,
> bool clear_in_exec;
> int retval;
>
> + retval = -EWOULDBLOCK;
> +#ifdef CONFIG_FUTEX
> + if (unlikely(current->robust_list))
> + goto out_ret;
> +#ifdef CONFIG_COMPAT
> + if (unlikely(current->compat_robust_list))
> + goto out_ret;
> +#endif
That needs to call into the futex code and check whether the list is
empty. If not empty, return. If empty set the pointer to NULL
Thanks,
tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists