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=-15.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1, USER_IN_DEF_DKIM_WL 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 6B8F7C433E0 for ; Fri, 22 Jan 2021 21:20:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 40B4123B16 for ; Fri, 22 Jan 2021 21:20:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730519AbhAVVUj (ORCPT ); Fri, 22 Jan 2021 16:20:39 -0500 Received: from linux.microsoft.com ([13.77.154.182]:39976 "EHLO linux.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730013AbhAVVQG (ORCPT ); Fri, 22 Jan 2021 16:16:06 -0500 Received: from [192.168.254.32] (unknown [47.187.219.45]) by linux.microsoft.com (Postfix) with ESMTPSA id 521CE20B7192; Fri, 22 Jan 2021 13:15:13 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 521CE20B7192 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1611350114; bh=LmVa0B7QKVLtgYQ+R0kakMd+3Q+60r35qr0JwnFm7VU=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=jkkEH3MPRrsvDvseero3sthB72ZWEg+KC707Ywto3Jy/Ep77Tj+qFhv1okjYDd/VE /Dx5oxMI4B/ZDYDhnywVkyDim4CKfsMrBcvwer389JXBAyaa0r9CpdSjUIZvG+IbEQ t5ca9vl/Myy4u6O+zq2+QpBXLlGr0Lom72t4ht7A= Subject: Re: [RFC PATCH 00/17] objtool: add base support for arm64 To: Mark Brown , Josh Poimboeuf Cc: Mark Rutland , Michal Marek , Julien Thierry , Peter Zijlstra , Catalin Marinas , Masahiro Yamada , Linux Kernel Mailing List , linux-efi , linux-hardening@vger.kernel.org, live-patching@vger.kernel.org, Will Deacon , Ard Biesheuvel , Linux ARM , Kees Cook References: <20210120173800.1660730-1-jthierry@redhat.com> <186bb660-6e70-6bbf-4e96-1894799c79ce@redhat.com> <20210121185452.fxoz4ehqfv75bdzq@treble> <20210122174342.GG6391@sirena.org.uk> From: "Madhavan T. Venkataraman" Message-ID: Date: Fri, 22 Jan 2021 15:15:12 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20210122174342.GG6391@sirena.org.uk> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/22/21 11:43 AM, Mark Brown wrote: > On Thu, Jan 21, 2021 at 12:54:52PM -0600, Josh Poimboeuf wrote: > >> 2) The shadow stack idea sounds promising -- how hard would it be to >> make a prototype reliable unwinder? > > In theory it doesn't look too hard and I can't see a particular reason > not to try doing this - there's going to be edge cases but hopefully for > reliable stack trace they're all in areas where we would be happy to > just decide the stack isn't reliable anyway, things like nesting which > allocates separate shadow stacks for each nested level for example. > I'll take a look. > I am a new comer to this discussion and I am learning. Just have some questions. Pardon me if they are obvious or if they have already been asked and answered. Doesn't Clang already have support for a shadow stack implementation for ARM64? We could take a look at how Clang does it. Will there not be a significant performance hit? May be, some of it can be mitigated by using a parallel shadow stack rather than a compact one. Are there any longjmp style situations in the kernel where the stack is unwound by several frames? In these cases, the shadow stack must be unwound accordingly. Madhavan > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel > 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=-5.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 10A3CC433E0 for ; Fri, 22 Jan 2021 21:17:19 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 C745A23AF8 for ; Fri, 22 Jan 2021 21:17:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C745A23AF8 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=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=R0QZgOh/PYT+csI9EUcZ3SWj6Q+F+2r7DRJYVqG55RE=; b=Yk5P8jKO2ehJCwrqRzM4ow5dL eclgK2QIqQ96/pj1RS+eZhFLynm5hiS0BaCFecky3nvPnVsWjNMaw5r5iM/xuIFyuZIhqRSBaBLa6 tsICqOrvSFIDyVpNLzai8mBzAi5JO2YXxrdNXLDLR5jeXl4X9HrzyNpR00IKrMlrwQXhREr0QNTA1 POlQAKyajsiaN6T8COtnEk4mK+8RHFDkCROYSgOQGpEDeyE/a/3pP3Li/3hKDzLGLLzL6oXndyP/0 pnVPjZATgZt+tL06NkAhemWZOWXSGUekm9lPUqgnb8i9kuycFB78ZBCdT6Avh1u1O7/mEIF497RLz ZVHk8hbug==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l33m3-0001Lb-Sv; Fri, 22 Jan 2021 21:15:19 +0000 Received: from linux.microsoft.com ([13.77.154.182]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l33m0-0001K4-SG for linux-arm-kernel@lists.infradead.org; Fri, 22 Jan 2021 21:15:17 +0000 Received: from [192.168.254.32] (unknown [47.187.219.45]) by linux.microsoft.com (Postfix) with ESMTPSA id 521CE20B7192; Fri, 22 Jan 2021 13:15:13 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 521CE20B7192 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1611350114; bh=LmVa0B7QKVLtgYQ+R0kakMd+3Q+60r35qr0JwnFm7VU=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=jkkEH3MPRrsvDvseero3sthB72ZWEg+KC707Ywto3Jy/Ep77Tj+qFhv1okjYDd/VE /Dx5oxMI4B/ZDYDhnywVkyDim4CKfsMrBcvwer389JXBAyaa0r9CpdSjUIZvG+IbEQ t5ca9vl/Myy4u6O+zq2+QpBXLlGr0Lom72t4ht7A= Subject: Re: [RFC PATCH 00/17] objtool: add base support for arm64 To: Mark Brown , Josh Poimboeuf References: <20210120173800.1660730-1-jthierry@redhat.com> <186bb660-6e70-6bbf-4e96-1894799c79ce@redhat.com> <20210121185452.fxoz4ehqfv75bdzq@treble> <20210122174342.GG6391@sirena.org.uk> From: "Madhavan T. Venkataraman" Message-ID: Date: Fri, 22 Jan 2021 15:15:12 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20210122174342.GG6391@sirena.org.uk> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210122_161517_087747_11574B28 X-CRM114-Status: GOOD ( 19.14 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Michal Marek , Julien Thierry , Peter Zijlstra , Catalin Marinas , Masahiro Yamada , Linux Kernel Mailing List , linux-efi , linux-hardening@vger.kernel.org, live-patching@vger.kernel.org, Will Deacon , Ard Biesheuvel , Linux ARM , Kees Cook 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 1/22/21 11:43 AM, Mark Brown wrote: > On Thu, Jan 21, 2021 at 12:54:52PM -0600, Josh Poimboeuf wrote: > >> 2) The shadow stack idea sounds promising -- how hard would it be to >> make a prototype reliable unwinder? > > In theory it doesn't look too hard and I can't see a particular reason > not to try doing this - there's going to be edge cases but hopefully for > reliable stack trace they're all in areas where we would be happy to > just decide the stack isn't reliable anyway, things like nesting which > allocates separate shadow stacks for each nested level for example. > I'll take a look. > I am a new comer to this discussion and I am learning. Just have some questions. Pardon me if they are obvious or if they have already been asked and answered. Doesn't Clang already have support for a shadow stack implementation for ARM64? We could take a look at how Clang does it. Will there not be a significant performance hit? May be, some of it can be mitigated by using a parallel shadow stack rather than a compact one. Are there any longjmp style situations in the kernel where the stack is unwound by several frames? In these cases, the shadow stack must be unwound accordingly. Madhavan > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel