From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============6716651203830229178==" MIME-Version: 1.0 From: Josh Poimboeuf To: lkp@lists.01.org Subject: Re: [lockdep] b09be676e0 BUG: unable to handle kernel NULL pointer dereference at 000001f2 Date: Thu, 05 Oct 2017 08:01:46 -0500 Message-ID: <20171005130146.pmayo6owv362zfai@treble> In-Reply-To: List-Id: --===============6716651203830229178== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On Tue, Oct 03, 2017 at 09:54:31AM -0700, Linus Torvalds wrote: > On Tue, Oct 3, 2017 at 7:06 AM, Fengguang Wu w= rote: > > > > 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 gr= aph_idx:0 > > [ 138.605631] be299c9a: 299ceb00 (0x299ceb00) > > [ 138.605633] be299c9e: 2281f1be (0x2281f1be) > > [ 138.605634] be299ca2: 299cebb6 (0x299cebb6) > > > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git mast= er > > > > commit b09be676e0ff25bd6d2e7637e26d349f9109ad75 > > locking/lockdep: Implement the 'crossrelease' feature > = > Can we consider just reverting the crossrelease thing? > = > The apparent stack corruption really worries me, and what worries me > most is that commit wasn't even supposed to change anything as far as > I can tell - it only adds infrastructure, no actual users that *set* > the cross-lock thing. > = > So the fact that it actually seems to cause behavioural changes seems > to be _really_ scary, and indicates that the code is completely > broken. > = > Or am I missing something? So I gave crossrelease a bad rap here. Going back and looking at the panics and stack dumps, what I thought was "stack corruption" was actually the GCC unaligned stack pointer thing. I suspect those commits were implicated in the bisections because they started doing more stack traces in general, revealing some existing 32-bit unwinder/GCC/frame pointer bugs in the process. So I just wanted to clarify that crossrelease seems to be innocent in all this. Sorry for the confusion! -- = Josh --===============6716651203830229178==-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751418AbdJENBu (ORCPT ); Thu, 5 Oct 2017 09:01:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35970 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751280AbdJENBt (ORCPT ); Thu, 5 Oct 2017 09:01:49 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com C98D4776C6 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jpoimboe@redhat.com Date: Thu, 5 Oct 2017 08:01:46 -0500 From: Josh Poimboeuf To: Linus Torvalds Cc: Fengguang Wu , Byungchul Park , Ingo Molnar , "Peter Zijlstra (Intel)" , Linux Kernel Mailing List , LKP Subject: Re: [lockdep] b09be676e0 BUG: unable to handle kernel NULL pointer dereference at 000001f2 Message-ID: <20171005130146.pmayo6owv362zfai@treble> References: <20171003140634.r2jzujgl62ox4uzh@wfg-t540p.sh.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: 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.27]); Thu, 05 Oct 2017 13:01:49 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 03, 2017 at 09:54:31AM -0700, Linus Torvalds wrote: > On Tue, Oct 3, 2017 at 7:06 AM, Fengguang Wu wrote: > > > > 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) > > > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master > > > > commit b09be676e0ff25bd6d2e7637e26d349f9109ad75 > > locking/lockdep: Implement the 'crossrelease' feature > > Can we consider just reverting the crossrelease thing? > > The apparent stack corruption really worries me, and what worries me > most is that commit wasn't even supposed to change anything as far as > I can tell - it only adds infrastructure, no actual users that *set* > the cross-lock thing. > > So the fact that it actually seems to cause behavioural changes seems > to be _really_ scary, and indicates that the code is completely > broken. > > Or am I missing something? So I gave crossrelease a bad rap here. Going back and looking at the panics and stack dumps, what I thought was "stack corruption" was actually the GCC unaligned stack pointer thing. I suspect those commits were implicated in the bisections because they started doing more stack traces in general, revealing some existing 32-bit unwinder/GCC/frame pointer bugs in the process. So I just wanted to clarify that crossrelease seems to be innocent in all this. Sorry for the confusion! -- Josh