Re: "cat /proc/lockdep" after "rmmod <some module>" when !debug_locks will crash the system

From: Bart Van Assche
Date: Tue Mar 26 2019 - 13:49:14 EST


On Tue, 2019-03-26 at 10:44 -0700, Bart Van Assche wrote:
+AD4 On Tue, 2019-03-26 at 08:35 +-0800, shenghui wrote:
+AD4 +AD4 My test steps:
+AD4 +AD4 --------------
+AD4 +AD4 1) bootup the system, and check the calltrace in dmesg. Just warning and ignore it.
+AD4 +AD4 2) cat /proc/lockdep +ACM everything is well
+AD4 +AD4 3) rmmod some module which provides lock+AF8-class in lockdep
+AD4 +AD4 In my system, module bcache is used: ('grep bcache /proc/lockdep' prints something)
+AD4 +AD4 +ACo stop bcache set
+AD4 +AD4 +ACo rmmod bcache
+AD4 +AD4 I have tried other module, e.g: rmmod iwldvm
+AD4 +AD4 4) cat /proc/lockdep +ACM system crash
+AD4
+AD4 Hi shenghui,
+AD4
+AD4 Thank you for having shared your test steps. I ran a slightly different test
+AD4 myself:
+AD4
+AD4 while true+ADs do cat /proc/lockdep +AD4-/dev/null+ADs done +ACY
+AD4 (cd blktests +ACYAJg while ./check -q+ADs do :+ADs done)

It seems like I hit +ACI-send+ACI too quickly. That test just triggered the following:

BUG: unable to handle kernel paging request at fffffbfff40ca448
+ACM-PF error: +AFs-normal kernel read fault+AF0
PGD 13bfde067 P4D 13bfde067 PUD 13bf7a067 PMD 1167d3067 PTE 0
Oops: 0000 +AFsAIw-1+AF0 PREEMPT SMP KASAN
CPU: 4 PID: 4529 Comm: cat Tainted: G B W O 5.1.0-rc1-dbg+- +ACM-4
Hardware name: QEMU Standard PC (i440FX +- PIIX, 1996), BIOS 1.10.2-1 04/01/2014
RIP: 0010:+AF8AXw-asan+AF8-load1+-0x28/0x50
Call Trace:
string+-0xac/0x180
vsnprintf+-0x23e/0x820
seq+AF8-vprintf+-0x82/0xc0
seq+AF8-printf+-0x92/0xb0
print+AF8-name+-0x34/0xb0
l+AF8-show+-0x184/0x200
seq+AF8-read+-0x59e/0x6c0
proc+AF8-reg+AF8-read+-0x11f/0x170
+AF8AXw-vfs+AF8-read+-0x4d/0x90
vfs+AF8-read+-0xc5/0x1f0
ksys+AF8-read+-0xab/0x130
+AF8AXw-x64+AF8-sys+AF8-read+-0x43/0x50
do+AF8-syscall+AF8-64+-0x71/0x210
entry+AF8-SYSCALL+AF8-64+AF8-after+AF8-hwframe+-0x49/0xbe

I will have a closer look at this.

Bart.