Skip to contentSkip to conversation

lockdep: Make print_lock() address visible

PATCH Kees Cook 2 participants 2 messages Sep 17, 2019 – Sep 18, 2019 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Kees Cook

author
#1 lore raw
Quoted 17 lines · On Mon, Sep 16, 2019 at 06:39:46PM -0700, [email protected] wrote:

commit 519248f36d6f3c80e176f6fa844c10d94f1f5990

Author: Paul E. McKenney <[email protected]>
Date:   Thu May 30 05:39:25 2019 -0700

lockdep: Make print_lock() address visible

Security is a wonderful thing, but so is the ability to debug based on lockdep warnings. This commit therefore makes lockdep lock addresses visible in the clear.

kernel/locking/lockdep.c +0 -0
index 4861cf8e274b..4aca3f4379d2 100644

kernel/locking/lockdep.c static void print_lock(struct held_lock *hlock) · line 626

Quoted 8 lines
kernel/locking/lockdep.c +1 -1
@@ -620,7 +620,7 @@ static void print_lock(struct held_lock *hlock)
 		return;
 	}
 
-	printk(KERN_CONT "%p", hlock->instance);
+	printk(KERN_CONT "%px", hlock->instance);
 	print_lock_name(lock);
 	printk(KERN_CONT ", at: %pS\n", (void *)hlock->acquire_ip);
 }

Just to clarify: this is only visible under CONFIG_LOCKDEP, yes? That's not a state anyone would run a production system under, I'd hope.

Signature · 1 line
Kees Cook
#2 lore raw
Quoted 21 lines · Kees Cook
Quoted 20 lines · On Mon, Sep 16, 2019 at 06:39:46PM -0700, [email protected] wrote:

commit 519248f36d6f3c80e176f6fa844c10d94f1f5990

Author: Paul E. McKenney <[email protected]>
Date:   Thu May 30 05:39:25 2019 -0700

lockdep: Make print_lock() address visible

Security is a wonderful thing, but so is the ability to debug based on lockdep warnings. This commit therefore makes lockdep lock addresses visible in the clear.

kernel/locking/lockdep.c +0 -0
index 4861cf8e274b..4aca3f4379d2 100644
@@ -620,7 +620,7 @@ static void print_lock(struct held_lock *hlock)
 		return;
 	}
 
Quoted 8 lines

kernel/locking/lockdep.c static void print_lock(struct held_lock *hlock) · line 626

Quoted 5 lines
kernel/locking/lockdep.c +1 -1
-	printk(KERN_CONT "%p", hlock->instance);
+	printk(KERN_CONT "%px", hlock->instance);
 	print_lock_name(lock);
 	printk(KERN_CONT ", at: %pS\n", (void *)hlock->acquire_ip);
 }

Just to clarify: this is only visible under CONFIG_LOCKDEP, yes? That's not a state anyone would run a production system under, I'd hope.

Yes, by my reading of kernel/locking/Makefile, the entire kernel/locking/lockdep.c file is completely ignored unless CONFIG_LOCKDEP=y.

So yes, it would be silly for this code to be in a production system.

Thanx, Paul