Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=abd96ecb298675a21c412a29f5de2f80174d5f18
Commit:     abd96ecb298675a21c412a29f5de2f80174d5f18
Parent:     5c076fce2e217240b44bc753a5ec8ecd379c6eb9
Author:     Oleg Nesterov <[EMAIL PROTECTED]>
AuthorDate: Wed Aug 22 14:01:58 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Wed Aug 22 19:52:47 2007 -0700

    exec: kill unsafe BUG_ON(sig->count) checks
    
    de_thread:
    
        if (atomic_read(&oldsighand->count) <= 1)
                BUG_ON(atomic_read(&sig->count) != 1);
    
    This is not safe without the rmb() in between.  The results of two
    correctly ordered __exit_signal()->atomic_dec_and_test()'s could be seen
    out of order on our CPU.
    
    The same is true for the "thread_group_empty()" case, __unhash_process()'s
    changes could be seen before atomic_dec_and_test(&sig->count).
    
    On some platforms (including i386) atomic_read() doesn't provide even the
    compiler barrier, in that case these checks are simply racy.
    
    Remove these BUG_ON()'s. Alternatively, we can do something like
    
        BUG_ON( ({ smp_rmb(); atomic_read(&sig->count) != 1; }) );
    
    Signed-off-by: Oleg Nesterov <[EMAIL PROTECTED]>
    Acked-by: Paul E. McKenney <[EMAIL PROTECTED]>
    Cc: Roland McGrath <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 fs/exec.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/fs/exec.c b/fs/exec.c
index af4361c..c21a8cc 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -784,7 +784,6 @@ static int de_thread(struct task_struct *tsk)
         * and we can just re-use it all.
         */
        if (atomic_read(&oldsighand->count) <= 1) {
-               BUG_ON(atomic_read(&sig->count) != 1);
                signalfd_detach(tsk);
                exit_itimers(sig);
                return 0;
@@ -929,8 +928,6 @@ no_thread_group:
        if (leader)
                release_task(leader);
 
-       BUG_ON(atomic_read(&sig->count) != 1);
-
        if (atomic_read(&oldsighand->count) == 1) {
                /*
                 * Now that we nuked the rest of the thread group,
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to