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.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=unavailable 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 518FACA9EA0 for ; Fri, 18 Oct 2019 21:23:44 +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 2108420679 for ; Fri, 18 Oct 2019 21:23:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="oiimMtWo"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="kmFuT5Kg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2108420679 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=ztZYQ+4HW8NO8e/mwE0tg98P4Ws5RC50IkK14qOdz7s=; b=oiimMtWotTluan Cl2a0I+maB15mbBOUPBcRw+szERWuPAdPB/kNsOWmunTG/COWidwlV5+j68a0oDeYVaatmIWTw7XY xHOE6K/aGKJKXWaAiX9ad8PoDoq1ahgPpygVSA8Djb7BLxVIy6NhINdJSlQh/vmMbePcWsX3x/TzE ks1NhaVsaMvo4CvN/G4ZyV1Y37iZIYdtjejStWJfEAovo8Xtm+zTizJGXav2OqwFsno9qc4rkmjrM 8EjXiN9wOTrqIP3E5FA3j2HRqu6uCU/Touab0s0rsek9i1bmM1HZP62Pz5nLJGZ/CxFLv7znmsmG8 yqCpjGhQcrW+ShXZZBjg==; 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 1iLZiZ-0003op-6p; Fri, 18 Oct 2019 21:23:27 +0000 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iLZiW-0003nv-9n for linux-arm-kernel@lists.infradead.org; Fri, 18 Oct 2019 21:23:25 +0000 Received: by mail-pg1-x541.google.com with SMTP id i32so4014465pgl.10 for ; Fri, 18 Oct 2019 14:23:23 -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=vIoI90AJcGtmRzHkaXHGdwrJxP2gbeW0bBXLDxZIi6o=; b=kmFuT5Kg6bHVBqvSrwwjd80o3NyLk9kXgyAEqkBiecWeSw5sIbx2razxWIcHpKmuCx bJO2L0Jt09AzB11Ioy48fJTW8FR+EMVEr0M9zHJAcwWGJOQg3HRcf2WrQ1l4SzEXAZq4 n6Xg7mC6TZcE9jyt02zaa38SwNptcs9lLZ8G/gPn1z84v6FiEYb28HVQX/UzL1C7GhyF PAoEIeSihIs40ESqTd4Oi5iDvDNXP4+cR6jf/BkW9ReFPCWFW0DLQ4SlZLRQeGvSHN7n CoZ3rxSv+LnWUEqcGvtveotIJsaouPfkBE7vIksnyOAEvvP1q7/C1giHe26s6vQXFvJX liOA== 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=vIoI90AJcGtmRzHkaXHGdwrJxP2gbeW0bBXLDxZIi6o=; b=t3l5v5sHYzNRR6BWHWhXA0D69RnjRQN+Xbn8kmt7rO2ilDLP6iWf/51ZrmNCNK/IKm 37chDnt+odW4IrwhhmRKLUYH5KAF2Y6OGXcZrE3/3hGnfX9t3s/jPsI06qCMaax/Y7lY kfG/89AmKAhQQS4GofIp0iYyT5jbu8/gQe53mp7hc0yUeaw4lkM5YUVIeMRbCCvzTvF7 Q4ZBBWUlvO1vlgUAlMYhu9BHXcvNZMduxTFRgTPW2IDgKNCyvwbzSZ1KHfjrKGiwL3bE +gLx4rWbXQINMhOwSQ8Qpf6Y1Cc/OoYqyeWByOUX8ScCjZj2mY5gnKb+0dGKOWb+s3kz rL5g== X-Gm-Message-State: APjAAAVeZ1ECdw94z37gyPxJSP6gPlainDcfhVHKl+kgITzxYhP3qFnx 8RAoZcxPY2RV/5AeclCy3vW5vgDKmOZ0m/3Zw6q6VA== X-Google-Smtp-Source: APXvYqyiiPLOZOS1kQpsZ9qqN50RFADJX438WB0rEo22PxmnqtNJSl9IB/wB6WS07gKTHpmXSLKmBJieIge5XbhC8jY= X-Received: by 2002:aa7:8210:: with SMTP id k16mr9015314pfi.84.1571433802129; Fri, 18 Oct 2019 14:23:22 -0700 (PDT) MIME-Version: 1.0 References: <20191018161033.261971-1-samitolvanen@google.com> <20191018161033.261971-13-samitolvanen@google.com> In-Reply-To: <20191018161033.261971-13-samitolvanen@google.com> From: Nick Desaulniers Date: Fri, 18 Oct 2019 14:23:10 -0700 Message-ID: Subject: Re: [PATCH 12/18] arm64: reserve x18 only with Shadow Call Stack To: Sami Tolvanen X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191018_142324_364932_9A62D517 X-CRM114-Status: GOOD ( 19.05 ) 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 , Kees Cook , Ard Biesheuvel , Catalin Marinas , Kernel Hardening , LKML , Steven Rostedt , clang-built-linux , Laura Abbott , Will Deacon , Dave Martin , Linux ARM 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 18, 2019 at 9:11 AM 'Sami Tolvanen' via Clang Built Linux wrote: > > Only reserve x18 with CONFIG_SHADOW_CALL_STACK. Note that all external > kernel modules must also have x18 reserved if the kernel uses SCS. Ah, ok. The tradeoff for maintainers to consider, either: 1. one less GPR for ALL kernel code or 2. remember not to use x18 in inline as lest you potentially break SCS This patch is 2 (the earlier patch was 1). Maybe we don't write enough inline asm that this will be hard to remember, and we do have CI in Android to watch for this (on mainline, not sure about -next). Either way, Acked-by: Nick Desaulniers > > Signed-off-by: Sami Tolvanen > --- > arch/arm64/Makefile | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile > index 1c7b276bc7c5..ef76101201b2 100644 > --- a/arch/arm64/Makefile > +++ b/arch/arm64/Makefile > @@ -55,7 +55,7 @@ endif > > KBUILD_CFLAGS += -mgeneral-regs-only $(lseinstr) $(brokengasinst) \ > $(compat_vdso) $(cc_has_k_constraint) > -KBUILD_CFLAGS += -fno-asynchronous-unwind-tables -ffixed-x18 > +KBUILD_CFLAGS += -fno-asynchronous-unwind-tables > KBUILD_CFLAGS += $(call cc-disable-warning, psabi) > KBUILD_AFLAGS += $(lseinstr) $(brokengasinst) $(compat_vdso) > > @@ -72,6 +72,10 @@ stack_protector_prepare: prepare0 > include/generated/asm-offsets.h)) > endif > > +ifeq ($(CONFIG_SHADOW_CALL_STACK), y) > +KBUILD_CFLAGS += -ffixed-x18 > +endif > + > ifeq ($(CONFIG_CPU_BIG_ENDIAN), y) > KBUILD_CPPFLAGS += -mbig-endian > CHECKFLAGS += -D__AARCH64EB__ > -- > 2.23.0.866.gb869b98d4c-goog > > -- > You received this message because you are subscribed to the Google Groups "Clang Built Linux" group. > To unsubscribe from this group and stop receiving emails from it, send an email to clang-built-linux+unsubscribe@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/20191018161033.261971-13-samitolvanen%40google.com. -- Thanks, ~Nick Desaulniers _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel