mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pekka Enberg <penberg@cs.helsinki.fi>
To: Vegard Nossum <vegard.nossum@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>, Alan Cox <alan@lxorguk.ukuu.org.uk>,
	linux-kernel@vger.kernel.org, "Rafael J. Wysocki" <rjw@sisk.pl>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: Re: tty_ldisc_try_get(): BUG kmalloc-8: Poison overwritten
Date: Mon, 15 Jun 2009 07:25:08 +0300	[thread overview]
Message-ID: <84144f020906142125x206ec93cj2af7cbfebf0ab3b5@mail.gmail.com> (raw)
In-Reply-To: <19f34abd0906141603o2edadf22h2d61408b9abdb7a3@mail.gmail.com>

On Mon, Jun 15, 2009 at 2:03 AM, Vegard Nossum<vegard.nossum@gmail.com> wrote:
> 2009/6/14 Pekka Enberg <penberg@cs.helsinki.fi>:
>> On Sun, Jun 14, 2009 at 11:20 AM, Pekka Enberg<penberg@cs.helsinki.fi> wrote:
>>>> You could add something like
>>>>
>>>>  WARN_ON(ld->refcount == 0x6b)
>>>>
>>>> to tty_ldisc_deref() to see if that triggers.
>>
>> On Sun, Jun 14, 2009 at 11:30 AM, Pekka Enberg<penberg@cs.helsinki.fi> wrote:
>>> Make that
>>>
>>>    WARN_ON(ld->refcount == (int)0xa56b6b6b)
>>>
>>> instead.
>>
>> And oh, kmemcheck should be able to catch this too. :-)
>>
>
> I was able to get this trace:
>
> (none) login: [  867.947401] WARNING: kmemcheck: Caught 32-bit read
> from freed memory (469e2f44)
> [  867.962162] 00000000020000000038bf41020000000038bf41020000000038bf4102000000
> [  868.012078]  i i i i f f f f i i i i i i i i i i i i i i i i i i i i i i i i
> [  868.061629]          ^
> [  868.067686]
> [  868.071709] Pid: 1857, comm: getty Not tainted (2.6.30 #416)
> [  868.082651] EIP: 0060:[<414772ea>] EFLAGS: 00000002 CPU: 0
> [  868.095379] EIP is at tty_ldisc_deref+0x1a/0x70
> [  868.103757] EAX: 00000216 EBX: 469e2f40 ECX: 414772e8 EDX: 41bf3870
> [  868.115752] ESI: 00000216 EDI: 4766483c EBP: 46f37f3c ESP: 41e22450
> [  868.131343]  DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
> [  868.141609] CR0: 8005003b CR2: 47806e04 CR3: 06b6b000 CR4: 00000690
> [  868.155263] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
> [  868.167168] DR6: 00004000 DR7: 00000000
> [  868.175228]  [<4146f26d>] tty_read+0x8d/0xc0
> [  868.184598]  [<410ca219>] vfs_read+0x99/0x180
> [  868.196380]  [<410ca3bd>] sys_read+0x3d/0x70
> [  868.206936]  [<41003a6f>] sysenter_do_call+0x12/0x3c
> [  868.219746]  [<ffffffff>] 0xffffffff
>
> Thats:
>
> drivers/char/tty_ldisc.c:366
> drivers/char/tty_io.c:896
>
> I also saw this a couple of times (it's not my printk):
>
> [ 1266.934668] tty_ldisc_deref: no references.
> [ 1267.531655] tty_ldisc_deref: no references.
> [ 1267.790096] tty_ldisc_deref: no references.

Yup, that's the tty layer complaining that we're trying to
tty_ldisc_deref() but reference count is zero. Ingo doesn't see this
because of slab poisoning which is why kmemcheck is able to produce a
nicer stack trace in this case.

                                      Pekka

  reply	other threads:[~2009-06-15  4:25 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-14  8:10 Ingo Molnar
2009-06-14  8:20 ` Pekka Enberg
2009-06-14  8:30   ` Pekka Enberg
2009-06-14  8:32     ` Pekka Enberg
2009-06-14 23:03       ` Vegard Nossum
2009-06-15  4:25         ` Pekka Enberg [this message]
2009-06-14  8:32   ` Ingo Molnar
2009-06-14  8:35     ` Ingo Molnar
2009-06-14 12:32       ` Ingo Molnar
2009-06-14 10:54 ` Alan Cox
2009-06-15  9:10   ` Catalin Marinas
2009-06-16  7:10   ` [bug] WARNING: at drivers/char/tty_io.c:1266 tty_open+0x1ea/0x388() Ingo Molnar
2009-06-16  8:44     ` Alan Cox
2009-06-16  8:49       ` Ingo Molnar
2009-06-16  9:00         ` Alan Cox
2009-06-16 19:43           ` Ingo Molnar
2009-06-16 10:13     ` Alan Cox
2009-06-16 10:24       ` Ingo Molnar

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=84144f020906142125x206ec93cj2af7cbfebf0ab3b5@mail.gmail.com \
    --to=penberg@cs.helsinki.fi \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rjw@sisk.pl \
    --cc=torvalds@linux-foundation.org \
    --cc=vegard.nossum@gmail.com \
    /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®