lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 14 Jun 2021 12:17:21 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     x86@...nel.org, oberpar@...ux.ibm.com, linux-kernel@...r.kernel.org
Cc:     johannes.berg@...el.com, ndesaulniers@...gle.com,
        nathan@...nel.org, keescook@...omium.org, elver@...gle.com,
        mark.rutland@....com
Subject: [PATCH] gcov,x86: Mark GCOV broken for x86


As recently discovered, there is no function attribute to disable the
-fprofile-generate instrumentation. As such, GCOV is fundamentally
incompatible with architectures that rely on 'noinstr' for correctness.

Until such time as that compilers have added a function attribute to
disable this instrumentation, mark GCOV as broken.

Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
---
 arch/x86/Kconfig    | 2 +-
 kernel/gcov/Kconfig | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 86dae426798b..c0f8c9d4c31a 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -75,7 +75,7 @@ config X86
 	select ARCH_HAS_FAST_MULTIPLIER
 	select ARCH_HAS_FILTER_PGPROT
 	select ARCH_HAS_FORTIFY_SOURCE
-	select ARCH_HAS_GCOV_PROFILE_ALL
+	select ARCH_HAS_GCOV_BROKEN
 	select ARCH_HAS_KCOV			if X86_64 && STACK_VALIDATION
 	select ARCH_HAS_MEM_ENCRYPT
 	select ARCH_HAS_MEMBARRIER_SYNC_CORE
diff --git a/kernel/gcov/Kconfig b/kernel/gcov/Kconfig
index 58f87a3092f3..74b028a66ebe 100644
--- a/kernel/gcov/Kconfig
+++ b/kernel/gcov/Kconfig
@@ -1,10 +1,14 @@
 # SPDX-License-Identifier: GPL-2.0-only
 menu "GCOV-based kernel profiling"
 
+config ARCH_HAS_GCOV_BROKEN
+	def_bool n
+
 config GCOV_KERNEL
 	bool "Enable gcov-based kernel profiling"
 	depends on DEBUG_FS
 	depends on !CC_IS_CLANG || CLANG_VERSION >= 110000
+	depends on !ARCH_HAS_GCOV_BROKEN
 	select CONSTRUCTORS
 	default n
 	help

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ