Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2354169ybb; Mon, 30 Mar 2020 04:43:53 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtdElqy6Z1NxfJPWW3l3WJCdsUoDuLtou9JynrlIG20QwSORVE5bYqkflKmyfnt2JSOicY0 X-Received: by 2002:aca:ddc4:: with SMTP id u187mr7392129oig.129.1585568633729; Mon, 30 Mar 2020 04:43:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585568633; cv=none; d=google.com; s=arc-20160816; b=DHrizBFRaFeCkhZuwEM2JEaH1U6mDBh0aKXsfIAZ4jour5C4hfQ/bOZURnLCTTIN46 +bMNFqJAJiG2uMG3APgwkUTODpA42Jb55M3mzqtHVIbosiWj2rxCvLvLn24p+uh8IsQP 6s3cqFaJh+UfT6ULcF4KOiK/hPyt9em98Wp9UxddwjwU/yUdrSJMqER4cEGde4FFQMN4 axn6PNOyNOepFY8CWhlNMOkrDxS9gjWDJHABEAicNlZ7XamyJN1K7xmDojb1wfGYeso4 Ww7DpNvNnHPS3XkfffBoWZEf+VewnBSGlRCLvo7QG6nJC+sRsyc/p2eY4wfUtpxrFDQK AwYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=YjHZ27oNrlMQ3eOoreIWyJIuesUsANOnQ96bQoR4RA8=; b=bWUm7Mw5AA9Ch9K/0ZYJtJ0maihi56XUFiXvr1hpU1UwNzfc04CXlchVyOKPgl88Ef p2YfNRkH7/p/ZnVa2axdH97AubwIbyUkfpFxtiiM03ToBiNehfOzopKk77BhIN4ui4Xx 8Ia4sK9WUNlY8QCN5YLAFPEpbfIMltJ8AJUhgpCzx0EZ4UQXJ6sD4C9aYT9r4VdOFvbh u0Exnr8wnBf8xFKra8JaLPjrtF5Qtr6LILJzXcKLCL+qzoTYGEa66UsJtXI8kKHePzC9 Mq68pX97gPmGSy19dMAaKK91B+Z2iQ/puvErxmAUQV2CKVWJx83MtmkGUQb22ZlGGm8z HIow== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m22si5262505otn.81.2020.03.30.04.43.41; Mon, 30 Mar 2020 04:43:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729837AbgC3LmD (ORCPT + 99 others); Mon, 30 Mar 2020 07:42:03 -0400 Received: from foss.arm.com ([217.140.110.172]:51342 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728764AbgC3LmC (ORCPT ); Mon, 30 Mar 2020 07:42:02 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9CA73101E; Mon, 30 Mar 2020 04:42:02 -0700 (PDT) Received: from a075553-lin.blr.arm.com (a075553-lin.blr.arm.com [10.162.17.24]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id B84253F52E; Mon, 30 Mar 2020 04:42:00 -0700 (PDT) From: Amit Daniel Kachhap To: linux-arm-kernel@lists.infradead.org Cc: Catalin Marinas , Will Deacon , Vincenzo Frascino , linux-kernel@vger.kernel.org, Amit Daniel Kachhap Subject: [PATCH v2 2/2] arm64: Kconfig: ptrauth: Add binutils version check to fix mismatch Date: Mon, 30 Mar 2020 17:11:39 +0530 Message-Id: <1585568499-21585-2-git-send-email-amit.kachhap@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1585568499-21585-1-git-send-email-amit.kachhap@arm.com> References: <1585568499-21585-1-git-send-email-amit.kachhap@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Recent addition of ARM64_PTR_AUTH exposed a mismatch issue with binutils. 9.1+ versions of gcc inserts a section note .note.gnu.property but this can be used properly by binutils version greater than 2.33.1. If older binutils are used then the following warnings are generated, aarch64-linux-ld: warning: arch/arm64/kernel/vdso/vgettimeofday.o: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0000000 aarch64-linux-objdump: warning: arch/arm64/lib/csum.o: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0000000 aarch64-linux-nm: warning: .tmp_vmlinux1: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0000000 This patch enables ARM64_PTR_AUTH when gcc and binutils versions are compatible with each other. Older gcc which do not insert such section continue to work as before. This scenario may not occur with clang as a recent commit 3b446c7d27ddd06 ("arm64: Kconfig: verify binutils support for ARM64_PTR_AUTH") masks binutils version lesser then 2.34. Reported-by: kbuild test robot Suggested-by: Vincenzo Frascino Signed-off-by: Amit Daniel Kachhap --- Changes since v1[1]: * Separated GCC and CLANG checks as suggested by Catalin. * Added comments in Kconfig entry. [1]: https://lkml.org/lkml/2020/3/26/626 arch/arm64/Kconfig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index e6712b6..4391a4f 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -1503,7 +1503,10 @@ config ARM64_PTR_AUTH default y depends on !KVM || ARM64_VHE depends on (CC_HAS_SIGN_RETURN_ADDRESS || CC_HAS_BRANCH_PROT_PAC_RET) && AS_HAS_PAC - depends on CC_IS_GCC || (CC_IS_CLANG && AS_HAS_CFI_NEGATE_RA_STATE) + # GCC 9.1 version inserts a section note .note.gnu.property for PAC + # which can be used properly by binutils version 2.33.1 and higher. + depends on !CC_IS_GCC || GCC_VERSION < 90100 || LD_VERSION >= 233010000 + depends on !CC_IS_CLANG || AS_HAS_CFI_NEGATE_RA_STATE depends on (!FUNCTION_GRAPH_TRACER || DYNAMIC_FTRACE_WITH_REGS) help Pointer authentication (part of the ARMv8.3 Extensions) provides -- 2.7.4