lkml.org 
[lkml]   [2009]   [Oct]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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@anirban.org>
> Signed-off-by: Peter Zijlstra <peterz@infradead.org>
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> LKML-Reference: <new-submission>
> Cc: stable@kernel.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



\
 
 \ /
  Last update: 2009-10-06 18:03    [W:0.029 / U:0.264 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site