From: David Miller <davem@davemloft.net>
To: davej@redhat.com
Cc: linux-kernel@vger.kernel.org, jbaron@redhat.com
Subject: Re: frequent slab corruption (since a long time)
Date: Wed, 02 Aug 2006 15:49:54 -0700 (PDT) [thread overview]
Message-ID: <20060802.154954.112624420.davem@davemloft.net> (raw)
In-Reply-To: <20060802222321.GH3639@redhat.com>
From: Dave Jones <davej@redhat.com>
Date: Wed, 2 Aug 2006 18:23:21 -0400
> None of the code manipulating tty->count seems to be under
> the tty_mutex. Should it be ?
> Or is this protected through some other means?
It is in the primary code paths at least, all callers of init_dev()
(which increments tty->count) grab the mutex and also release_dev()
grabs the mutex around tty->count manipulations.
I'm surprised that when this triggers we don't get one of these
two messages:
if (pty_master) {
if (--o_tty->count < 0) {
printk(KERN_WARNING "release_dev: bad pty slave count "
"(%d) for %s\n",
o_tty->count, tty_name(o_tty, buf));
o_tty->count = 0;
}
}
if (--tty->count < 0) {
printk(KERN_WARNING "release_dev: bad tty->count (%d) for %s\n",
tty->count, tty_name(tty, buf));
tty->count = 0;
}
However, there seems to be some kind of dependency of TTY opennings
holding the BKL, as least as far as this comment on con_close() is
concerned:
/*
* tty_mutex is released, but we still hold BKL, so there is
* still exclusion against init_dev()
*/
But it is not clear to me that tty_open() and ptmx_open() always run
with the BKL held. chrdev_open() wraps the ->open call with the BKL
held, but then it plugs in the device's fops which should allow a
direct filp->fops->open() call from the VFS layer without the BKL
grabbing right?
chrdev_open() should catch /dev/foo char device opens, but what about
the sysfs instances? They might bypass this path too somehow, thus
another case where the BKL won't be held on open().
Hmmm...
next prev parent reply other threads:[~2006-08-02 22:49 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-02 2:16 Dave Jones
2006-08-02 2:34 ` Roland Dreier
2006-08-02 3:37 ` Andi Kleen
2006-08-02 4:22 ` Dave Jones
2006-08-02 4:35 ` Andi Kleen
2006-08-02 4:46 ` Dave Jones
2006-08-02 5:05 ` David Miller
2006-08-02 5:31 ` David Miller
2006-08-02 22:23 ` Dave Jones
2006-08-02 22:49 ` David Miller [this message]
2006-08-03 17:40 ` Alan Cox
2006-08-03 17:56 ` Dave Jones
2006-08-03 20:48 ` Alan Cox
2006-08-02 23:14 ` Alan Cox
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=20060802.154954.112624420.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=davej@redhat.com \
--cc=jbaron@redhat.com \
--cc=linux-kernel@vger.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