Received: by 2002:a17:90a:1609:0:0:0:0 with SMTP id n9csp2030403pja; Thu, 26 Mar 2020 08:35:27 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsijYRbwF6e/qmF4cVOa8rdGUW4UMaiPyqFl1AIPl7pdz5+2sDOyr032PPfXWdQBO5laMR1 X-Received: by 2002:a9d:7a9:: with SMTP id 38mr6543812oto.60.1585236926818; Thu, 26 Mar 2020 08:35:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585236926; cv=none; d=google.com; s=arc-20160816; b=h0OzhCcJLIyDW5SLYvAZX0YSAZauJYYKbaBaIPJVoJoB+8qoVvxZU4MNikH1XxzrwG +FxEA4zbaWCFPdUTXCTHYHLwHYX2Uh4xxE3PYy3RyqOYqi0j3MFI857M/ZOFs1tDpAd3 2SsrKnJJXAsBiJ+IYA5JYFmGHd8YFlot4Ynov/+BM9h3XArIL5+J+CTaqpI58E+kjAHD LNbsVrAQO1wTND5nFKKSXO8tjVoh8/V3wHQVZzj9KaeEcE4YrjnwrdGfK+5FK1Yl2sEG 9vv5qoiJFQihkqa3h9w8bwDMLr4NS6P+MzSxaxEIjINpzF7UYhhAZz2/aq53tufbo/0a 5UGQ== 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=IR7tecNFaMJPfiG8wXGyTTjo/ydC8JLZWl8CN6FCyaY=; b=gOYSjiwlDRGes1Z6kcHbQMkSP9Xmt6MdeZ+0tXCZsPp8/mq/JJ4kH3OTyFlHgJ1i3I Yvm8ES7de3VV9iNykj0QK9etR/w4KpCKogu0OqC+TLWmoYy1scDazt8DqzLtuwmnJdog rDpUtH+kgF/PmIRAoyTOKKOMTllLg8nfkzYwDExln34G8U+alygRLqqTS69xaCiqUKWI zpiWpOxeyMLn1of1DLEb2qnauqCCF9E+07BLXDhAU2mQCkfOXtscJMhiUfOsu476v3Sb atKcqy2Ys1HJtuOaedisakap4NXgRw14OioKge9VYEBlCITcBmYETMduPovxitxaQT0r eEcw== 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 z10si1175784otq.214.2020.03.26.08.35.08; Thu, 26 Mar 2020 08:35:26 -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 S1728428AbgCZPcS (ORCPT + 99 others); Thu, 26 Mar 2020 11:32:18 -0400 Received: from foss.arm.com ([217.140.110.172]:34082 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728357AbgCZPcQ (ORCPT ); Thu, 26 Mar 2020 11:32:16 -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 946791045; Thu, 26 Mar 2020 08:32:16 -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 B95853F71E; Thu, 26 Mar 2020 08:32:14 -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 2/2] arm64: Kconfig: ptrauth: Add binutils version check to fix mismatch Date: Thu, 26 Mar 2020 21:02:00 +0530 Message-Id: <1585236720-21819-2-git-send-email-amit.kachhap@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1585236720-21819-1-git-send-email-amit.kachhap@arm.com> References: <1585236720-21819-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 --- arch/arm64/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index e6712b6..73135da 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -1503,7 +1503,7 @@ 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) + depends on (CC_IS_GCC && (GCC_VERSION < 90100 || LD_VERSION >= 233010000)) || (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