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=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 D11E0C433E7 for ; Fri, 16 Oct 2020 11:14:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7EDE3207F7 for ; Fri, 16 Oct 2020 11:14:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394771AbgJPLOh (ORCPT ); Fri, 16 Oct 2020 07:14:37 -0400 Received: from foss.arm.com ([217.140.110.172]:34764 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2394676AbgJPLOh (ORCPT ); Fri, 16 Oct 2020 07:14:37 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 68658D6E; Fri, 16 Oct 2020 04:14:36 -0700 (PDT) Received: from C02TD0UTHF1T.local (unknown [10.57.53.7]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 784FC3F719; Fri, 16 Oct 2020 04:14:34 -0700 (PDT) Date: Fri, 16 Oct 2020 12:14:31 +0100 From: Mark Rutland To: Josh Poimboeuf Cc: Mark Brown , Miroslav Benes , Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, live-patching@vger.kernel.org Subject: Re: [RFC PATCH 0/3] arm64: Implement reliable stack trace Message-ID: <20201016111431.GB84361@C02TD0UTHF1T.local> References: <20201012172605.10715-1-broonie@kernel.org> <20201015141612.GC50416@C02TD0UTHF1T.local> <20201015154951.GD4390@sirena.org.uk> <20201015212931.mh4a5jt7pxqlzxsg@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201015212931.mh4a5jt7pxqlzxsg@treble> Precedence: bulk List-ID: X-Mailing-List: live-patching@vger.kernel.org Hi Josh, On Thu, Oct 15, 2020 at 04:29:31PM -0500, Josh Poimboeuf wrote: > > > AFAICT, existing architectures don't always handle all of the above in > > > arch_stack_walk_reliable(). For example, it looks like x86 assumes > > > unwiding through exceptions is reliable for !CONFIG_FRAME_POINTER, but I > > > think this might not always be true. > > Why not? Mark B's reply dropped this, but the next paragraph covered that: | I was planning to send a mail once I've finished writing a test, but | IIUC there are some windows where ftrace/kretprobes | detection/repainting may not work, e.g. if preempted after | ftrace_return_to_handler() decrements curr_ret_stack, but before the | arch trampoline asm restores the original return addr. So we might | need something like an in_return_trampoline() to detect and report | that reliably. ... so e.g. for a callchain A->B->C, where C is instrumented there are windows where B might be missing from the trace, but the trace is reported as reliable. I'll start a new thread on this (with a more fleshed-out example), with the full set of livepatch folk, lkml, etc. I just want to write a test case first, since it's entirely possible something I've missed is catching this already. Thanks, Mark.