From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 899EFC433E0 for ; Thu, 4 Feb 2021 19:50:14 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0AE7964F53 for ; Thu, 4 Feb 2021 19:50:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0AE7964F53 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 712FC6B0070; Thu, 4 Feb 2021 14:50:13 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6C2096B0071; Thu, 4 Feb 2021 14:50:13 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 589626B0072; Thu, 4 Feb 2021 14:50:13 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0162.hostedemail.com [216.40.44.162]) by kanga.kvack.org (Postfix) with ESMTP id 3FB536B0070 for ; Thu, 4 Feb 2021 14:50:13 -0500 (EST) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id E51401EE6 for ; Thu, 4 Feb 2021 19:50:12 +0000 (UTC) X-FDA: 77781626664.20.copy59_3107e0d275de Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin20.hostedemail.com (Postfix) with ESMTP id BF0D8180C07A3 for ; Thu, 4 Feb 2021 19:50:12 +0000 (UTC) X-HE-Tag: copy59_3107e0d275de X-Filterd-Recvd-Size: 4386 Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) by imf49.hostedemail.com (Postfix) with ESMTP for ; Thu, 4 Feb 2021 19:50:12 +0000 (UTC) Received: by mail-pf1-f180.google.com with SMTP id o20so2793085pfu.0 for ; Thu, 04 Feb 2021 11:50:12 -0800 (PST) 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=/xqrcr0spyydoAlLuc99uq3cskkQtgF/Uv01pgyq0ds=; b=Du7iFlDWFI6enawRDcehFsluT1W0OthyU+AXhyMr2mtTzw5vkuy1H9ceFkQ99qBJSj YRZMriPtX53oHb/EVc4MsIXCaJaAWcAnrhRVJuNdh31kUgip6KfbWaqBmyGFYUzIukx5 G+L+T8Il52MlwCw8EchSrWSoJXEI9rmSN/3Nw= 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=/xqrcr0spyydoAlLuc99uq3cskkQtgF/Uv01pgyq0ds=; b=lyTu8ejxsWUHZrKEuhXPdL1TNxRsXJiRoy4f3uQr3eJ0Jpo09UyDZY9w+k3LhxwKcp 97TV43Jl1iUZwMZiV7lJTtVGYagRrVAYq9rXrOyykockJ8geBfrhCI9/WpaeHZ+57iYC 5fmwBX9dGfp2LIeMlUHXLxH+rUziR6aumfULz0LLxDMU8V+40dxprewJbFq5SP4C7UUH vjEWyI5jzjUWXFWFNqu8IgIkzprKTI7q0bHDb1C3PeWWfU53a9nyKX895vTUwWVmCPLh x9GPJk8ZYF47sQma5hlZvx90ZE4M2MT9oW4iYRJpPyO3rdiXVV8JTeO41bLoAh5mykF7 thqg== X-Gm-Message-State: AOAM531auAJF4L5tvL5AC+Xhya1d43O0NrOz7+yYyPVvXlwIZE362tXr sdhMKoSB6OcyuJBCi9y3lgUDsA== X-Google-Smtp-Source: ABdhPJxtHH5uZ1Z7iC4WZebLw2vn0Wmq76brvfnWdJDqyjrAJu644mdWx5Auq5N/jwzL0m0zXveDdg== X-Received: by 2002:a62:ac06:0:b029:1cb:35bc:5e2c with SMTP id v6-20020a62ac060000b02901cb35bc5e2cmr894242pfe.42.1612468211577; Thu, 04 Feb 2021 11:50:11 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id z16sm7448343pgj.51.2021.02.04.11.50.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Feb 2021 11:50:10 -0800 (PST) Date: Thu, 4 Feb 2021 11:50:09 -0800 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 Subject: Re: [PATCH v19 3/7] x86/cet/ibt: Handle signals for Indirect Branch Tracking Message-ID: <202102041150.3614663DA@keescook> References: <20210203225902.479-1-yu-cheng.yu@intel.com> <20210203225902.479-4-yu-cheng.yu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210203225902.479-4-yu-cheng.yu@intel.com> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Feb 03, 2021 at 02:58:58PM -0800, Yu-cheng Yu wrote: > When an indirect CALL/JMP instruction is executed and before it reaches > the target, it is in 'WAIT_ENDBR' status, which can be read from > MSR_IA32_U_CET. The status is part of a task's status before a signal is > raised and preserved in the signal frame. It is restored for sigreturn. > > IBT state machine is described in Intel SDM Vol. 1, Sec. 18.3. > > Signed-off-by: Yu-cheng Yu Reviewed-by: Kees Cook -- Kees Cook