From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E9BCEC169C4 for ; Thu, 31 Jan 2019 07:54:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C679420870 for ; Thu, 31 Jan 2019 07:54:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548921266; bh=y8xvEdeMlGI7iNpxGMzqKlF+RWL2etjt73250dPI0CQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=qlLMYmg4vdMVFBsmBFB5vDyHfWSdp3Nnh7mOgrViF4XrgYA0JGCUcdWdi0QfEtJ4y EVbw4NDZzXAg5uoe4f8XylEqkMLkPV5fDBXv0CdmfZs2doaw0AMqw99XyVFdVXw2j3 tw54rIP5CecQBZHewtcqD7Ya4eyO8Axi8rTHr/3c= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726172AbfAaHy0 (ORCPT ); Thu, 31 Jan 2019 02:54:26 -0500 Received: from mail.kernel.org ([198.145.29.99]:51336 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725829AbfAaHy0 (ORCPT ); Thu, 31 Jan 2019 02:54:26 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5D1AD20870; Thu, 31 Jan 2019 07:54:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548921264; bh=y8xvEdeMlGI7iNpxGMzqKlF+RWL2etjt73250dPI0CQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Rdst30JUOLoEQ86pbIXZv2Ey2UdXQCQLkaCKuV0869e01+aib/TZM7Xvj1u0kNT2Q /fqUj2lrIpRGTkQCkZKCn6sE4Uss46Ka3by6jcW/kSj8uZOCmkyxAC0ISeMr32D3rU ld5yTF+sYaLyjeFTFTe5yDiPkIEO6mrE1NRcace0= Date: Thu, 31 Jan 2019 08:54:22 +0100 From: Greg KH To: David Hildenbrand Cc: stable@vger.kernel.org, cohuck@redhat.com, schwidefsky@de.ibm.com Subject: Re: [PATCH v2 for-4.4-stable] s390/smp: Fix calling smp_call_ipl_cpu() from ipl CPU Message-ID: <20190131075422.GA21893@kroah.com> References: <154875549211637@kroah.com> <20190130152107.28839-1-david@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190130152107.28839-1-david@redhat.com> User-Agent: Mutt/1.11.2 (2019-01-07) Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On Wed, Jan 30, 2019 at 04:21:07PM +0100, David Hildenbrand wrote: > commit 60f1bf29c0b2519989927cae640cd1f50f59dc7f upstream. > > When calling smp_call_ipl_cpu() from the IPL CPU, we will try to read > from pcpu_devices->lowcore. However, due to prefixing, that will result > in reading from absolute address 0 on that CPU. We have to go via the > actual lowcore instead. > > This means that right now, we will read lc->nodat_stack == 0 and > therfore work on a very wrong stack. > > This BUG essentially broke rebooting under QEMU TCG (which will report > a low address protection exception). And checking under KVM, it is > also broken under KVM. With 1 VCPU it can be easily triggered. > > :/# echo 1 > /proc/sys/kernel/sysrq > :/# echo b > /proc/sysrq-trigger > [ 28.476745] sysrq: SysRq : Resetting > [ 28.476793] Kernel stack overflow. > [ 28.476817] CPU: 0 PID: 424 Comm: sh Not tainted 5.0.0-rc1+ #13 > [ 28.476820] Hardware name: IBM 2964 NE1 716 (KVM/Linux) > [ 28.476826] Krnl PSW : 0400c00180000000 0000000000115c0c (pcpu_delegate+0x12c/0x140) > [ 28.476861] R:0 T:1 IO:0 EX:0 Key:0 M:0 W:0 P:0 AS:3 CC:0 PM:0 RI:0 EA:3 > [ 28.476863] Krnl GPRS: ffffffffffffffff 0000000000000000 000000000010dff8 0000000000000000 > [ 28.476864] 0000000000000000 0000000000000000 0000000000ab7090 000003e0006efbf0 > [ 28.476864] 000000000010dff8 0000000000000000 0000000000000000 0000000000000000 > [ 28.476865] 000000007fffc000 0000000000730408 000003e0006efc58 0000000000000000 > [ 28.476887] Krnl Code: 0000000000115bfe: 4170f000 la %r7,0(%r15) > [ 28.476887] 0000000000115c02: 41f0a000 la %r15,0(%r10) > [ 28.476887] #0000000000115c06: e370f0980024 stg %r7,152(%r15) > [ 28.476887] >0000000000115c0c: c0e5fffff86e brasl %r14,114ce8 > [ 28.476887] 0000000000115c12: 41f07000 la %r15,0(%r7) > [ 28.476887] 0000000000115c16: a7f4ffa8 brc 15,115b66 > [ 28.476887] 0000000000115c1a: 0707 bcr 0,%r7 > [ 28.476887] 0000000000115c1c: 0707 bcr 0,%r7 > [ 28.476901] Call Trace: > [ 28.476902] Last Breaking-Event-Address: > [ 28.476920] [<0000000000a01c4a>] arch_call_rest_init+0x22/0x80 > [ 28.476927] Kernel panic - not syncing: Corrupt kernel stack, can't continue. > [ 28.476930] CPU: 0 PID: 424 Comm: sh Not tainted 5.0.0-rc1+ #13 > [ 28.476932] Hardware name: IBM 2964 NE1 716 (KVM/Linux) > [ 28.476932] Call Trace: > > Fixes: 2f859d0dad81 ("s390/smp: reduce size of struct pcpu") > Cc: stable@vger.kernel.org # 4.0+ > Reported-by: Cornelia Huck > Signed-off-by: David Hildenbrand > Signed-off-by: Martin Schwidefsky > --- > arch/s390/kernel/smp.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) Now queued up, thanks. greg k-h