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 4720EC54E41 for ; Wed, 6 Mar 2024 16:03:13 +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=Z4BTRRJ3JNamjJx6h8DsciEk6F/zk3zleJV0JRm0V/0=; b=OAfcgQGeXIUMkR U+Hp2MFqwlt8LTy6YDITBlo9oIUrtTFaNbfuIZlIZCqHU998ds1zsQV4DX6BGW8nv/h5lUjPgBFeK eJ6NeyAgC26eUNaUMtMccWKA7NzhKx77qjA/ZgRqhx7IG622kfbD6iCXxyrWJTPUGL/XDr4BfnFPQ mD9Q174wa1hC8VkPXh560WFUfgNDU56UJ6LwGSYbu+Y4PcCFLexbb/e49DdP2TmZwC4vaWtp1uY+L AQgEyFQEdcO1euQngbm4Lm6asFvat60gnDH1f75xYGDhvsikUAgsq3OE2xmejb1DHitFtQobcTgKC D4kC8CJPHBsrRhE2QTtg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhtjM-00000000te1-0OHJ; Wed, 06 Mar 2024 16:02:56 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhtjI-00000000tcK-3yoK for linux-arm-kernel@lists.infradead.org; Wed, 06 Mar 2024 16:02:54 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 15AA9CE1F62; Wed, 6 Mar 2024 16:02:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A7C5AC43390; Wed, 6 Mar 2024 16:02:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709740970; bh=IG8ko0VxIq5wqmccJeKPMEw+wW9fETH2/U5QZozNYlA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=U8xe60q1U4UDSVgM19Kfn8IQ3KbWk/TOY6ykEVfiCuow4FBb811BhgFZHXYqTw+YA sYRIZuRtcj6NbVqPUlHFiDW4wcm4FrxATY1DCxlQWv7zhalsJcuLYAn6zFyZiG3aMx 23TSIPOGxLIwvRCHaJg1R5Zepuiz0rkQ65Y6O/0AwpAnzxV1HdwX9CbeEzcNWhQYlw lgoZdmkHPO3vIcOjRwzV7va+8B7wjJe30bs3PwYULC788JvXpIvY+NW56Yjk4U/aDI S8Vqit6socqN0kKKV2ILZlfOyWLcmpj3r6uG4v9Oy+YOVWB0FjnOdKC6sJKxTDW3TQ ubsCZETCragQQ== Date: Wed, 6 Mar 2024 08:02:48 -0800 From: Josh Poimboeuf To: "Russell King (Oracle)" Cc: Jiangfeng Xiao , Kees Cook , Jann Horn , gustavoars@kernel.org, akpm@linux-foundation.org, peterz@infradead.org, dave.hansen@linux.intel.com, kirill.shutemov@linux.intel.com, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org, linux-mm@kvack.org, nixiaoming@huawei.com, kepler.chenxin@huawei.com, wangbing6@huawei.com, wangfangpeng1@huawei.com, douzhaolei@huawei.com, linux-arm-kernel@lists.infradead.org, Ard Biesheuvel Subject: Re: [PATCH] usercopy: delete __noreturn from usercopy_abort Message-ID: <20240306160248.oxeblpwa5zvplmgw@treble> References: <1709516385-7778-1-git-send-email-xiaojiangfeng@huawei.com> <202403040938.D770633@keescook> <77bb0d81-f496-7726-9495-57088a4c0bfc@huawei.com> <202403050129.5B72ACAA0D@keescook> <20240305175846.qnyiru7uaa7itqba@treble> 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-20240306_080253_204241_B976140E X-CRM114-Status: GOOD ( 19.47 ) 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 Wed, Mar 06, 2024 at 09:52:01AM +0000, Russell King (Oracle) wrote: > On Tue, Mar 05, 2024 at 09:58:46AM -0800, Josh Poimboeuf wrote: > > This is an off-by-one bug which is common in unwinders, due to the fact > > that the address on the stack points to the return address rather than > > the call address. > > > > So, for example, when the last instruction of a function is a function > > call (e.g., to a noreturn function), it can cause the unwinder to > > incorrectly try to unwind from the function *after* the callee. > > I suppose this can only happen in __noreturn functions because that > can be: > > foo: > ... > bl bar > ... end of function and thus next function ... > > which results in LR pointing into the next function. > > Would it make better sense to lookup the LR value winding it back by > one instruction like ORC on x86 does (as you mention) rather than > the patch you proposed which looks rather large and complicated? That patch *is* an attempt to make it match ORC's behavior. What specifically looks complicated about it? -- Josh _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel