From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751511AbdJEN5i (ORCPT ); Thu, 5 Oct 2017 09:57:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43906 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751323AbdJEN5h (ORCPT ); Thu, 5 Oct 2017 09:57:37 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 759FD90E4D Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jpoimboe@redhat.com Date: Thu, 5 Oct 2017 08:57:34 -0500 From: Josh Poimboeuf To: Tetsuo Handa Cc: fengguang.wu@intel.com, byungchul.park@lge.com, mingo@kernel.org, peterz@infradead.org, linux-kernel@vger.kernel.org, lkp@01.org, torvalds@linux-foundation.org, bp@alien8.de, x86@kernel.org, hpa@zytor.com, tglx@linutronix.de Subject: Re: [lockdep] b09be676e0 BUG: unable to handle kernel NULL pointer dereference at 000001f2 Message-ID: <20171005135734.7hiztv6i5abdcqv7@treble> References: <20171003150538.57dq7xe6afikpzyp@treble> <20171003162815.2eatamg4h3tpsypl@treble> <20171003173402.hq4aviy5hztgauyt@treble> <201710040644.GJE89219.FOHMFSFOVtOQLJ@I-love.SAKURA.ne.jp> <20171004224008.3gbwuzn3zfwpidh3@treble> <201710052002.HIH12957.JOFFSMOVFHLOtQ@I-love.SAKURA.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201710052002.HIH12957.JOFFSMOVFHLOtQ@I-love.SAKURA.ne.jp> User-Agent: Mutt/1.6.0.1 (2016-04-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 05 Oct 2017 13:57:37 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 05, 2017 at 08:02:33PM +0900, Tetsuo Handa wrote: > Josh Poimboeuf wrote: > > On Wed, Oct 04, 2017 at 06:44:50AM +0900, Tetsuo Handa wrote: > > > Josh Poimboeuf wrote: > > > > On Tue, Oct 03, 2017 at 11:28:15AM -0500, Josh Poimboeuf wrote: > > > > > There are two bugs: > > > > > > > > > > 1) Somebody -- presumably lockdep -- is corrupting the stack. Need the > > > > > lockdep people to look at that. > > > > > > > > > > 2) The 32-bit FP unwinder isn't handling the corrupt stack very well, > > > > > It's blindly dereferencing untrusted data: > > > > > > > > > > /* Is the next frame pointer an encoded pointer to pt_regs? */ > > > > > regs = decode_frame_pointer(next_bp); > > > > > if (regs) { > > > > > frame = (unsigned long *)regs; > > > > > len = regs_size(regs); > > > > > state->got_irq = true; > > > > > > > > > > On 32-bit, regs_size() dereferences the regs pointer before we know it > > > > > points to a valid stack. I'll fix that, along with the other unwinder > > > > > improvements I discussed with Linus. > > > > > > > > Tetsuo and/or Fengguang, > > > > > > > > Would you mind testing with this patch? It should at least prevent the > > > > unwinder panic and should hopefully print a useful unwinder dump > > > > instead. > > > > > > > Here are two outputs. > > > > Tetsuo, would you mind trying the following patch? > > > Here are two outputs. Same kernel with different host hardware. Thanks, these dumps are more "normal": - The first shows a missing frame pointer setup in atomic64_add_unless_cx8(). - The second shows some frame pointer related issue in the kthread creation path. I don't plan on fixing those, because we don't yet have objtool support for 32-bit and we don't have anything which needs reliable stack traces there. I'll probably just disable those unwinder dumps on 32-bit. -- Josh