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=-10.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 E676CC433DF for ; Mon, 29 Jun 2020 06:21:18 +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 B5EE323131 for ; Mon, 29 Jun 2020 06:21:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="W3jamqoc"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="gkyZjcRb" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B5EE323131 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org 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:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=bFVNk6zJfiaPNW7LgICOcF0XsWUnyCsS/Gg04bEvivI=; b=W3jamqocb5WE3CAyTw7nxSLDJ F36tdHIcebgj29FVrdzHVxSZPtOSv+oD+zjH72tG6DhhvP0wpQtbh01dQXZ0l9c7sTXTU4zN8tk+k lSKny2l1rD+3FiYlupDCxYIycWSMl/knI34l977BnJDswiZSiqLNe6N4kGK7Hq1tG534uRGVn6xRV J5EI1K6f9bFbTxX1gNrIVKgJsRSPjhpXkP9ACVseNksy4dNvodzB3ML1KyCX6LNh+nUzdvrfB9f5F rx1ritCwSvZwNH4Z14avbNtd66+eU1OnUd841hiV2Sb5hKOueLe1656ZJ1+FCPAu1ylDqZ0NSjNRf ZOe3EKUiQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jpn8Q-0005yJ-Sg; Mon, 29 Jun 2020 06:19:18 +0000 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jpn7z-0005pt-0m for linux-arm-kernel@lists.infradead.org; Mon, 29 Jun 2020 06:18:56 +0000 Received: by mail-pg1-x544.google.com with SMTP id d4so7826172pgk.4 for ; Sun, 28 Jun 2020 23:18:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6elEkxiTC64v4srgfUTdZozPZdv37lYm4BTjSvBzmZk=; b=gkyZjcRb94k71tMgV+9TZXhAbV0rJLLGSga2JTiQ29d2jw/h/CmWsxzOrVYJYO18pb Rgwb6hMV5w9pjKWTXXBfcS3XfIYbnAKMBcHYDl5Yg6lCPR5OD9BbzveaWsROz9zqj2rC FsLqZQZBh83rrB7TDNLbJAZPzlxe+TFWfVRNo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6elEkxiTC64v4srgfUTdZozPZdv37lYm4BTjSvBzmZk=; b=OW0KgmUoEkWsGOhQpjW1iU8NNgeqZBZe3Q0P6CT+dCO20nzVfBhIpC7H7yEbfHlFSJ OaMUyiChBWGLAwr97VCduWJ5DsnDdZ+a9APzIDdGYWhnAj7wvCDLjHGGcLFzhtu7Gtc+ fiehDK/mSX1rCi9IvNj6dROEsx2nu40dtv/QQ16a2Zqhp06TgVhIdLz0quSLQ41WsvNO BxY/qRfLyniJkQWdGEN6csM+cK/SMJT0+ae0b9FJPxvjQIDBjiGYShzzURGN25UIGKpA 1yHp4pNDCg6V9NzBWbEWLP+sC1+YcWpbkEl8JK1LIAcaZ5BuQdo9JBcBqB8fNDQQQv9z 3Lfw== X-Gm-Message-State: AOAM531dJ3qHfC5azaJ2bV77j+r34MqTjz9BLCuwMc0yNlQ/Asc3DDSh DONmR5F8nbHGacRNDpE3P79fMA== X-Google-Smtp-Source: ABdhPJxJXKXKGxIgf9KhhNRZoNxE/RymgaC1Wp90l3FioPTL2ggfsfaH6bGQODamxEof1p/UWIkdKA== X-Received: by 2002:a62:f24b:: with SMTP id y11mr12809730pfl.85.1593411528989; Sun, 28 Jun 2020 23:18:48 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id f18sm15312315pgv.84.2020.06.28.23.18.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Jun 2020 23:18:47 -0700 (PDT) From: Kees Cook To: Will Deacon Subject: [PATCH v4 05/17] ctype: Work around Clang -mbranch-protection=none bug Date: Sun, 28 Jun 2020 23:18:28 -0700 Message-Id: <20200629061840.4065483-6-keescook@chromium.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200629061840.4065483-1-keescook@chromium.org> References: <20200629061840.4065483-1-keescook@chromium.org> MIME-Version: 1.0 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@vger.kernel.org, Thomas Gleixner , Catalin Marinas , Arvind Sankar , Ard Biesheuvel , linux-arch@vger.kernel.org, Masahiro Yamada , x86@kernel.org, Russell King , clang-built-linux@googlegroups.com, Ingo Molnar , Borislav Petkov , Dave Martin , Kees Cook , Arnd Bergmann , Nathan Chancellor , Peter Collingbourne , linux-arm-kernel@lists.infradead.org, Nick Desaulniers , linux-kernel@vger.kernel.org, James Morse 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 In preparation for building efi/libstub with -mbranch-protection=none (EFI does not support branch protection features[1]), add no-op code to work around a Clang bug that emits an unwanted .note.gnu.property section for object files without code[2]. [1] https://lore.kernel.org/lkml/CAMj1kXHck12juGi=E=P4hWP_8vQhQ+-x3vBMc3TGeRWdQ-XkxQ@mail.gmail.com [2] https://bugs.llvm.org/show_bug.cgi?id=46480 Cc: Ard Biesheuvel Cc: Will Deacon Cc: Dave Martin Cc: clang-built-linux@googlegroups.com Signed-off-by: Kees Cook --- lib/ctype.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/ctype.c b/lib/ctype.c index c819fe269eb2..21245ed57d90 100644 --- a/lib/ctype.c +++ b/lib/ctype.c @@ -36,3 +36,13 @@ _L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L, /* 224-239 */ _L,_L,_L,_L,_L,_L,_L,_P,_L,_L,_L,_L,_L,_L,_L,_L}; /* 240-255 */ EXPORT_SYMBOL(_ctype); + +/* + * Clang will generate .note.gnu.property sections for object files + * without code, even in the presence of -mbranch-protection=none. + * To work around this, define an unused static function. + * https://bugs.llvm.org/show_bug.cgi?id=46480 + */ +#ifdef CONFIG_CC_IS_CLANG +void __maybe_unused __clang_needs_code_here(void) { } +#endif -- 2.25.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel