public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Akinobu Mita <mita@miraclelinux.com>
To: linux-kernel@vger.kernel.org
Cc: akpm@osdl.org, Akinobu Mita <mita@miraclelinux.com>,
	Matt Mackall <mpm@selenic.com>,
	Manfred Spraul <manfred@colorfullife.com>,
	Pekka J Enberg <penberg@cs.helsinki.fi>
Subject: [patch 4/4] change slab poison pattern
Date: Mon, 24 Apr 2006 16:33:37 +0800	[thread overview]
Message-ID: <20060424083342.743876000@localhost.localdomain> (raw)
In-Reply-To: 20060424083333.217677000@localhost.localdomain

[-- Attachment #1: poison-pattern.patch --]
[-- Type: text/plain, Size: 1205 bytes --]

kref debugging cannot detect kref_put() with unreferenced object,
when the structure including kref is allocated by slab
and slab debugging config is enabled.

Because use-after-free poisoning make kref counter signed value.
So this patch prevents it by changing poisoning pattern.

Signed-off-by: Akinobu Mita <mita@miraclelinux.com>
CC: Matt Mackall <mpm@selenic.com>
CC: Manfred Spraul <manfred@colorfullife.com>
CC: Pekka J Enberg <penberg@cs.helsinki.fi>

 mm/slab.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

Index: 2.6-git/mm/slab.c
===================================================================
--- 2.6-git.orig/mm/slab.c
+++ 2.6-git/mm/slab.c
@@ -503,9 +503,9 @@ struct kmem_cache {
 #define	RED_ACTIVE	0x170FC2A5UL	/* when obj is active */
 
 /* ...and for poisoning */
-#define	POISON_INUSE	0x5a	/* for use-uninitialised poisoning */
-#define POISON_FREE	0x6b	/* for use-after-free poisoning */
-#define	POISON_END	0xa5	/* end-byte of poisoning */
+#define	POISON_INUSE	0xa5	/* for use-uninitialised poisoning */
+#define POISON_FREE	0xb6	/* for use-after-free poisoning */
+#define	POISON_END	0xab	/* end-byte of poisoning */
 
 /*
  * memory layout of objects:

--

  parent reply	other threads:[~2006-04-24  8:34 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-24  8:33 [patch 0/4] kref debugging Akinobu Mita
2006-04-24  8:33 ` [patch 1/4] kref: warn kref_put() with unreferenced kref Akinobu Mita
2006-04-25  3:51   ` Greg KH
2006-04-25  4:19     ` Valdis.Kletnieks
2006-04-25  5:11       ` Greg KH
2006-04-25  4:34     ` Akinobu Mita
2006-04-25  5:09       ` Greg KH
2006-04-25  6:27         ` Akinobu Mita
2006-04-27 11:45   ` Rogier Wolff
2006-04-24  8:33 ` [patch 2/4] kref debugging config option Akinobu Mita
2006-04-24 21:38   ` Andrew Morton
2006-04-25  4:53     ` Akinobu Mita
2006-04-25  5:08       ` Greg KH
2006-04-25  3:52   ` Greg KH
2006-04-24  8:33 ` [patch 3/4] dynamic configurable kref debugging Akinobu Mita
2006-04-25  3:55   ` Greg KH
2006-04-24  8:33 ` Akinobu Mita [this message]
2006-04-24  9:20   ` [patch 4/4] change slab poison pattern Pekka Enberg
2006-04-24 10:23     ` Akinobu Mita
2006-04-24 15:33       ` Matt Mackall
2006-04-25  3:49 ` [patch 0/4] kref debugging Greg KH

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=20060424083342.743876000@localhost.localdomain \
    --to=mita@miraclelinux.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manfred@colorfullife.com \
    --cc=mpm@selenic.com \
    --cc=penberg@cs.helsinki.fi \
    /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