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 6E42DC433EF for ; Thu, 25 Nov 2021 14:58:38 +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-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-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=XfyEKLuHp9muzPLivcOKrh3VhuIQ/YIGCSFMGUadnv4=; b=ogKPddGE1xlj5r4dADMn9JVPaL Z3/LD6amCYjgv0Axge9e3o5BgYr/uxb3tOaiPnNt7xjx2S5yEZmJuXSphdMrJ1vvskJumuZePgeBz em6046NM97cHpVB/kFdyh5VpgYiC+/TgSu4uQJbja7KaITynLZxEecClZZ69iI3NC7Z7pGe6heCh2 tCjoEgb33PJ14cs/h0EHg9BlMACoRoKYeKDNzTOzqsU6BWCQ4vlbu1fHOCkss4Gr+TYiFB3sK/G3l FekufqtSmwvGVC+9yRpjKxshsOpI+9zFFeS0T5iqy3rbbntXknZ0H90gk+PsDz9MA+v5K6yMgJPtb 1QaNYgQg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mqGBC-007v2a-CM; Thu, 25 Nov 2021 14:56:54 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mqGB8-007v1y-IX for linux-arm-kernel@lists.infradead.org; Thu, 25 Nov 2021 14:56:51 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id B78F960527; Thu, 25 Nov 2021 14:56:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1637852210; bh=BxuGddqF62NHTgmF6zXHvMp3rqujzOr/SNnZL+sHDa4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Puw16gLEuEJ8skCFKwO9fhNLCkU02IEThkI+Qa7q/wCqS0jaeD1HM3f8O/tEDhhfr /x3UhnrKptA2WPGU6LAMwS5t1VQxeLqofdzEySjFQXYvCILbuvWazFjq0VUWpioZOl rJb2VnuMjIhFSYtnNZioOqRvwmQGjDGJFH4qi9lBoopkXkKrsVBzrLRBVvGlNqPC7I 5LfMShmr2RUZZhAsZMMWHLB935sKG152VdreWuWXmTLFE0NUEsoB3SDABPQM3VNcWy 3+gfM7IbAVB/a1lGxxMjy2UtjV77goxrxpbp/fUBOBIxJAnFCjf8ZLr8POnTqOaOua 6U/1H22NH4Jjw== Date: Thu, 25 Nov 2021 14:56:44 +0000 From: Mark Brown To: madvenka@linux.microsoft.com Cc: mark.rutland@arm.com, jpoimboe@redhat.com, ardb@kernel.org, nobuta.keiya@fujitsu.com, sjitindarsingh@gmail.com, catalin.marinas@arm.com, will@kernel.org, jmorris@namei.org, linux-arm-kernel@lists.infradead.org, live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v11 4/5] arm64: Introduce stack trace reliability checks in the unwinder Message-ID: References: <8b861784d85a21a9bf08598938c11aff1b1249b9> <20211123193723.12112-1-madvenka@linux.microsoft.com> <20211123193723.12112-5-madvenka@linux.microsoft.com> MIME-Version: 1.0 In-Reply-To: <20211123193723.12112-5-madvenka@linux.microsoft.com> X-Cookie: This bag is recyclable. X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211125_065650_661398_FD9BE03B X-CRM114-Status: GOOD ( 20.77 ) 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: multipart/mixed; boundary="===============3936155081748272743==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============3936155081748272743== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="qLWXUA94TwkS4msl" Content-Disposition: inline --qLWXUA94TwkS4msl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Nov 23, 2021 at 01:37:22PM -0600, madvenka@linux.microsoft.com wrote: > Introduce arch_stack_walk_reliable() for ARM64. This works like > arch_stack_walk() except that it returns -EINVAL if the stack trace is not > reliable. > Until all the reliability checks are in place, arch_stack_walk_reliable() > may not be used by livepatch. But it may be used by debug and test code. Probably also worth noting that this doesn't select HAVE_RELIABLE_STACKTRACE which is what any actual users are going to use to identify if the architecture has the feature. I would have been tempted to add arch_stack_walk() as a separate patch but equally having the user code there (even if it itself can't yet be used...) helps with reviewing the actual unwinder so I don't mind. > +static void unwind_check_reliability(struct task_struct *task, > + struct stackframe *frame) > +{ > + if (frame->fp == (unsigned long)task_pt_regs(task)->stackframe) { > + /* Final frame; no more unwind, no need to check reliability */ > + return; > + } If the unwinder carries on for some reason (the code for that is elsewhere and may be updated separately...) then this will start checking again. I'm not sure if this is a *problem* as such but the thing about this being the final frame coupled with not actually explicitly stopping the unwind here makes me think this should at least be clearer, the comment begs the question about what happens if something decides it is not in fact the final frame. --qLWXUA94TwkS4msl Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmGfpCsACgkQJNaLcl1U h9AZ8gf/fIHx2Iw3Apm4D53bXBg2uCgPtniVqn3ga8gWCPuF427MGGbmbID856Fz EsxOaARY4+0rjx82ksssl6P6H/FuRnCJV1xeC24aA01X/VIWbfCg45aIEjKE1YwB cBImU2yYx6dp5Tjkb8zPCaoDUWqOElgj5EjzDm2N2vfspFOvigOdjW0JQdG6sBzE 8vxSgU9hXbddHpa5V4TYhzhTkIjMHrsaLwJoL8PqDlz+jWQcnjXjwUXJreQaGKQs 7GukGrxdHx3sFZHQrmnBv09FQMxL6lU1V0Gi2o3V+IzyX2DRxnGnsLy55NFVYZN5 tBD+LhpsJNNa0Q4uR1RvPfF6V+hRkQ== =XMH9 -----END PGP SIGNATURE----- --qLWXUA94TwkS4msl-- --===============3936155081748272743== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============3936155081748272743==--