[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4ACB6830.7050004@anirban.org>
Date: Tue, 06 Oct 2009 08:54:24 -0700
From: Anirban Sinha <ani@...rban.org>
To: mingo@...hat.com, hpa@...or.com, linux-kernel@...r.kernel.org,
peterz@...radead.org, tglx@...utronix.de, ani@...rban.org,
asinha@...gmasystems.com
CC: linux-tip-commits@...r.kernel.org
Subject: Re: [tip:core/urgent] futex: Nullify robust lists after cleanup
Once upon a time, like on 09-10-06 8:03 AM, tip-bot for Peter Zijlstra wrote:
> futex: Nullify robust lists after cleanup
>
> The robust list pointers of user space held futexes are kept intact
> over an exec() call. When the exec'ed task exits exit_robust_list() is
> called with the stale pointer. The risk of corruption is minimal, but
> still it is incorrect to keep the pointers valid. Actually glibc
> should uninstall the robust list before calling exec() but we have to
> deal with it anyway.
>
> Nullify the pointers after [compat_]exit_robust_list() has been
> called.
>
> Reported-by: Anirban Sinha <ani@...rban.org>
> Signed-off-by: Peter Zijlstra <peterz@...radead.org>
> Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
> LKML-Reference: <new-submission>
> Cc: stable@...nel.org
Excellent! I very much like the solution because:
(a) it reiterates the fact that an execve() call is indeed logically the
'death' of a process.
'(b) cleans up state that should not logically propagate across an execve() call.
(c) Does not introduce new EWOULDBLOCK semantics that can potentially break user
land.
(d) Restores the 'robust' behavior of futexes by waking up other processes
waiting on it on an exec() call.
(e) handles potentially broken/buggy applications gracefully.
(f) as far as I can see, the world would be better and no worse with this patch :)
I'll let you guys know if something else strikes my eyes as being odd in the
course of my digging through the code.
Ani
--
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