Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1739456pxb; Fri, 29 Jan 2021 04:10:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJwgvQKDp8JICci7Aj8DO8uG+C/K6UkJRNK2eO3Z/kWu4QJGrC+yvwA8lLToZimOeICgGQ2i X-Received: by 2002:aa7:cc18:: with SMTP id q24mr4684799edt.82.1611922200462; Fri, 29 Jan 2021 04:10:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611922200; cv=none; d=google.com; s=arc-20160816; b=sKq+u+YPIpZ1tu98UXUsjkO4bsTRCsB3Q4j9E7fvgJCIPA7KIEcQBa0S0gLtWqjC9S a5DGlMKDXZXqeeQefPw1DchOsUn3c3/wWBZovDgmjTPH9Vymqp36cbIpVd22GYk5Np8/ lHh8VQ7HpWClBJrToX14/PjQwehE1LXlSzo7Vtr4EkRR0zp8Q4ZkMWM3nZYCwfSPpg6f lfmkwFn1j6GSMpCjBiHgBh4jh9hBKuNd3Xqp8KfL3rfwY9gnINICgArODaZH/9nB/2P4 xbDk0XwH8vEN83syAf0XX1XhQHPZ0md9IjL4/Xgb+9Db56wOC8UVDcrZslXFQJxz7tXn ImIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=TVLhEv6qFkJVfRGbRCeWnctSeyH/2aF863ezHXsArvw=; b=o4cKa3xHDNCAEQWLAOYkxq+bwj939y2PIbo9p1/+VvEjpcvKAk7IhZRS1QKjekuqx4 EPfheldMKQgMGDq9lD869jtHOBGKCnwXuk4Odllm4UTPgwQ+cLRWui096G24gtWaMURJ Zw0KpAbIAEPPFwb0IhkBja9zFBPFsS4touIv1z1ZUWWZZMvzd1Swn3NmnuqOP4z4MYTK hKILUnTf8p8XjpeADVqmXbG7Zcny+C7Tnd9gn74lmnxNhFZE7FPP1FFcV7O4LCu3PWZX zbWAxHEmeHqvKGnSyk3sbRNRafmIowdCPxMr8oiU6Zt2OFomiBdPSNeJmozBRHBa2Zn5 iLjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=erNdzR8S; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a12si4946128edr.294.2021.01.29.04.09.35; Fri, 29 Jan 2021 04:10:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=erNdzR8S; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232675AbhA2MGu (ORCPT + 99 others); Fri, 29 Jan 2021 07:06:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232326AbhA2MCR (ORCPT ); Fri, 29 Jan 2021 07:02:17 -0500 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E240C08ECA4; Fri, 29 Jan 2021 02:21:15 -0800 (PST) Received: from zn.tnic (p200300ec2f0c9a00c2508fce5f12579a.dip0.t-ipconnect.de [IPv6:2003:ec:2f0c:9a00:c250:8fce:5f12:579a]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id A974D1EC026D; Fri, 29 Jan 2021 11:21:10 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1611915670; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=TVLhEv6qFkJVfRGbRCeWnctSeyH/2aF863ezHXsArvw=; b=erNdzR8S0vCkAaDIcWEZuGKQk4j4hHdj0CaAHILELw+fn/JXJlOTzwZ30WCZs/K2z9dGjS 24canQOHf8ZnUrv898FXTNxUFjY5Gj1mDjXUdu12OhUgtuR2tSl/HFc4D17HJs1JhQv6Hp yBHs112GHBP977M3ycTPGXi5MsyTmKE= Date: Fri, 29 Jan 2021 11:21:05 +0100 From: Borislav Petkov To: Josh Poimboeuf Cc: x86@kernel.org, Masami Hiramatsu , Masami Hiramatsu , Peter Zijlstra , LKML , Alexei Starovoitov , bpf@vger.kernel.org, Steven Rostedt , Nikolay Borisov Subject: Re: [PATCH] x86: Disable CET instrumentation in the kernel Message-ID: <20210129102105.GA27841@zn.tnic> References: <25cd2608-03c2-94b8-7760-9de9935fde64@suse.com> <20210128001353.66e7171b395473ef992d6991@kernel.org> <20210128002452.a79714c236b69ab9acfa986c@kernel.org> <20210128103415.d90be51ec607bb6123b2843c@kernel.org> <20210128123842.c9e33949e62f504b84bfadf5@gmail.com> <20210128165014.xc77qtun6fl2qfun@treble> <20210128215219.6kct3h2eiustncws@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210128215219.6kct3h2eiustncws@treble> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 28, 2021 at 03:52:19PM -0600, Josh Poimboeuf wrote: > > With retpolines disabled, some configurations of GCC will add Intel CET > instrumentation to the kernel by default. That breaks certain tracing > scenarios by adding a superfluous ENDBR64 instruction before the fentry > call, for functions which can be called indirectly. > > CET instrumentation isn't currently necessary in the kernel, as CET is > only supported in user space. Disable it unconditionally. > > Reported-by: Nikolay Borisov > Signed-off-by: Josh Poimboeuf > --- > Makefile | 6 ------ > arch/x86/Makefile | 3 +++ > 2 files changed, 3 insertions(+), 6 deletions(-) > > diff --git a/Makefile b/Makefile > index e0af7a4a5598..51c2bf34142d 100644 > --- a/Makefile > +++ b/Makefile > @@ -948,12 +948,6 @@ KBUILD_CFLAGS += $(call cc-option,-Werror=designated-init) > # change __FILE__ to the relative path from the srctree > KBUILD_CPPFLAGS += $(call cc-option,-fmacro-prefix-map=$(srctree)/=) > > -# ensure -fcf-protection is disabled when using retpoline as it is > -# incompatible with -mindirect-branch=thunk-extern > -ifdef CONFIG_RETPOLINE > -KBUILD_CFLAGS += $(call cc-option,-fcf-protection=none) > -endif > - Why is that even here, in the main Makefile if this cf-protection thing is x86-specific? Are we going to move it back there when some other arch gets CET or CET-like support? -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette