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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2C449C5475B for ; Tue, 20 Feb 2024 15:32:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YaCN8ksOzMkn1Nit6nH4P5OvMTRzarP2v+bQWWOoJT0=; b=ZpXKzHZtS1z4TF ed9Mb7IjXRsNyHkRz1lnXEVFeNarod4QdzebVeuRjJPlhZjggklrYtogpF642e20v0iV+PGxvrXKw qtBPTWGk5RiQ9ZoPQJQn5Kjmbk+fJXAWu2WdfjVbIWv5yW+jux8DjyTTCi7jeaCYdiuyTu/CbTIdh Qo4XJF611tpUPy2yF9pNEhMfaUvCpVceXCX/wb7tkRp3piCknGAnEN6Uvsk0kL1W/f+BvDt98M8/g z/VhF93YrnJu5SgYl9RY811G8I3gcgla6v22jkSUOEEz/aBgPTEwrCvbcRV8b0RxtwU7ksYmjSIyK eT0u4T+TlORRf8wyu2lA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rcS6I-0000000FGxZ-17ij; Tue, 20 Feb 2024 15:32:06 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rcS6E-0000000FGwC-3Uyi for linux-arm-kernel@lists.infradead.org; Tue, 20 Feb 2024 15:32:04 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 3E8DACE1A28; Tue, 20 Feb 2024 15:32:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 022FAC433C7; Tue, 20 Feb 2024 15:31:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1708443120; bh=9XnRy+40nbiu0URK19IolUXgdwSZ/3szEu9iR3CRAtU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hHJsZO2gyWSmB1GXrt2hwT0cMBxcAMLB1kBRo5voX7XKCwMY0YbDvWORqLsw5aG+K /oOOGgGLzqYhR4TbJ2BAtxHI8VGJ8zHsnk1bXu58cZvbPPEvUuUk/7Gb1iHboCnF47 Cz7aEwtNXllUVvOrsHxby+ub2JQd5QCRfDb8AuEE= Date: Tue, 20 Feb 2024 16:31:57 +0100 From: Greg KH To: Ard Biesheuvel Cc: Xiang Yang , mark.rutland@arm.com, catalin.marinas@arm.com, will@kernel.org, keescook@chromium.org, linux-arm-kernel@lists.infradead.org, stable@vger.kernel.org, xiujianfeng@huawei.com, liaochang1@huawei.com Subject: Re: [PATCH 5.10.y v2] Revert "arm64: Stash shadow stack pointer in the task struct on interrupt" Message-ID: <2024022049-worst-dividable-0f1c@gregkh> References: <20240219132153.378265-1-xiangyang3@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240220_073203_063607_8558CC9B X-CRM114-Status: GOOD ( 16.43 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Feb 19, 2024 at 05:57:07PM +0100, Ard Biesheuvel wrote: > On Mon, 19 Feb 2024 at 14:24, Xiang Yang wrote: > > > > This reverts commit 3f225f29c69c13ce1cbdb1d607a42efeef080056. > > > > The shadow call stack for irq now is stored in current task's thread info > > in irq_stack_entry. There is a possibility that we have some soft irqs > > pending at the end of hard irq, and when we process softirq with the irq > > enabled, irq_stack_entry will enter again and overwrite the shadow call > > stack whitch stored in current task's thread info, leading to the > > incorrect shadow call stack restoration for the first entry of the hard > > IRQ, then the system end up with a panic. > > > > task A | task A > > -------------------------------------+------------------------------------ > > el1_irq //irq1 enter | > > irq_handler //save scs_sp1 | > > gic_handle_irq | > > irq_exit | > > __do_softirq | > > | el1_irq //irq2 enter > > | irq_handler //save scs_sp2 > > | //overwrite scs_sp1 > > | ... > > | irq_stack_exit //restore scs_sp2 > > irq_stack_exit //restore wrong | > > //scs_sp2 | > > > > So revert this commit to fix it. > > > > Fixes: 3f225f29c69c ("arm64: Stash shadow stack pointer in the task struct on interrupt") > > > > Signed-off-by: Xiang Yang > > Acked-by: Ard Biesheuvel Now queued up, thanks. greg k-h _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel