mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Waiman Long <longman@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>, Will Deacon <will.deacon@arm.com>,
	Boqun Feng <boqun.feng@gmail.com>
Cc: linux-kernel@vger.kernel.org,
	Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Subject: Re: [PATCH] locking/lockdep: Avoid potential access of invalid memory in lock_class
Date: Mon, 3 Jan 2022 13:26:20 -0800	[thread overview]
Message-ID: <79a44096-57f0-4df7-62e0-a87b3eca6231@acm.org> (raw)
In-Reply-To: <4d3b818e-2aca-a596-644f-28e9e52c27bd@redhat.com>

On 1/3/22 10:17, Waiman Long wrote:
> On 1/3/22 12:47, Bart Van Assche wrote:
>> On 1/2/22 18:35, Waiman Long wrote:
>>> -    WARN_ON_ONCE(!found);
>>> -    __lockdep_free_key_range(pf, key, 1);
>>> -    call_rcu_zapped(pf);
>>> -    graph_unlock();
>>> -out_irq:
>>> +    WARN_ON_ONCE(!found && debug_locks);
>>
>> lockdep_unregister_key() should only be called for a registered key so 
>> I'd
>> like to keep the WARN_ON_ONCE(!found) here instead of changing it into
>> WARN_ON_ONCE(!found && debug_locks). Otherwise this patch looks good 
>> to me.
> 
> The reason for this change is to handle the case that a 
> lockdep_register_key()/lockdep_unregister_key() pair may be called after 
> debug_locks is turned off. Without that change, we are going to get the 
> warning in lockdep_unregister_key(). That is the motivation of your 
> original commit 8b39adbee805 ("locking/lockdep: Make 
> lockdep_unregister_key() honor 'debug_locks' again").

Ah, that's right. Hence:

Reviewed-by: Bart Van Assche <bvanassche@acm.org>

  reply	other threads:[~2022-01-03 21:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-03  2:35 Waiman Long
2022-01-03 17:47 ` Bart Van Assche
2022-01-03 18:17   ` Waiman Long
2022-01-03 21:26     ` Bart Van Assche [this message]
2022-01-26 13:30 ` [tip: locking/core] " tip-bot2 for Waiman Long

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=79a44096-57f0-4df7-62e0-a87b3eca6231@acm.org \
    --to=bvanassche@acm.org \
    --cc=boqun.feng@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=longman@redhat.com \
    --cc=mingo@redhat.com \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    --cc=peterz@infradead.org \
    --cc=will.deacon@arm.com \
    /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®