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.3 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 C95A3C433E0 for ; Wed, 10 Feb 2021 19:34:06 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5D53864E6F for ; Wed, 10 Feb 2021 19:34:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5D53864E6F 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 CF49C8D0001; Wed, 10 Feb 2021 14:34:05 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CA1856B0085; Wed, 10 Feb 2021 14:34:05 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B6ACA8D0001; Wed, 10 Feb 2021 14:34:05 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0103.hostedemail.com [216.40.44.103]) by kanga.kvack.org (Postfix) with ESMTP id 9C0C46B0083 for ; Wed, 10 Feb 2021 14:34:05 -0500 (EST) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 668A11803A560 for ; Wed, 10 Feb 2021 19:34:05 +0000 (UTC) X-FDA: 77803358850.01.sand71_200236527612 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin01.hostedemail.com (Postfix) with ESMTP id 4008E1009108A for ; Wed, 10 Feb 2021 19:34:05 +0000 (UTC) X-HE-Tag: sand71_200236527612 X-Filterd-Recvd-Size: 4554 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) by imf32.hostedemail.com (Postfix) with ESMTP for ; Wed, 10 Feb 2021 19:34:04 +0000 (UTC) Received: by mail-pl1-f182.google.com with SMTP id e12so1785682pls.4 for ; Wed, 10 Feb 2021 11:34:04 -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=LxaZ4hziEn9bchFK4AxqUiBcTDlmtg7lC2ZBUIMeIPQ=; b=nRz/Y4Y5rIwUL1EuSMgwTQJXMPe2fRzT5faEAJAOhNicQ+O6uXb8rFTVjChcJytO38 iZzMzgApYK6PyJKIgtWx0b3QyfsAou3UCfKtA7njlDUDBn3dG1Vf9lzcDMklXcV7UQIs wJv/CUJiDCLpOS0wR3wJHlX1yC2Cgie/lSZPY= 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=LxaZ4hziEn9bchFK4AxqUiBcTDlmtg7lC2ZBUIMeIPQ=; b=h1Oli22GTnJ8QQ63F7PI/OApXTvtlQM4mECBDkIoPPmVdYIPOhuG1jxIfJfep9ecoE VxogipBQxDcospzI3G836WZxVbq7m4kYmzx5zejNt/scyciUAfLIPXlyF1ETlHabC019 7NCz9yIgYZXdfQDQ8H/5ye8fnt3X+6+DPQqPvAKwNCBjR+z4TkRyvs966YyJne0yBmBU 2xhtCBYRDhxQhsx0ZGepW+ldmJriduO02yQ42Oyy7z7/qKxV0PFKw4az4NaFAlij5VuH 94Oxw4S2QU0UYqtC0e7XLXCwkXHYZRmc7xzuiQKNZR7nQNxRP7VY8fs5QZvy5wMzdHOt X+jA== X-Gm-Message-State: AOAM533PNj0EZFt1kvr6GmwIB/UerUM8Rcw31/YJ2bQj7ESuMkDoKWZJ A2XzSaBH4icXFMrzQU2gyBnrhQ== X-Google-Smtp-Source: ABdhPJyRecy1GRXLP1kMQcH16Sgfnf+QusYUJ4oECanP4lP6AnzDHzMfwFxFC9h1QK8RZDo1gMXKvg== X-Received: by 2002:a17:90a:4fc1:: with SMTP id q59mr443897pjh.129.1612985643404; Wed, 10 Feb 2021 11:34:03 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id z2sm3089727pfj.100.2021.02.10.11.34.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Feb 2021 11:34:02 -0800 (PST) Date: Wed, 10 Feb 2021 11:34:01 -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 , haitao.huang@intel.com, Michael Kerrisk Subject: Re: [PATCH v20 06/25] x86/cet: Add control-protection fault handler Message-ID: <202102101134.CC29A738B@keescook> References: <20210210175703.12492-1-yu-cheng.yu@intel.com> <20210210175703.12492-7-yu-cheng.yu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210210175703.12492-7-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 10, 2021 at 09:56:44AM -0800, Yu-cheng Yu wrote: > A control-protection fault is triggered when a control-flow transfer > attempt violates Shadow Stack or Indirect Branch Tracking constraints. > For example, the return address for a RET instruction differs from the copy > on the shadow stack; or an indirect JMP instruction, without the NOTRACK > prefix, arrives at a non-ENDBR opcode. > > The control-protection fault handler works in a similar way as the general > protection fault handler. It provides the si_code SEGV_CPERR to the signal > handler. > > Signed-off-by: Yu-cheng Yu Reviewed-by: Kees Cook -- Kees Cook