[lkml]   [2017]   [Oct]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
SubjectRe: [lockdep] b09be676e0 BUG: unable to handle kernel NULL pointer dereference at 000001f2
On Tue, Oct 03, 2017 at 10:06:34PM +0800, Fengguang Wu wrote:
> Hi Byungchul,
> This patch triggers a NULL-dereference bug at update_stack_state().
> Although its parent commit also has a NULL-dereference bug, however
> the call stack looks rather different. Both dmesg files are attached.
> It also triggers this warning, which is being discussed in another
> thread, so CC Josh. The full dmesg attached, too.
> Please press Enter to activate this console.
> [ 138.605622] WARNING: kernel stack regs at be299c9a in procd:340 has bad 'bp' value 000001be
> [ 138.605627] unwind stack type:0 next_sp: (null) mask:0x2 graph_idx:0
> [ 138.605631] be299c9a: 299ceb00 (0x299ceb00)
> [ 138.605633] be299c9e: 2281f1be (0x2281f1be)
> [ 138.605634] be299ca2: 299cebb6 (0x299cebb6)

I suspect the bug is in:

ce07a9415f26 ("locking/lockdep: Make check_prev_add() able to handle external stack_trace")

It converts the stack-allocated stack_trace struct from static to
non-static, yet still adds it to a list. Does this fix it?

diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index 44c8d0d17170..b4a5e60488aa 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -1986,7 +1986,7 @@ check_prevs_add(struct task_struct *curr, struct held_lock *next)
int depth = curr->lockdep_depth;
struct held_lock *hlock;
- struct stack_trace trace;
+ static struct stack_trace trace;
int (*save)(struct stack_trace *trace) = save_trace;

 \ /
  Last update: 2017-10-03 16:32    [W:0.128 / U:19.512 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site