From: Peter Zijlstra <peterz@infradead.org>
To: Bart Van Assche <bvanassche@acm.org>
Cc: Ingo Molnar <mingo@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
linux-kernel@vger.kernel.org, Will Deacon <will.deacon@arm.com>,
Waiman Long <longman@redhat.com>, shenghui <shhuiw@foxmail.com>
Subject: Re: [PATCH v2] locking/lockdep: Zap lock classes even with lock debugging disabled
Date: Thu, 4 Apr 2019 11:36:04 +0200 [thread overview]
Message-ID: <20190404093604.GT4038@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20190403233552.124673-1-bvanassche@acm.org>
On Wed, Apr 03, 2019 at 04:35:52PM -0700, Bart Van Assche wrote:
> Commit a0b0fd53e1e6 ("locking/lockdep: Free lock classes that are no longer
> in use") changed the behavior of lockdep_free_key_range() from
> unconditionally zapping lock classes into only zapping lock classes if
> debug_lock == true. Not zapping lock classes if debug_lock == false leaves
> dangling pointers in several lockdep datastructures, e.g. lock_class::name
> in the all_lock_classes list. The shell command "cat /proc/lockdep" causes
> the kernel to iterate the all_lock_classes list. Hence the "unable to
> handle kernel paging request" issue that Shenghui encountered by running
> cat /proc/lockdep. Since the new behavior can cause cat /proc/lockdep to
> crash, restore the pre-v5.1 behavior.
>
> This patch avoids that cat /proc/lockdep triggers the following crash
> with debug_lock == false:
>
> BUG: unable to handle kernel paging request at fffffbfff40ca448
> PGD 13bfde067 P4D 13bfde067 PUD 13bf7a067 PMD 1167d3067 PTE 0
> Oops: 0000 [#1] PREEMPT SMP KASAN
> CPU: 4 PID: 4529 Comm: cat Tainted: G B W O 5.1.0-rc1-dbg+ #4
> Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1 04/01/2014
> RIP: 0010:__asan_load1+0x28/0x50
> Call Trace:
> string+0xac/0x180
> vsnprintf+0x23e/0x820
> seq_vprintf+0x82/0xc0
> seq_printf+0x92/0xb0
> print_name+0x34/0xb0
> l_show+0x184/0x200
> seq_read+0x59e/0x6c0
> proc_reg_read+0x11f/0x170
> __vfs_read+0x4d/0x90
> vfs_read+0xc5/0x1f0
> ksys_read+0xab/0x130
> __x64_sys_read+0x43/0x50
> do_syscall_64+0x71/0x210
> entry_SYSCALL_64_after_hwframe+0x49/0xbe
>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Will Deacon <will.deacon@arm.com>
> Cc: Waiman Long <longman@redhat.com>
> Cc: shenghui <shhuiw@foxmail.com>
> Reported-by: shenghui <shhuiw@foxmail.com>
> Fixes: a0b0fd53e1e6 ("locking/lockdep: Free lock classes that are no longer in use") # v5.1-rc1.
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Thanks!
next prev parent reply other threads:[~2019-04-04 9:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-03 23:35 Bart Van Assche
2019-04-04 9:36 ` Peter Zijlstra [this message]
2019-04-10 12:13 ` [tip:locking/urgent] " tip-bot for Bart Van Assche
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=20190404093604.GT4038@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=bvanassche@acm.org \
--cc=linux-kernel@vger.kernel.org \
--cc=longman@redhat.com \
--cc=mingo@redhat.com \
--cc=shhuiw@foxmail.com \
--cc=tglx@linutronix.de \
--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
Powered by JetHome