mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Vegard Nossum" <vegard.nossum@gmail.com>
To: "Ingo Molnar" <mingo@elte.hu>
Cc: "Evgeniy Polyakov" <johnpol@2ka.mipt.ru>,
	"Christoph Lameter" <cl@linux-foundation.org>,
	"Pekka Enberg" <penberg@cs.helsinki.fi>,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	"Rafael J. Wysocki" <rjw@sisk.pl>,
	davem@davemloft.net
Subject: Re: [bug, netconsole, SLUB] BUG skbuff_head_cache: Poison overwritten
Date: Mon, 21 Jul 2008 22:22:49 +0200	[thread overview]
Message-ID: <19f34abd0807211322wb1309ecsf98ae8d0a35f5ccf@mail.gmail.com> (raw)
In-Reply-To: <20080721200554.GA15463@elte.hu>

On Mon, Jul 21, 2008 at 10:05 PM, Ingo Molnar <mingo@elte.hu> wrote:
>
> * Evgeniy Polyakov <johnpol@2ka.mipt.ru> wrote:
>
>> It could be an interesting kmemcheck extension to catch not only
>> non-initialized memory, but also writes into just freed one, but not
>> yet returned by allocator to the next user.
>
> hm, i think kmemcheck does that mostly already. If not then I think
> kmemcheck should just turn off all buffering that might happen on the
> SLUB level (if it doesnt do it already). I.e. a kfree()d buffer should
> be marked as uninitialized immediately.

We don't catch writes (yet, because kmemcheck gets confused by SLUB's
own writes so far), but yes, we mark objects "freed" when they are
freed (until the slab page is returned to the page allocator) and we
may detect reads from this area before the object is reallocated. In
that case, a "read from freed memory" message will appear.

Unfortunately, it doesn't work quite as well as I'd like it to yet. We
did catch one real bug in ACPI in this way (read-after-free). But as I
have discovered, not all machines support single-stepping over REP
STOS instructions properly. Which means that kmemcheck breaks silently
on some machines. There's also the recent DMA patch, which might
improve things. Linus is right, it's really fragile. But we are
working on it. It is going in the right direction anyway.

(Pekka and I were also working on an extension to SLUB which delays
the freeing of objects, i.e. so that objects will remain in the
"freed" state for a certain amount of time before it can be allocated
again. But we don't really have a _good_ patch for this yet, it was
more like an ugly hack at the time.)


Vegard

-- 
"The animistic metaphor of the bug that maliciously sneaked in while
the programmer was not looking is intellectually dishonest as it
disguises that the error is the programmer's own creation."
	-- E. W. Dijkstra, EWD1036

  reply	other threads:[~2008-07-21 20:23 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-17 21:42 Ingo Molnar
2008-07-17 21:45 ` David Miller
2008-07-17 22:06   ` Ingo Molnar
2008-07-17 22:09     ` David Miller
2008-07-17 22:43     ` Ingo Molnar
2008-07-17 23:15 ` Vegard Nossum
2008-07-17 23:35   ` Vegard Nossum
2008-07-17 23:52   ` Ingo Molnar
2008-07-18  0:01     ` Ingo Molnar
2008-07-18  0:05     ` Vegard Nossum
2008-07-18  0:16       ` Ingo Molnar
2008-07-18  2:13     ` David Miller
2008-07-18  2:03   ` David Miller
2008-07-18  7:03     ` Vegard Nossum
2008-07-18  7:12       ` David Miller
2008-07-18  9:05       ` Ingo Molnar
2008-07-18 19:10       ` [bug] Attempt to release alive inet socket f6fac040 Ingo Molnar
2008-07-18 19:55         ` Ingo Molnar
2008-07-17 23:27 ` [bug, netconsole, SLUB] BUG skbuff_head_cache: Poison overwritten Vegard Nossum
2008-07-17 23:56   ` Ingo Molnar
2008-07-21 11:41     ` Vegard Nossum
2008-07-18  5:46 ` Evgeniy Polyakov
2008-07-18  9:02   ` Pekka Enberg
2008-07-18  9:09     ` Ingo Molnar
2008-07-18  9:15       ` Pekka Enberg
2008-07-18 10:16     ` Evgeniy Polyakov
2008-07-18 14:44       ` Pekka Enberg
2008-07-18 14:48         ` Christoph Lameter
2008-07-18 16:07         ` Evgeniy Polyakov
2008-07-18  9:00 ` Pekka J Enberg
2008-07-18  9:11   ` Ingo Molnar
2008-07-18  9:16     ` Pekka Enberg
2008-07-18 13:54       ` Christoph Lameter
2008-07-21  9:41     ` Ingo Molnar
2008-07-21  9:52       ` Pekka Enberg
2008-07-21 10:06         ` Evgeniy Polyakov
2008-07-21 10:50           ` Ingo Molnar
2008-07-21 11:03             ` Vegard Nossum
2008-07-21 11:13               ` Ingo Molnar
2008-07-21 16:19               ` Christoph Lameter
2008-07-21 20:23                 ` Vegard Nossum
2008-07-21 11:25             ` Evgeniy Polyakov
2008-07-21 11:55               ` Ingo Molnar
2008-07-21 12:57                 ` Evgeniy Polyakov
2008-07-21 14:01                   ` Ingo Molnar
2008-07-21 19:21                 ` Ingo Molnar
2008-07-21 21:24                   ` Evgeniy Polyakov
2008-07-21 23:33                     ` David Miller
2008-07-22  7:50                       ` Ingo Molnar
2008-07-22 13:34                         ` Ingo Molnar
2008-07-23 22:31                           ` David Miller
2008-07-23 22:40                             ` Jeff Kirsher
2008-07-21 16:22           ` Christoph Lameter
2008-07-21 19:57             ` Evgeniy Polyakov
2008-07-21 20:05               ` Ingo Molnar
2008-07-21 20:22                 ` Vegard Nossum [this message]
2008-07-18 13:55   ` Christoph Lameter

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=19f34abd0807211322wb1309ecsf98ae8d0a35f5ccf@mail.gmail.com \
    --to=vegard.nossum@gmail.com \
    --cc=cl@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=johnpol@2ka.mipt.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=netdev@vger.kernel.org \
    --cc=penberg@cs.helsinki.fi \
    --cc=rjw@sisk.pl \
    /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