Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2338635ybz; Thu, 23 Apr 2020 16:18:18 -0700 (PDT) X-Google-Smtp-Source: APiQypJ98t73JJh4D9SzC9hkSMJ61TEZeY+bfO2XYYjZA3dWMNzaOAbvTGC6vfrXKAVhPb8mbgjw X-Received: by 2002:a50:8716:: with SMTP id i22mr4860687edb.248.1587683898523; Thu, 23 Apr 2020 16:18:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587683898; cv=none; d=google.com; s=arc-20160816; b=0u3/1RpHdBRH+txAM+O5eRiSwURzNf4Xeho3bH+h75//TT6H6XN+V9iWTFqhgBvB3X JTeIOMePTlA0l77/NJkoFTyy19wfJWIP62JtwpB8IVgnNl0eld3l7uKVvAbSF8Np2bw4 fnl9umvrY6ptyuMxmIXhWBsplvBJuKdGVB/StgOhjHcAotjB7fYnz0x+/oV8EllRVxX/ IS0yo9ateuukdUbVaiHLhutXI6gUF7/oBViZ1MTso2ZOW07YF2sfVbTwHVgl0AENZjTK 1Z8ZpuJROTxdsX7UHVTXW1BRQuH5rrEE3KX6hP1wXKaCX1hsjw06Hs6u5938s0yb3Av0 sKVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=JJ8TgKzayvs63+HcELgweMXOjbGEgZ4io0LA4g58mzk=; b=0bgwcggSQqnYbzt0bHOCVDmLWwpveGXYgkKQk63n6rUZQZWj8Qdlvzz4oTKPHZb2Tb tqMtmdZTzOozSDbhWWJpueYlJ6dtmWh4mBUGOrpJBw+0Cf+YdjlxjjzyXEcuhseoN1EC sikIN4BY7a5ZNOP6YZgcoZalyqfpy1ItyqsY6abV0k5c8bhnK6990e2dbFt+nlZDaCPa YjTKjf7LKTXrCExmCXTejZon8CqSDYaT7FprNxG/Q4J31UFQEcwO9cdJfgoXtGLSu3LC Rw3MRpS9SCnfayIfQX4KeQbMcE6Reb/M1CqrLGrr/AK+UXlTs5T0RiiSaLDxVo9fUlXY SyEA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l18si1984401ejb.405.2020.04.23.16.17.54; Thu, 23 Apr 2020 16:18:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729568AbgDWXPq (ORCPT + 99 others); Thu, 23 Apr 2020 19:15:46 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:49638 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728398AbgDWXGq (ORCPT ); Thu, 23 Apr 2020 19:06:46 -0400 Received: from [192.168.4.242] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1jRkvT-0004iX-J4; Fri, 24 Apr 2020 00:06:35 +0100 Received: from ben by deadeye with local (Exim 4.93) (envelope-from ) id 1jRkvR-00E6p0-3o; Fri, 24 Apr 2020 00:06:33 +0100 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, Denis Kirjanov , "Michael Ellerman" , "Christophe Leroy" Date: Fri, 24 Apr 2020 00:05:51 +0100 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) X-Patchwork-Hint: ignore Subject: [PATCH 3.16 124/245] powerpc/irq: fix stack overflow verification In-Reply-To: X-SA-Exim-Connect-IP: 192.168.4.242 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.83-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Christophe Leroy commit 099bc4812f09155da77eeb960a983470249c9ce1 upstream. Before commit 0366a1c70b89 ("powerpc/irq: Run softirqs off the top of the irq stack"), check_stack_overflow() was called by do_IRQ(), before switching to the irq stack. In that commit, do_IRQ() was renamed __do_irq(), and is now executing on the irq stack, so check_stack_overflow() has just become almost useless. Move check_stack_overflow() call in do_IRQ() to do the check while still on the current stack. Fixes: 0366a1c70b89 ("powerpc/irq: Run softirqs off the top of the irq stack") Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/e033aa8116ab12b7ca9a9c75189ad0741e3b9b5f.1575872340.git.christophe.leroy@c-s.fr Signed-off-by: Ben Hutchings --- arch/powerpc/kernel/irq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/arch/powerpc/kernel/irq.c +++ b/arch/powerpc/kernel/irq.c @@ -471,8 +471,6 @@ void __do_irq(struct pt_regs *regs) trace_irq_entry(regs); - check_stack_overflow(); - /* * Query the platform PIC for the interrupt & ack it. * @@ -504,6 +502,8 @@ void do_IRQ(struct pt_regs *regs) irqtp = hardirq_ctx[raw_smp_processor_id()]; sirqtp = softirq_ctx[raw_smp_processor_id()]; + check_stack_overflow(); + /* Already there ? */ if (unlikely(curtp == irqtp || curtp == sirqtp)) { __do_irq(regs);