mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@osdl.org>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Sergey Vlasov <vsu@altlinux.ru>, ierdnah <ierdnah@go.ro>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: kernel oops!
Date: Mon, 24 Jan 2005 09:58:19 -0800 (PST)	[thread overview]
Message-ID: <Pine.LNX.4.58.0501240935470.4191@ppc970.osdl.org> (raw)
In-Reply-To: <1106509705.6154.12.camel@localhost.localdomain>



On Mon, 24 Jan 2005, Alan Cox wrote:
> 
> Almost every user of tty_ldisc_ref_* doesn't need to lock two objects and
> the code at that layer has no knowledge of pty/tty pairs.

Hmm.. It looks different to me - almost all users of the xxx_ref_wait() 
that act on pty's _do_ seem to use tty->link->ldisc.*()". The one counter- 
example seems to be pty_set_termios().

But I only did a quick grep in drivers/char, so there might be other users 
out there I didn't even think of.

While doing that, I did notice that all the other tty ops do take the 
kernel lock still - both read() and write() do. I wonder if we should just 
make poll() consistent, regardless of other issues (obviously, the nicest 
way to make it consistent would be to remove the kernel lock from the 
read/write paths, but I assume nobody wants to go through the locking).

> I'm dubious this is the actual bug although vhangup on a pty might
> trigger it I guess.

ierdnah - can you verify whether either of my silly patches seems to have 
made any difference? 

And I don't think it can be vhangup - that wouldn't clear the
chars_in_buffer function pointer (it might change it to the 
n_tty_chars_in_buffer or something by resetting to N_TTY).

I'd assume that it's when the other end is changed to using the
"ppp_[sync_]ldisc", both of which do actually have a NULL
"chars_in_buffer". (Alternatively, maybe "chars_in_buffer" isn't actually
NULL at all - the backtrace might be confused by either some really
strange memory corruption or a tail-call to a NULL function pointer by
some other line discipline thing, although quite frankly I think that 
sounds extremely unlikely).

So another potential fix is to just make all tty line disciplines always 
have a valid "chars_in_buffer" pointer. We could even do automatically in 
"tty_set_operations()", ie just do a

	driver->chars_in_buffer = op->chars_in_buffer ? : default_chars_in_buffer;

(where the default just returns zero) thing or something.

That would even speed up the normal cases (no need to test the pointer for 
NULL).

		Linus




  reply	other threads:[~2005-01-24 18:02 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-22 23:36 ierdnah
2005-01-23  6:43 ` Linus Torvalds
2005-01-23 12:29   ` ierdnah
2005-01-23 17:51     ` Linus Torvalds
2005-01-24 19:21       ` ierdnah
2005-01-27 22:47       ` ierdnah
2005-01-27 23:35         ` Linus Torvalds
2005-01-28 20:00           ` ierdnah
2005-01-28 20:28             ` Linus Torvalds
2005-01-28 22:22               ` ierdnah
2005-01-23 13:15   ` Sergey Vlasov
2005-01-23 18:22     ` Linus Torvalds
2005-01-24 15:44       ` Alan Cox
2005-01-24 17:58         ` Linus Torvalds [this message]
2005-01-24 18:09           ` Alan Cox
2005-01-24 15:44     ` Alan Cox
  -- strict thread matches above, loose matches on Subject: below --
2008-01-07 23:15 Kernel Oops? Stoyan Gaydarov
2008-01-07 23:30 ` Alan Cox
2008-01-09  2:25   ` Stoyan Gaydarov
2008-01-09  3:02     ` Alan Cox
2008-01-09  3:24       ` Stoyan Gaydarov
2008-01-10 23:05         ` Jesper Juhl
2008-01-07 23:34 ` Jesper Juhl
2004-09-17 14:05 kernel Oops!!!! Jysuis Parla
2004-09-17 14:05 Jysuis Parla
2004-09-17 17:30 ` Gene Heskett
     [not found] <3A08FA77.703BCC07@rdstm.ro>
2000-11-08 16:29 ` Kernel oops! Venky

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=Pine.LNX.4.58.0501240935470.4191@ppc970.osdl.org \
    --to=torvalds@osdl.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=ierdnah@go.ro \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vsu@altlinux.ru \
    /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

all inboxes | Powered by JetHome®