All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Nyberg <alexn@telia.com>
To: Chris Wright <chrisw@osdl.org>
Cc: linux-kernel@vger.kernel.org, stable@kernel.org,
	Justin Forbes <jmforbes@linuxtx.org>,
	Zwane Mwaikambo <zwane@arm.linux.org.uk>,
	"Theodore Ts'o" <tytso@mit.edu>,
	Randy Dunlap <rdunlap@xenotime.net>,
	Chuck Wolber <chuckw@quantumlinux.com>,
	torvalds@osdl.org, akpm@osdl.org, alan@lxorguk.ukuu.org.uk
Subject: Re: [PATCH 00/11] -stable review
Date: Thu, 15 Sep 2005 09:36:40 +0200	[thread overview]
Message-ID: <20050915073640.GA2056@localhost.localdomain> (raw)
In-Reply-To: <20050915010343.577985000@localhost.localdomain>

On Wed, Sep 14, 2005 at 06:03:43PM -0700 Chris Wright wrote:

> This is the start of the stable review cycle for the 2.6.13.2 release.
> There are 11 patches in this series, all will be posted as a response to
> this one.  If anyone has any issues with these being applied, please let
> us know.  If anyone is a maintainer of the proper subsystem, and wants
> to add a signed-off-by: line to the patch, please respond with it.
> 
> These patches are sent out with a number of different people on the
> Cc: line.  If you wish to be a reviewer, please email stable@kernel.org
> to add your name to the list.  If you want to be off the reviewer list,
> also email us.
> 

This might be worth putting in too (has been hit by at least two people
in the real world etc.)

tree e3a704026e65bf6fea0c7747f0fb75a506f54127
parent 32a3658533c6f4c6bf370dd730213e802464ef9b
author Alexander Nyberg <alexn@telia.com> Wed, 14 Sep 2005 18:54:06 +0200
committer Linus Torvalds <torvalds@g5.osdl.org> Thu, 15 Sep 2005 00:26:34 -0700

[PATCH] Fix fs/exec.c:788 (de_thread()) BUG_ON

It turns out that the BUG_ON() in fs/exec.c: de_thread() is unreliable
and can trigger due to the test itself being racy.

de_thread() does
 	while (atomic_read(&sig->count) > count) {
	}
	.....
	.....
	BUG_ON(!thread_group_empty(current));

but release_task does
	write_lock_irq(&tasklist_lock)
	__exit_signal
		(this is where atomic_dec(&sig->count) is run)
	__exit_sighand
	__unhash_process
		takes write lock on tasklist_lock
		remove itself out of PIDTYPE_TGID list
	write_unlock_irq(&tasklist_lock)

so there's a clear (although small) window between the
atomic_dec(&sig->count) and the actual PIDTYPE_TGID unhashing of the
thread.

And actually there is no need for all threads to have exited at this
point, so we simply kill the BUG_ON.

Big thanks to Marc Lehmann who provided the test-case.

Fixes Bug 5170 (http://bugme.osdl.org/show_bug.cgi?id=5170)

Signed-off-by: Alexander Nyberg <alexn@telia.com>
Cc: Roland McGrath <roland@redhat.com>
Cc: Andrew Morton <akpm@osdl.org>
Cc: Ingo Molnar <mingo@elte.hu>
Acked-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

 fs/exec.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/fs/exec.c b/fs/exec.c
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -745,8 +745,8 @@ static inline int de_thread(struct task_
         }
 
 	/*
-	 * Now there are really no other threads at all,
-	 * so it's safe to stop telling them to kill themselves.
+	 * There may be one thread left which is just exiting,
+	 * but it's safe to stop telling the group to kill themselves.
 	 */
 	sig->flags = 0;
 
@@ -785,7 +785,6 @@ no_thread_group:
 			kmem_cache_free(sighand_cachep, oldsighand);
 	}
 
-	BUG_ON(!thread_group_empty(current));
 	BUG_ON(!thread_group_leader(current));
 	return 0;
 }

  parent reply	other threads:[~2005-09-15  7:36 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-15  1:03 [PATCH 00/11] -stable review Chris Wright
2005-09-15  1:03 ` [PATCH 01/11] [PATCH] lost fput in 32bit ioctl on x86-64 Chris Wright
2005-09-15  1:03 ` [PATCH 02/11] [PATCH] Lost sockfd_put() in routing_ioctl() Chris Wright
2005-09-15  1:03 ` [PATCH 03/11] [PATCH] forcedeth: Initialize link settings in every nv_open() Chris Wright
2005-09-15  1:03 ` [PATCH 04/11] hpt366: write the full 4 bytes of ROM address, not just low 1 byte Chris Wright
2005-09-15  2:18   ` David Lang
2005-09-15  2:26     ` Andrew Morton
2005-09-15  2:29       ` [PATCH 04/11] hpt366: write the full 4 bytes of ROM address,not " David Lang
2005-09-15  6:11     ` [PATCH 04/11] hpt366: write the full 4 bytes of ROM address, not " Chris Wright
2005-09-15 10:39       ` David Lang
2005-09-15 10:28   ` Martin Mares
2005-09-15  1:03 ` [PATCH 05/11] Sun GEM ethernet: enable and map PCI ROM properly Chris Wright
2005-09-15  1:03 ` [PATCH 06/11] [stable] [ROM 3/3] Sun HME: " Chris Wright
2005-09-15  1:03 ` [PATCH 07/11] [NETFILTER]: Fix DHCP + MASQUERADE problem Chris Wright
2005-09-15  1:03 ` [PATCH 08/11] jfs: jfs_delete_inode must call clear_inode Chris Wright
2005-09-15  1:03 ` [PATCH 09/11] [PATCH] Fix MPOL_F_VERIFY Chris Wright
2005-09-15  1:03 ` [PATCH 10/11] Fix up more strange byte writes to the PCI_ROM_ADDRESS config word Chris Wright
2005-09-15  1:03 ` [PATCH 11/11] USB: ftdi_sio: custom baud rate fix Chris Wright
2005-09-15  7:36 ` Alexander Nyberg [this message]
2005-09-15 20:04   ` [PATCH 00/11] -stable review Chris Wright
  -- strict thread matches above, loose matches on Subject: below --
2006-06-02 19:46 Chris Wright

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050915073640.GA2056@localhost.localdomain \
    --to=alexn@telia.com \
    --cc=akpm@osdl.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=chrisw@osdl.org \
    --cc=chuckw@quantumlinux.com \
    --cc=jmforbes@linuxtx.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rdunlap@xenotime.net \
    --cc=stable@kernel.org \
    --cc=torvalds@osdl.org \
    --cc=tytso@mit.edu \
    --cc=zwane@arm.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.