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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3099AC433F5 for ; Wed, 27 Oct 2021 20:08:51 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 0026260234 for ; Wed, 27 Oct 2021 20:08:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0026260234 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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:Date: Message-ID:From:References:Cc:To:Subject:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=4UYi7FxY9oa/IHomgcDcX3y4dMGJXDJ7gBgrtGu8yo4=; b=jBrk3hrYEi0kOiAtiqsuOcdSiv BpEOi1iGSxwUZnCmLp31cxrfNsziMSe9rFgWThNlPqBwLaXX7QWBbRrujm9fKaiZuAdJngM7/bAoN IjxoeaRoNZh3PEaeaKT+sbgn+NRPXB0b7g/EcF2IiRcYAgZFUtcJx7HcluKTLvl+caR6yTgcR411I icIPbyodOeimf68CdR0E3ez7AF10C1UeBj1suenjoNKPRlwh6jTerCSd8UcFHo4JBzmwQwyZFghvJ dpTo6vBjo51kalYC5eT812fgxy3UD66UgibE8olC7QA5dVMzJQZZSH8kOFwf0sI9HC9ynohKWQR0K QvqOXI/Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mfpCl-0060A2-CT; Wed, 27 Oct 2021 20:07:23 +0000 Received: from linux.microsoft.com ([13.77.154.182]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mfpCb-006093-LN for linux-arm-kernel@lists.infradead.org; Wed, 27 Oct 2021 20:07:20 +0000 Received: from [192.168.254.32] (unknown [47.187.212.181]) by linux.microsoft.com (Postfix) with ESMTPSA id 7D73120A5C64; Wed, 27 Oct 2021 13:07:10 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 7D73120A5C64 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1635365231; bh=BGo/Dtg7YwC8q+RFxuQcteIV/YmgEHdRFKrKDWOW+zM=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=GFFcGMtfPsb7c/cwQ8Bs8gXv83qw86n+XfEOD5DCkazvHXeY3soocMGmFANA8g44+ GKuU9BHNGKPokRjr1ZWDQI8ZXb+tccj/Q3E6aO1dYD01iKpzkfh11+o59n00bMzpbI TQh3WVZMWYu5tcXheJo/g0DQlrYdvUTmtiB9mxYI= Subject: Re: [PATCH v10 08/11] arm64: Rename unwinder functions, prevent them from being traced and kprobed To: Mark Rutland Cc: broonie@kernel.org, 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 References: <20211015025847.17694-1-madvenka@linux.microsoft.com> <20211015025847.17694-9-madvenka@linux.microsoft.com> <20211027175325.GC58503@C02TD0UTHF1T.local> From: "Madhavan T. Venkataraman" Message-ID: <88b9f9fb-155f-da97-b8ef-755eaf2a4af9@linux.microsoft.com> Date: Wed, 27 Oct 2021 15:07:09 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20211027175325.GC58503@C02TD0UTHF1T.local> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211027_130713_789963_925ABFA0 X-CRM114-Status: GOOD ( 30.04 ) 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 10/27/21 12:53 PM, Mark Rutland wrote: > On Thu, Oct 14, 2021 at 09:58:44PM -0500, madvenka@linux.microsoft.com wrote: >> From: "Madhavan T. Venkataraman" >> >> Rename unwinder functions for consistency and better naming. >> >> - Rename start_backtrace() to unwind_start(). >> - Rename unwind_frame() to unwind_next(). >> - Rename walk_stackframe() to unwind(). > > This looks good to me. > Thanks. > Could we split this from the krpbes/tracing changes? I think this stands > on it's own, and (as below) the kprobes/tracing changes need some more > explanation, and would make sense as a separate patch. > OK. I will split the patches. >> Prevent the following unwinder functions from being traced: >> >> - unwind_start() >> - unwind_next() >> >> unwind() is already prevented from being traced. > > This could do with an explanation in the commis message as to why we > need to do this. If this is fixing a latent issue, it should be in a > preparatory patch that we can backport. > > I dug into this a bit, and from taking a look, we prohibited ftrace in commit: > > 0c32706dac1b0a72 ("arm64: stacktrace: avoid tracing arch_stack_walk()") > > ... which is just one special case of graph return stack unbalancing, > and should be addressed by using HAVE_FUNCTION_GRAPH_RET_ADDR_PTR, so > with the patch making us use HAVE_FUNCTION_GRAPH_RET_ADDR_PTR, that's > no longer necessary. > > So we no longer seem to have a specific reason to prohibit ftrace > here. > OK, I will think about this and add a comment. >> Prevent the following unwinder functions from being kprobed: >> >> - unwind_start() >> >> unwind_next() and unwind() are already prevented from being kprobed. > > Likewise, I think this needs some explanation. From diggin, we > prohibited kprobes in commit: > > ee07b93e7721ccd5 ("arm64: unwind: Prohibit probing on return_address()") > > ... and the commit message says we need to do this because this is > (transitively) called by trace_hardirqs_off(), which is kprobes > blacklisted, but doesn't explain the actual problem this results in. > OK. I will think about this and add a comment. > AFAICT x86 directly uses __builtin_return_address() here, but that won't > recover rewritten addresses, which seems like a bug (or at least a > limitation) on x86, assuming I've read that correctly. > OK. Thanks, Madhavan _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel