lkml.org 
[lkml]   [2018]   [Dec]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 16/24] locking/lockdep: Retain the class key and name while freeing a lock class
On Thu, Dec 06, 2018 at 05:11:40PM -0800, Bart Van Assche wrote:
> The next patch in this series uses the class name in code that
> detects calls to lock_acquire() while a class key is being freed. Hence
> retain the class name for lock classes that are being freed.

From readin the discussion with v2; you meant to say: 'uses the class
name pointer', right? You're not actually ever going to dereference it,
since that would be a UaF.

>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Waiman Long <longman@redhat.com>
> Cc: Johannes Berg <johannes@sipsolutions.net>
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
> ---
> kernel/locking/lockdep.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
> index ecd92969674c..92bdb187987f 100644
> --- a/kernel/locking/lockdep.c
> +++ b/kernel/locking/lockdep.c
> @@ -4147,10 +4147,8 @@ static void zap_class(struct lock_class *class)
> * Unhash the class and remove it from the all_lock_classes list:
> */
> hlist_del_rcu(&class->hash_entry);
> + class->hash_entry.pprev = NULL;
> list_del(&class->lock_entry);
> -
> - RCU_INIT_POINTER(class->key, NULL);
> - RCU_INIT_POINTER(class->name, NULL);
> }
>
> static inline int within(const void *addr, void *start, unsigned long size)
> --
> 2.20.0.rc2.403.gdbc3b29805-goog
>

\
 
 \ /
  Last update: 2018-12-07 11:22    [W:0.185 / U:1.240 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site