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=-6.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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 8E4BCC433DB for ; Mon, 25 Jan 2021 21:22:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4E4052220F for ; Mon, 25 Jan 2021 21:22:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732610AbhAYVW0 (ORCPT ); Mon, 25 Jan 2021 16:22:26 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:58675 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732665AbhAYVVI (ORCPT ); Mon, 25 Jan 2021 16:21:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611609579; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=gfg/hxSYIFb+RC3VgIgWh3IEpOrZKtS57wEA5wqW8hY=; b=LyoMwtcJaXISdgsWH9sz2JtiuhyPFgs14/eVwpVlSmg1fbxh/Qc9KxfT+Ir1oUQpX7lEOS 3d0hUF4HlPyb+wZCW0Txx22pQGT1oHMsHvwEjmcttjtwtO9PNthSPQH4sW32Jo86Iw7gUL pzVhSLRuv+S/tQNFa/hoph+gOzrKfTc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-24-7J9p8aPkNCeVG5QgMZHZjg-1; Mon, 25 Jan 2021 16:19:35 -0500 X-MC-Unique: 7J9p8aPkNCeVG5QgMZHZjg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 133E710054FF; Mon, 25 Jan 2021 21:19:33 +0000 (UTC) Received: from treble (ovpn-120-118.rdu2.redhat.com [10.10.120.118]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 23F015D6AB; Mon, 25 Jan 2021 21:19:31 +0000 (UTC) Date: Mon, 25 Jan 2021 15:19:29 -0600 From: Josh Poimboeuf To: Ard Biesheuvel Cc: "Madhavan T. Venkataraman" , Mark Brown , 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 , Linux ARM , Kees Cook Subject: Re: [RFC PATCH 00/17] objtool: add base support for arm64 Message-ID: <20210125211929.62e6gzvl54hpmwn2@treble> References: <20210120173800.1660730-1-jthierry@redhat.com> <186bb660-6e70-6bbf-4e96-1894799c79ce@redhat.com> <20210121185452.fxoz4ehqfv75bdzq@treble> <20210122174342.GG6391@sirena.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 22, 2021 at 10:43:09PM +0100, Ard Biesheuvel wrote: > On Fri, 22 Jan 2021 at 22:15, Madhavan T. Venkataraman wrote: > > 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. > > > > Hello Madhavan, > > Let's discuss the details of shadow call stacks on a separate thread, > instead of further hijacking Julien's series. It's quite relevant to this thread. There's no need to consider merging Julien's patches if you have a better approach. Why not discuss it here? I'm also interested in the answers to Madhavan's questions. -- Josh 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=-4.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 1C65DC433E0 for ; Mon, 25 Jan 2021 21:20:50 +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 CB12820719 for ; Mon, 25 Jan 2021 21:20:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CB12820719 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.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:References:Message-ID: Subject: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=BZHvn6tqnoXQPTQ1UuGw56Es7cxmm2nvk2NLJlv6Yto=; b=rFXgOJUJB+QV9WeHcQQr8xjlz SX9Og38GrBh1eT0GH+fCsQGD31I3gqv0fNuncVxUJIFNjB80J2W04jqmtwdIFMln0z4KGL//bPCZo qAWqH5rzGZoXSqevM4nzN2IWdnFoUiYgstW+2JTaxuesPH0fuamHflhgiuPjtQkKDPDaL7Zg3B1ai k43MHJU4zYqoHhfkLr8S/G8+zmJaTU8ZkqJFzmxYLfjgSmroLx8GV7MzpT4vsuzr40ZPRrz0D0JY0 TADDQwf4UdIRYsp+CAf3A+r7ZilK2a/tHZ3WPi817gk425AnVvKoLNNCcsrEBySCtL/2rhfcXsc2k p+RciuPXA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l49Gx-00015l-C3; Mon, 25 Jan 2021 21:19:43 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l49Gu-00014w-QX for linux-arm-kernel@lists.infradead.org; Mon, 25 Jan 2021 21:19:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611609579; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=gfg/hxSYIFb+RC3VgIgWh3IEpOrZKtS57wEA5wqW8hY=; b=LyoMwtcJaXISdgsWH9sz2JtiuhyPFgs14/eVwpVlSmg1fbxh/Qc9KxfT+Ir1oUQpX7lEOS 3d0hUF4HlPyb+wZCW0Txx22pQGT1oHMsHvwEjmcttjtwtO9PNthSPQH4sW32Jo86Iw7gUL pzVhSLRuv+S/tQNFa/hoph+gOzrKfTc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-24-7J9p8aPkNCeVG5QgMZHZjg-1; Mon, 25 Jan 2021 16:19:35 -0500 X-MC-Unique: 7J9p8aPkNCeVG5QgMZHZjg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 133E710054FF; Mon, 25 Jan 2021 21:19:33 +0000 (UTC) Received: from treble (ovpn-120-118.rdu2.redhat.com [10.10.120.118]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 23F015D6AB; Mon, 25 Jan 2021 21:19:31 +0000 (UTC) Date: Mon, 25 Jan 2021 15:19:29 -0600 From: Josh Poimboeuf To: Ard Biesheuvel Subject: Re: [RFC PATCH 00/17] objtool: add base support for arm64 Message-ID: <20210125211929.62e6gzvl54hpmwn2@treble> References: <20210120173800.1660730-1-jthierry@redhat.com> <186bb660-6e70-6bbf-4e96-1894799c79ce@redhat.com> <20210121185452.fxoz4ehqfv75bdzq@treble> <20210122174342.GG6391@sirena.org.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210125_161940_907753_B8C82DB5 X-CRM114-Status: GOOD ( 26.39 ) 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 , linux-efi , Michal Marek , Julien Thierry , Peter Zijlstra , Catalin Marinas , Masahiro Yamada , Linux Kernel Mailing List , "Madhavan T. Venkataraman" , Mark Brown , linux-hardening@vger.kernel.org, live-patching@vger.kernel.org, Will Deacon , 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 Fri, Jan 22, 2021 at 10:43:09PM +0100, Ard Biesheuvel wrote: > On Fri, 22 Jan 2021 at 22:15, Madhavan T. Venkataraman wrote: > > 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. > > > > Hello Madhavan, > > Let's discuss the details of shadow call stacks on a separate thread, > instead of further hijacking Julien's series. It's quite relevant to this thread. There's no need to consider merging Julien's patches if you have a better approach. Why not discuss it here? I'm also interested in the answers to Madhavan's questions. -- Josh _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel