Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp772903pxy; Wed, 28 Apr 2021 14:00:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxa5Md27NQw0KrFG17bij2QsPiCzyTKrQumYP+DiIe0oCi5UDOgEpkoIqBhIJuEq+AVvKj0 X-Received: by 2002:a17:906:7f97:: with SMTP id f23mr12576303ejr.74.1619643609540; Wed, 28 Apr 2021 14:00:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619643609; cv=none; d=google.com; s=arc-20160816; b=bPmYfcI4JOH9SnNiCCbpnj3+Jv+xxXth8k58zYKKNbxpUHty99yRsycUBU7CF+QhB8 exsAik5984cA+/xO15vKZu7VLbE2J1+A9ehlkXNWeWFq1aReRmKOvCURDyMp9P336HRL 7hZvAG5aSB3Tj31kuvt2d02jqyNFoXNuw37M+Ufx++sYgD6YvTyOmVZ+rzLPptD9M6TS RHNeLrDd1oTVQWfb6HPSAdGB1V5KD+kr82iai6Q/v7u/B1dwH5ZinXSRBISh+vgcExxc RX17v/FpujBu+ZB6mLlL+xcnG5P/FjEopV5d+9Q2tRIA6IgqTO1aRMu6wA7fPuxDM6YI BeMg== 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=1UitsZpR0FImv5ggcDLypma8EKgOpgnJx3YkJXeeP/g=; b=CJUjqs94W28pLXKLfGdorAqcyiJolFbNOeazuMD+nfGLbCNIETkHR3IIFRgb2mn2kU qKIOOn05tv+WvuCqG957ZclIusyHT1kP6WUZAH3k7eRxjDycbZZw0zVP6xCFBx5wkV6m vsF96hM9w27jsYQIVINTWhclf51eBb4WWC3tcvmnV3Ui1yFbX8cnuBLfUrKKk67jnvy/ 6ACIBHpAjHnjNsioS5aYb11NJ+s9gngtJ/9qkmKgW1lYixWxpjI7MwFv+rOyVLU6+keg GItX2kG4Y/6F5RtLN+iTNpV7tXWVqAsL5QzHx7ENOO4W/De0Oz9XL9LU2q2k2fkJWt48 AvGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ARndYMZQ; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k18si781014edx.427.2021.04.28.13.59.43; Wed, 28 Apr 2021 14:00:09 -0700 (PDT) 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=@chromium.org header.s=google header.b=ARndYMZQ; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241297AbhD1UeZ (ORCPT + 99 others); Wed, 28 Apr 2021 16:34:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241975AbhD1UeR (ORCPT ); Wed, 28 Apr 2021 16:34:17 -0400 Received: from mail-pg1-x534.google.com (mail-pg1-x534.google.com [IPv6:2607:f8b0:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5FEDC06138C for ; Wed, 28 Apr 2021 13:33:30 -0700 (PDT) Received: by mail-pg1-x534.google.com with SMTP id p2so30134149pgh.4 for ; Wed, 28 Apr 2021 13:33:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=1UitsZpR0FImv5ggcDLypma8EKgOpgnJx3YkJXeeP/g=; b=ARndYMZQdTMTKo8NpDPqCuYDKZF9djP2UPKbAdC42uZHJJBbMeK0GE/suIIWmROC0q 9nS0a4P6emTISkcViGmQk/z3XR4G9JRpfAadBQb/Qo66eE9w7baiUQ4lxzMjM1Kt6lPm WGrhIK7HSGS2a3KHvCIcIH3ny+PK9p4PqXxpc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=1UitsZpR0FImv5ggcDLypma8EKgOpgnJx3YkJXeeP/g=; b=V5sAroXEEMOIdc80zax/aSv0R8VEG6hshIgCXZnIk9lJnyFwYrw6oaoLuEuV/Sg/qr hDXy6nsveRQGdc+Hhm3G1iqMZOppiLwiOwe0gcJfkE5qP/Y0Ss3twKgocKrGnt3uC+00 aGc/N6JvL2IbM3pKP4hRmKunGRNCV7touXVlGskLUM8PI8fIjtRKxQ4wvbXHdlyRiSgd /TVEQDCEu04QAsg2WsTmavyccVgwA26APmuj3SW8NVB6yIlv9y/9J3x0GyRM/NC0kInt M7KNpyITVw/FoBVGotBpwmU+BiU+VTs/wYIvik7ZHXG9H4DRD7gfs5rslqd13I7NX+yp 1tmQ== X-Gm-Message-State: AOAM531ItwjYAElEm4K89D9wv8x457dqorQWbwEE9bOdQmix8yld+SbV 3gtJcSnzzTtSJYk+UMJ6vq35Ig== X-Received: by 2002:a63:fe53:: with SMTP id x19mr28088284pgj.449.1619642010363; Wed, 28 Apr 2021 13:33:30 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id b140sm491785pfb.98.2021.04.28.13.33.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Apr 2021 13:33:29 -0700 (PDT) Date: Wed, 28 Apr 2021 13:33:28 -0700 From: Kees Cook 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 , Florian Weimer , "H.J. Lu" , Jann Horn , Jonathan Corbet , Mike Kravetz , Nadav Amit , Oleg Nesterov , Pavel Machek , Peter Zijlstra , Randy Dunlap , "Ravi V. Shankar" , Vedvyas Shanbhogue , Dave Martin , Weijiang Yang , Pengfei Xu , Haitao Huang , Jarkko Sakkinen Subject: Re: [PATCH v26 7/9] x86/vdso: Introduce ENDBR macro Message-ID: <202104281333.D76723E@keescook> References: <20210427204720.25007-1-yu-cheng.yu@intel.com> <20210427204720.25007-8-yu-cheng.yu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210427204720.25007-8-yu-cheng.yu@intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 27, 2021 at 01:47:18PM -0700, Yu-cheng Yu wrote: > ENDBR is a special new instruction for the Indirect Branch Tracking (IBT) > component of CET. IBT prevents attacks by ensuring that (most) indirect > branches and function calls may only land at ENDBR instructions. Branches > that don't follow the rules will result in control flow (#CF) exceptions. > > ENDBR is a noop when IBT is unsupported or disabled. Most ENDBR > instructions are inserted automatically by the compiler, but branch > targets written in assembly must have ENDBR added manually. > > Introduce ENDBR64/ENDBR32 macros. > > Signed-off-by: Yu-cheng Yu Reviewed-by: Kees Cook -- Kees Cook