mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: linux-kernel@vger.kernel.org, x86@kernel.org,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Greg Kroah-Hartman <gregkh@suse.de>
Subject: Re: v2.6.31-rc6: BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
Date: Mon, 24 Aug 2009 15:34:25 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LFD.2.01.0908241530070.3824@localhost.localdomain> (raw)
In-Reply-To: <m1skfnggrb.fsf@fess.ebiederm.org>



On Wed, 19 Aug 2009, Eric W. Biederman wrote:
> 
> I was looking into a change in behavior on 2.6.31-rc6 where
> data was being lost, and it appears one variant of my test program
> kills the kernel.
> 
> The following program run as an unprivileged user causes a kernel
> panic in about a minute:
> 
> aka
> 
> while :; do ./KernelTtyTest ; done

Ok, so I got back to this one after having worked on other regressions, 
and I'm not seeing anything really obvious. But it does look like we may 
have a situation where we're resetting the ldisc due to hangup at the same 
time as the writer is still active in the flushing on another CPU.

When we halt the lfisc, we cancel the delayed work, but we do it without 
the "non-sync" version that only removes the timer. If the timer just 
triggered, the delayed work might be busy running on another CPU.

Does changing the "cancel_delayed_work()" to "cancel_delayed_work_sync()" 
as in the patch below help your case? Oh, and I noticed that there was a 
stale comment lying around, so the patch removes that one too.

Untested. VERY untested. Just going by "that looks odd".

		Linus

---

 drivers/char/tty_ldisc.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/drivers/char/tty_ldisc.c b/drivers/char/tty_ldisc.c
index 1733d34..658638f 100644
--- a/drivers/char/tty_ldisc.c
+++ b/drivers/char/tty_ldisc.c
@@ -507,15 +507,12 @@ static void tty_ldisc_restore(struct tty_struct *tty, struct tty_ldisc *old)
  *	The TTY_LDISC flag being cleared ensures no further references can
  *	be obtained while the delayed work queue halt ensures that no more
  *	data is fed to the ldisc.
- *
- *	In order to wait for any existing references to complete see
- *	tty_ldisc_wait_idle.
  */
 
 static int tty_ldisc_halt(struct tty_struct *tty)
 {
 	clear_bit(TTY_LDISC, &tty->flags);
-	return cancel_delayed_work(&tty->buf.work);
+	return cancel_delayed_work_sync(&tty->buf.work);
 }
 
 /**

  parent reply	other threads:[~2009-08-24 22:37 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-20  5:46 Eric W. Biederman
2009-08-20  6:07 ` Eric W. Biederman
     [not found]   ` <7b6bb4a50908200010h1c60d007p4fa017fd97c87c19@mail.gmail.com>
2009-08-20  7:33     ` Eric W. Biederman
2009-08-20  9:23       ` Xiaotian Feng
2009-08-21  2:09         ` Zhang, Yanmin
2009-08-21 18:23           ` Eric W. Biederman
2009-08-20  7:54   ` Dave Young
2009-08-20  8:00     ` Eric W. Biederman
2009-08-20  8:19       ` Dave Young
2009-08-24 22:34   ` Linus Torvalds [this message]
2009-08-24 23:51     ` Linus Torvalds
2009-08-25  0:09       ` Linus Torvalds
2009-08-25  1:41         ` Eric W. Biederman
2009-08-25  2:48         ` Dave Young
2009-08-25  3:08         ` Xiaotian Feng
2009-08-25  6:16           ` Zhang, Yanmin
2009-08-25  3:39         ` Frederic Weisbecker
2009-08-25  4:10           ` Linus Torvalds
2009-08-25  4:30             ` Linus Torvalds
2009-08-25 15:05               ` Frederic Weisbecker
2009-08-25 14:24             ` Frederic Weisbecker
2009-08-27  9:15         ` Zhang, Yanmin

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=alpine.LFD.2.01.0908241530070.3824@localhost.localdomain \
    --to=torvalds@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=ebiederm@xmission.com \
    --cc=gregkh@suse.de \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome