[<prev] [next>] [day] [month] [year] [list]
Message-ID: <502CFFB6.3080006@oracle.com>
Date: Thu, 16 Aug 2012 22:12:06 +0800
From: Jeff Liu <jeff.liu@...cle.com>
To: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: [PATCH] lockdep: fix potential NULL pointer dereferences
Hello,
In general we can get the symbol name of a particular lock and print it out if something
went wrong regarding lock/unlock stuff.
However, I observed the following info(3.5.0-rc4) when running quotacheck(1) yesterday.
It has occurred only once, I can not reproduced it afterwards.
[15800.938071] quotacheck/11934 is trying to release lock (
[15800.940040] BUG: unable to handle kernel NULL pointer dereference at 0000007c
[15800.940040] IP: [<c10f9b2c>] print_lockdep_cache+0x15/0x86
[15800.940040] *pde = 00000000
[15800.940040] Oops: 0000 [#1] SMP DEBUG_PAGEALLOC
Maybe something wrong at other areas, but I also noticed there is no defense for __get_key_name()
failure at both __print_lock_name() and print_lockdep_cache().
How about to trigger BUG_ON() to indicate it a bit more explicit once such situation is detected?
Thanks,
-Jeff
Signed-off-by: Jie Liu <jeff.liu@...cle.com>
---
kernel/lockdep.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/kernel/lockdep.c b/kernel/lockdep.c
index ea9ee45..dfbcd86 100644
--- a/kernel/lockdep.c
+++ b/kernel/lockdep.c
@@ -508,6 +508,7 @@ static void __print_lock_name(struct lock_class *class)
name = class->name;
if (!name) {
name = __get_key_name(class->key, str);
+ BUG_ON(!name);
printk("%s", name);
} else {
printk("%s", name);
@@ -538,6 +539,7 @@ static void print_lockdep_cache(struct lockdep_map *lock)
if (!name)
name = __get_key_name(lock->key->subkeys, str);
+ BUG_ON(!name);
printk("%s", name);
}
--
1.7.9
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists