Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp497352ybl; Wed, 14 Aug 2019 01:10:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqyU7F3WKSsx2xLnYikTkuWR3DXjivyGAwEBT4MUUFOghbF6LsU9L1hY/qRqn7vCATr09Gar X-Received: by 2002:a63:1d2:: with SMTP id 201mr38928051pgb.307.1565770205839; Wed, 14 Aug 2019 01:10:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565770205; cv=none; d=google.com; s=arc-20160816; b=ByQ4d0XzjyzgOFFrSPSiFUm98HF2/fKFAgtSxRgRj1K3DhxSHbA9uYlHrYMOhydJqy OuL/1hFVy+Abz0QdwLRejXZTjqtRtm6d/n8o8VIuPNwTvJ/H3LDiGa9m9eht91bDZYwP VHlYdtXnw9QiJ/LDYGV2gEAueVpEym8NX7qAp71XZAKPOTHEklY68uBRZX1coHk6Qabm +juGkjSO5Aus0d1FEMMlOVG8Ia22KGSeUhhm6wECPwD1yKnptlCjUFxcHlT4XmDH7JgG Dqmf7d0D0+RGLiZQZIbBnxk7NLKQRvXWOPgRISU4P51EtprKYkLLmUu88/35xbnKToHF vTYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from; bh=s2oNK14N64m/7MIDDm75/djmsP17t6jlLu0UK545KOA=; b=gB+pFJ+/q/ZV5PmCLoEjYWHpi+yBdzkvCnCmAsARB3l3nEcfdPhaqEcBV2z+7REHP1 /w6D0M34c7MBErEc/QZ75LI6isDbc6k8vA/lgaoK8mz7Z5+KqzidjpwCe4r3PauItTdN QW6H0mdO1nCwCTXmFZ55UvGjzMJfO3RRj0lL4AiSa9mMNxijzzAUycdLJOhrvN3NR9zg +YYSTaV0QHu4ZhgHdO+gniOVt1L2oyGjk29j8NjMM0zI0oJsznBwYS+I2ox7ziqI7q3X p2QKFYdNmQVKUJcXFeegJ6p3JxdMG9nisrlree5Pu0uoNWJSEOBfuka5EAQEYexB9vyj Qx6g== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f23si66086176pga.449.2019.08.14.01.09.49; Wed, 14 Aug 2019 01:10:05 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727099AbfHNIH6 (ORCPT + 99 others); Wed, 14 Aug 2019 04:07:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45794 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726347AbfHNIH6 (ORCPT ); Wed, 14 Aug 2019 04:07:58 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 53C9C31499; Wed, 14 Aug 2019 08:07:57 +0000 (UTC) Received: from oldenburg2.str.redhat.com (dhcp-192-200.str.redhat.com [10.33.192.200]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4F4B4413C; Wed, 14 Aug 2019 08:07:47 +0000 (UTC) From: Florian Weimer To: Yu-cheng Yu Cc: x86@kernel.org, "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-api@vger.kernel.org, Arnd Bergmann , Andy Lutomirski , Balbir Singh , Borislav Petkov , Cyrill Gorcunov , Dave Hansen , Eugene Syromiatnikov , "H.J. Lu" , Jann Horn , Jonathan Corbet , Kees Cook , Mike Kravetz , Nadav Amit , Oleg Nesterov , Pavel Machek , Peter Zijlstra , Randy Dunlap , "Ravi V. Shankar" , Vedvyas Shanbhogue , Dave Martin Subject: Re: [PATCH v8 01/27] Documentation/x86: Add CET description References: <20190813205225.12032-1-yu-cheng.yu@intel.com> <20190813205225.12032-2-yu-cheng.yu@intel.com> Date: Wed, 14 Aug 2019 10:07:45 +0200 In-Reply-To: <20190813205225.12032-2-yu-cheng.yu@intel.com> (Yu-cheng Yu's message of "Tue, 13 Aug 2019 13:51:59 -0700") Message-ID: <87tvakgofi.fsf@oldenburg2.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 14 Aug 2019 08:07:57 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Yu-cheng Yu: > +ENDBR > + The compiler inserts an ENDBR at all valid branch targets. Any > + CALL/JMP to a target without an ENDBR triggers a control > + protection fault. Is this really correct? I think ENDBR is needed only for indirect branch targets where the jump/call does not have a NOTRACK prefix. In general, for security hardening, it seems best to minimize the number of ENDBR instructions, and use NOTRACK for indirect jumps which derive the branch target address from information that cannot be modified. Thanks, Florian