From: "Randy.Dunlap" <rdunlap@xenotime.net>
To: "Randy.Dunlap" <rdunlap@xenotime.net>
Cc: davej@redhat.com, mingo@elte.hu, mbligh@google.com,
akpm@osdl.org, apw@shadowen.org, linux-kernel@vger.kernel.org
Subject: [PATCH] poison: add & use more constants
Date: Mon, 5 Jun 2006 13:54:01 -0700 [thread overview]
Message-ID: <20060605135401.f7941311.rdunlap@xenotime.net> (raw)
In-Reply-To: <20060605131447.4f46bbaf.rdunlap@xenotime.net>
From: Randy Dunlap <rdunlap@xenotime.net>
Add more poison values to include/linux/poison.h.
It's not clear to me whether some others should be added or not,
so I haven't added any of these:
./include/linux/libata.h:#define ATA_TAG_POISON 0xfafbfcfdU
./arch/ppc/8260_io/fcc_enet.c:1918: memset((char *)(&(immap->im_dprambase[(mem_addr+64)])), 0x88, 32);
./drivers/usb/mon/mon_text.c:429: memset(mem, 0xe5, sizeof(struct mon_event_text));
./drivers/char/ftape/lowlevel/ftape-ctl.c:738: memset(ft_buffer[i]->address, 0xAA, FT_BUFF_SIZE);
./drivers/block/sx8.c:/* 0xf is just arbitrary, non-zero noise; this is sorta like poisoning */
Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
---
include/linux/poison.h | 7 +++++++
kernel/mutex-debug.c | 5 +++--
security/keys/key.c | 3 ++-
3 files changed, 12 insertions(+), 3 deletions(-)
--- linux-2617-rc5mm3.orig/include/linux/poison.h
+++ linux-2617-rc5mm3/include/linux/poison.h
@@ -45,6 +45,13 @@
/********** drivers/atm/ **********/
#define ATM_POISON_FREE 0x12
+/********** kernel/mutexes **********/
+#define MUTEX_DEBUG_INIT 0x11
+#define MUTEX_DEBUG_FREE 0x22
+
+/********** security/ **********/
+#define KEY_DESTROY 0xbd
+
/********** sound/oss/ **********/
#define OSS_POISON_FREE 0xAB
--- linux-2617-rc5mm3.orig/kernel/mutex-debug.c
+++ linux-2617-rc5mm3/kernel/mutex-debug.c
@@ -16,6 +16,7 @@
#include <linux/sched.h>
#include <linux/delay.h>
#include <linux/module.h>
+#include <linux/poison.h>
#include <linux/spinlock.h>
#include <linux/kallsyms.h>
#include <linux/interrupt.h>
@@ -155,7 +156,7 @@ void debug_mutex_set_owner(struct mutex
void debug_mutex_lock_common(struct mutex *lock, struct mutex_waiter *waiter)
{
- memset(waiter, 0x11, sizeof(*waiter));
+ memset(waiter, MUTEX_DEBUG_INIT, sizeof(*waiter));
waiter->magic = waiter;
INIT_LIST_HEAD(&waiter->list);
}
@@ -171,7 +172,7 @@ void debug_mutex_wake_waiter(struct mute
void debug_mutex_free_waiter(struct mutex_waiter *waiter)
{
DEBUG_WARN_ON(!list_empty(&waiter->list));
- memset(waiter, 0x22, sizeof(*waiter));
+ memset(waiter, MUTEX_DEBUG_FREE, sizeof(*waiter));
}
void debug_mutex_add_waiter(struct mutex *lock, struct mutex_waiter *waiter,
--- linux-2617-rc5mm3.orig/security/keys/key.c
+++ linux-2617-rc5mm3/security/keys/key.c
@@ -11,6 +11,7 @@
#include <linux/module.h>
#include <linux/init.h>
+#include <linux/poison.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/security.h>
@@ -986,7 +987,7 @@ void unregister_key_type(struct key_type
if (key->type == ktype) {
if (ktype->destroy)
ktype->destroy(key);
- memset(&key->payload, 0xbd, sizeof(key->payload));
+ memset(&key->payload, KEY_DESTROY, sizeof(key->payload));
}
}
---
next prev parent reply other threads:[~2006-06-05 20:51 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-05 16:30 2.6.17-rc5-mm3 Martin Bligh
2006-06-05 19:44 ` 2.6.17-rc5-mm3 Ingo Molnar
2006-06-05 20:00 ` 2.6.17-rc5-mm3 Randy.Dunlap
2006-06-05 20:05 ` 2.6.17-rc5-mm3 Ingo Molnar
2006-06-05 20:05 ` 2.6.17-rc5-mm3 Dave Jones
2006-06-05 20:08 ` 2.6.17-rc5-mm3 Ingo Molnar
2006-06-05 20:14 ` 2.6.17-rc5-mm3 Randy.Dunlap
2006-06-05 20:54 ` Randy.Dunlap [this message]
2006-06-06 13:33 ` [PATCH] poison: add & use more constants Steven Rostedt
2006-06-06 8:56 ` [patch, -rc5-mm3] better lock debugging: remove mutex deadlock checking code Ingo Molnar
2006-06-06 11:40 ` Andy Whitcroft
2006-06-06 17:17 ` Andy Whitcroft
2006-06-06 19:29 ` Ingo Molnar
2006-06-07 9:17 ` Andy Whitcroft
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=20060605135401.f7941311.rdunlap@xenotime.net \
--to=rdunlap@xenotime.net \
--cc=akpm@osdl.org \
--cc=apw@shadowen.org \
--cc=davej@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mbligh@google.com \
--cc=mingo@elte.hu \
/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®