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=-8.4 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 E0B25CA9EAE for ; Tue, 29 Oct 2019 17:45:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B708C20679 for ; Tue, 29 Oct 2019 17:45:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="rPGbbUqA" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729333AbfJ2Rpf (ORCPT ); Tue, 29 Oct 2019 13:45:35 -0400 Received: from mail-vk1-f194.google.com ([209.85.221.194]:44698 "EHLO mail-vk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726462AbfJ2Rpf (ORCPT ); Tue, 29 Oct 2019 13:45:35 -0400 Received: by mail-vk1-f194.google.com with SMTP id o198so3070334vko.11 for ; Tue, 29 Oct 2019 10:45:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=65YP9F0KitFD9legdxyLM59RAjKBzdRGrjI3L/m7ObE=; b=rPGbbUqAwVHq7Cm0rGfrw8aZKG5VrL44JQ4WF1AX8zOdwQI8rkKHDe3Opfeq0pYbYi ZvPBEVky5mJq0A1utYxoVfchIrzcrJxh4cYKqeEyKqh3F5ZpGjwR7FuS+45Wd+YvZTAR FCYHhGld6MAkj8PSSTu0jSSloZk6eBz34o6f90VAXFRXs/86osn7qCWlcHM8wNytg3QS uJNMarnDvny6K3ClI88qEsq5+XwNmoTiSipJzzK0eD0W9Nwi+d6vcizeA7IRNM1KW01T 8D5hlGzbW/5Mpci+BoZWh8xm7HIZT8sr5w3L36adlm6C6pBdnby12ApWTEuM8rl7eyke UlVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=65YP9F0KitFD9legdxyLM59RAjKBzdRGrjI3L/m7ObE=; b=XXDYKpHc04U9KkXSAmHU2hnBqnG6/7YH3gX3AlTvAb97fiwjQpl01YNJKM2J5h5F0q 47LkPvTgWji0CdWfQk0zFpE3RYvUD6hJy/1SFiH6LTaW8+Ts/SbG462OrgEW4S8AbWKU NzpT64lxzjW55EkNMS2gJ82OhgX8vgxnYZV6YFlzyaxq9kbH5drkPnpsUN56ov4uXtrh kY73ibSrQGqSiF8FZux5jizSOU+tmsR6SOBRZAc7NrgAw5hbDUJZsMrx7YWPRqTnQOgD yEBoMdr2IS3hUksvETlLEcyvg7rowpTdRXRJH34K1TFSxWnxvpOQXG3hyRhlVKDpTi95 jHbQ== X-Gm-Message-State: APjAAAWyDShHOaFysCzsRphAItz8qOV785zCFaLqHeAwDjj+Y6ADFuqT ikMQn7OBroxAGQJgKImtp7KCd73W+2ypiX/8OmK7ow== X-Google-Smtp-Source: APXvYqyofjlHaKbwoCfizqOngvFU3/FN2jdIJr9xQCjuFQ8iVqA3V1NcHewQYwziFUY5XcE5H3ggNp7mqR1GIqnLUe8= X-Received: by 2002:a1f:7d88:: with SMTP id y130mr12501967vkc.71.1572371133208; Tue, 29 Oct 2019 10:45:33 -0700 (PDT) MIME-Version: 1.0 References: <20191018161033.261971-1-samitolvanen@google.com> <20191024225132.13410-1-samitolvanen@google.com> <20191024225132.13410-10-samitolvanen@google.com> <20191025110313.GE40270@lakrids.cambridge.arm.com> In-Reply-To: <20191025110313.GE40270@lakrids.cambridge.arm.com> From: Sami Tolvanen Date: Tue, 29 Oct 2019 10:45:22 -0700 Message-ID: Subject: Re: [PATCH v2 09/17] arm64: disable function graph tracing with SCS To: Mark Rutland , Nick Desaulniers Cc: Will Deacon , Catalin Marinas , Steven Rostedt , Masami Hiramatsu , Ard Biesheuvel , Dave Martin , Kees Cook , Laura Abbott , Jann Horn , Miguel Ojeda , Masahiro Yamada , clang-built-linux , Kernel Hardening , linux-arm-kernel , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 25, 2019 at 4:03 AM Mark Rutland wrote: > I'm guessing it's difficult to always figure out the SCS slot for an > instrumented callsite unless we pass this explicitly from the ftrace > entry code, so we'd probably have to change some common infrastructure > for that. > > We have a similar issue with pointer authentication, and we're solving > that with -fpatchable-function-entry, which allows us to hook the > callsite before it does anything with the return address. IIUC we could > use the same mechanism here (and avoid introducing a third). > > Are there plans to implement -fpatchable-function-entry on the clang > side? I'm not sure if there are plans at the moment, but if this feature is needed for PAC, adding it to clang shouldn't be a problem. Nick, did you have any thoughts on this? Sami 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=-0.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,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 844F7CA9EAE for ; Tue, 29 Oct 2019 17:45:50 +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 53EAC21479 for ; Tue, 29 Oct 2019 17:45:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="CnjEW95T"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="rPGbbUqA" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 53EAC21479 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-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=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9d0+sR6DeAl5bo0XgA5SnuSKd5Um1ALz+PpUumgeSYQ=; b=CnjEW95TerU0rr 2j9n0gNdfIGVb/hed6dHHaFU97VQSbCUl2D9uSOoL7sdcRDEy03Hh5CiqpBQsT1szbo05At612Psp 01QAB7KmUxcOG+tIBrdkr62xRsBvRLwgwe5TS1Gk/B4bFTdkEwjebQr5g2fNvVLrZxFQMvEmXog86 Dn8phMvPgBq4DGKhQvq2SOFATP63ocEM3dSnwJzbtgfHkBwyDSJxlrFfRLftM94WeK3GyV6ZRLd6t UMCQWoN9KUvRmG8hcxjOVa7HYqSsZH5nuFQAEvxxe67whiHswjn4ezCLKPBemiTYPelAi7gKwmSFK WeRYTzC6C0avBkdPotRA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iPVYy-0007Ee-ML; Tue, 29 Oct 2019 17:45:48 +0000 Received: from mail-vk1-xa44.google.com ([2607:f8b0:4864:20::a44]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iPVYo-00077Q-Hz for linux-arm-kernel@lists.infradead.org; Tue, 29 Oct 2019 17:45:40 +0000 Received: by mail-vk1-xa44.google.com with SMTP id r4so3071995vkf.9 for ; Tue, 29 Oct 2019 10:45:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=65YP9F0KitFD9legdxyLM59RAjKBzdRGrjI3L/m7ObE=; b=rPGbbUqAwVHq7Cm0rGfrw8aZKG5VrL44JQ4WF1AX8zOdwQI8rkKHDe3Opfeq0pYbYi ZvPBEVky5mJq0A1utYxoVfchIrzcrJxh4cYKqeEyKqh3F5ZpGjwR7FuS+45Wd+YvZTAR FCYHhGld6MAkj8PSSTu0jSSloZk6eBz34o6f90VAXFRXs/86osn7qCWlcHM8wNytg3QS uJNMarnDvny6K3ClI88qEsq5+XwNmoTiSipJzzK0eD0W9Nwi+d6vcizeA7IRNM1KW01T 8D5hlGzbW/5Mpci+BoZWh8xm7HIZT8sr5w3L36adlm6C6pBdnby12ApWTEuM8rl7eyke UlVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=65YP9F0KitFD9legdxyLM59RAjKBzdRGrjI3L/m7ObE=; b=QfD6XoPtaV4fB3UiOwuaO0ychqSLNMeBC/1WXW5nwhbfBwYEBaXOoA2YVP9wVs0i2A T7AnsVtEDVtFkl154BVVQzNfpoWj+Hxu04wNFoLHVyy14pW4OeKXaHakgqOsRVK4y/6z l0KuHyeg1LgG5AiLh5yErIIeSF4Mdx0Gpaj9CYFEwHpF6TPTGJ9RI3wIgD1K62eHAwnN TLABhkYBAd4f+80q3p3Y5wPOAfrE61C2Z9FInDHETX0lNwLtCa472mforQENNDlfdi2k AEF8NiCVwYrarksaAI9PFcSYlgaUCqZ1MCey5wKhhsx+lZK3LDt+TmWA0s7EumLRxONb MzCg== X-Gm-Message-State: APjAAAXHmK6ni0EIy7U9H4BWsVDgHMc84ZNleUxBNY9r2/1FscX9fN9o PQbk9wsSzrrRIBdRvvx4B4FjTB9ENkZSJ+9ypqK5ng== X-Google-Smtp-Source: APXvYqyofjlHaKbwoCfizqOngvFU3/FN2jdIJr9xQCjuFQ8iVqA3V1NcHewQYwziFUY5XcE5H3ggNp7mqR1GIqnLUe8= X-Received: by 2002:a1f:7d88:: with SMTP id y130mr12501967vkc.71.1572371133208; Tue, 29 Oct 2019 10:45:33 -0700 (PDT) MIME-Version: 1.0 References: <20191018161033.261971-1-samitolvanen@google.com> <20191024225132.13410-1-samitolvanen@google.com> <20191024225132.13410-10-samitolvanen@google.com> <20191025110313.GE40270@lakrids.cambridge.arm.com> In-Reply-To: <20191025110313.GE40270@lakrids.cambridge.arm.com> From: Sami Tolvanen Date: Tue, 29 Oct 2019 10:45:22 -0700 Message-ID: Subject: Re: [PATCH v2 09/17] arm64: disable function graph tracing with SCS To: Mark Rutland , Nick Desaulniers X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191029_104538_632247_3C8280ED X-CRM114-Status: GOOD ( 14.36 ) 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: Kees Cook , Ard Biesheuvel , Masahiro Yamada , Catalin Marinas , Jann Horn , LKML , Steven Rostedt , Miguel Ojeda , Masami Hiramatsu , clang-built-linux , Kernel Hardening , Laura Abbott , Will Deacon , Dave Martin , linux-arm-kernel Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Oct 25, 2019 at 4:03 AM Mark Rutland wrote: > I'm guessing it's difficult to always figure out the SCS slot for an > instrumented callsite unless we pass this explicitly from the ftrace > entry code, so we'd probably have to change some common infrastructure > for that. > > We have a similar issue with pointer authentication, and we're solving > that with -fpatchable-function-entry, which allows us to hook the > callsite before it does anything with the return address. IIUC we could > use the same mechanism here (and avoid introducing a third). > > Are there plans to implement -fpatchable-function-entry on the clang > side? I'm not sure if there are plans at the moment, but if this feature is needed for PAC, adding it to clang shouldn't be a problem. Nick, did you have any thoughts on this? Sami _______________________________________________ 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=-8.4 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 265BECA9EAE for ; Tue, 29 Oct 2019 17:45:53 +0000 (UTC) Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.kernel.org (Postfix) with SMTP id 737F020856 for ; Tue, 29 Oct 2019 17:45:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="rPGbbUqA" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 737F020856 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernel-hardening-return-17149-kernel-hardening=archiver.kernel.org@lists.openwall.com Received: (qmail 14177 invoked by uid 550); 29 Oct 2019 17:45:46 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Received: (qmail 14159 invoked from network); 29 Oct 2019 17:45:45 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=65YP9F0KitFD9legdxyLM59RAjKBzdRGrjI3L/m7ObE=; b=rPGbbUqAwVHq7Cm0rGfrw8aZKG5VrL44JQ4WF1AX8zOdwQI8rkKHDe3Opfeq0pYbYi ZvPBEVky5mJq0A1utYxoVfchIrzcrJxh4cYKqeEyKqh3F5ZpGjwR7FuS+45Wd+YvZTAR FCYHhGld6MAkj8PSSTu0jSSloZk6eBz34o6f90VAXFRXs/86osn7qCWlcHM8wNytg3QS uJNMarnDvny6K3ClI88qEsq5+XwNmoTiSipJzzK0eD0W9Nwi+d6vcizeA7IRNM1KW01T 8D5hlGzbW/5Mpci+BoZWh8xm7HIZT8sr5w3L36adlm6C6pBdnby12ApWTEuM8rl7eyke UlVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=65YP9F0KitFD9legdxyLM59RAjKBzdRGrjI3L/m7ObE=; b=dcp1k0U0kqS9l5/rp2KWh94EEmwNJPdwDNdplsUn8ecY6a+sUO81oSpPCW3qqZBXUJ JmYGXEOj94hgSNzcU8XVYBwQeU+OMp7/bB3+5NLFJ7ynOl6M+DkBwdSjh6VZoeZ05Rpf M0Lurv2dc8Z3D/PkoziZapGaPlzFN6rgTbPOPpv1lxwobEKofDHbbrI1PXebJmxhE/gv Oznm/DVQJaJbu4GEvjxDqhJld9ddPfUaw37c2tMpkDfnAknGIUjNQScwzNrMG38MOzpT VtNtIHeUEFpvsafbugiGSMoGGNYwobCm+w6iX9coR5a/+CvoN26SbmLzJQDC13HFLWV1 2lnw== X-Gm-Message-State: APjAAAVDI6iSB4IX2Jv+vKQs3EhaaQP5l+dVK30gTTtLhY9zgV6xbggY IhTqBywrmFX72MCSRlIeGUPbEWU3jKCbeZgZcwdnMQ== X-Google-Smtp-Source: APXvYqyofjlHaKbwoCfizqOngvFU3/FN2jdIJr9xQCjuFQ8iVqA3V1NcHewQYwziFUY5XcE5H3ggNp7mqR1GIqnLUe8= X-Received: by 2002:a1f:7d88:: with SMTP id y130mr12501967vkc.71.1572371133208; Tue, 29 Oct 2019 10:45:33 -0700 (PDT) MIME-Version: 1.0 References: <20191018161033.261971-1-samitolvanen@google.com> <20191024225132.13410-1-samitolvanen@google.com> <20191024225132.13410-10-samitolvanen@google.com> <20191025110313.GE40270@lakrids.cambridge.arm.com> In-Reply-To: <20191025110313.GE40270@lakrids.cambridge.arm.com> From: Sami Tolvanen Date: Tue, 29 Oct 2019 10:45:22 -0700 Message-ID: Subject: Re: [PATCH v2 09/17] arm64: disable function graph tracing with SCS To: Mark Rutland , Nick Desaulniers Cc: Will Deacon , Catalin Marinas , Steven Rostedt , Masami Hiramatsu , Ard Biesheuvel , Dave Martin , Kees Cook , Laura Abbott , Jann Horn , Miguel Ojeda , Masahiro Yamada , clang-built-linux , Kernel Hardening , linux-arm-kernel , LKML Content-Type: text/plain; charset="UTF-8" On Fri, Oct 25, 2019 at 4:03 AM Mark Rutland wrote: > I'm guessing it's difficult to always figure out the SCS slot for an > instrumented callsite unless we pass this explicitly from the ftrace > entry code, so we'd probably have to change some common infrastructure > for that. > > We have a similar issue with pointer authentication, and we're solving > that with -fpatchable-function-entry, which allows us to hook the > callsite before it does anything with the return address. IIUC we could > use the same mechanism here (and avoid introducing a third). > > Are there plans to implement -fpatchable-function-entry on the clang > side? I'm not sure if there are plans at the moment, but if this feature is needed for PAC, adding it to clang shouldn't be a problem. Nick, did you have any thoughts on this? Sami