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=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 4B54AC433E0 for ; Mon, 1 Feb 2021 22:59:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0E07364DAE for ; Mon, 1 Feb 2021 22:59:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230038AbhBAW7Q (ORCPT ); Mon, 1 Feb 2021 17:59:16 -0500 Received: from mga07.intel.com ([134.134.136.100]:27365 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229481AbhBAW7N (ORCPT ); Mon, 1 Feb 2021 17:59:13 -0500 IronPort-SDR: TGTUU0C3FenrfWZzVHFx1Kb7pHcLYodLaOqq+uxCfSfrk3hfn+V3awf0OaeAQKJ8cquqXbAySh gGvUpguaLKbA== X-IronPort-AV: E=McAfee;i="6000,8403,9882"; a="244847966" X-IronPort-AV: E=Sophos;i="5.79,393,1602572400"; d="scan'208";a="244847966" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Feb 2021 14:58:20 -0800 IronPort-SDR: IqxOEgskYY60zTXTSLKF3fe22Kcgl7l+wrY0AwgxcVcrUsG5CnA0GwGkRgywoMJYKqKeJ1U2qR KdB7JM0lGQIQ== X-IronPort-AV: E=Sophos;i="5.79,393,1602572400"; d="scan'208";a="370146281" Received: from yyu32-mobl1.amr.corp.intel.com (HELO [10.212.112.229]) ([10.212.112.229]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Feb 2021 14:58:19 -0800 Subject: Re: [PATCH v18 21/25] x86/cet/shstk: Handle signals for shadow stack To: Dave Hansen , 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 , Kees Cook , Mike Kravetz , Nadav Amit , Oleg Nesterov , Pavel Machek , Peter Zijlstra , Randy Dunlap , "Ravi V. Shankar" , Vedvyas Shanbhogue , Dave Martin , Weijiang Yang , Pengfei Xu References: <20210127212524.10188-1-yu-cheng.yu@intel.com> <20210127212524.10188-22-yu-cheng.yu@intel.com> <09da02c5-c6fb-878e-ad34-222f3a152460@intel.com> From: "Yu, Yu-cheng" Message-ID: <21462baa-8924-f005-33e1-f5fa36ed9942@intel.com> Date: Mon, 1 Feb 2021 14:58:19 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <09da02c5-c6fb-878e-ad34-222f3a152460@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/1/2021 2:53 PM, Dave Hansen wrote: > On 1/27/21 1:25 PM, Yu-cheng Yu wrote: >> To deliver a signal, create a shadow stack restore token and put a restore >> token and the signal restorer address on the shadow stack. For sigreturn, >> verify the token and restore the shadow stack pointer. >> >> Introduce WRUSS, which is a kernel-mode instruction but writes directly to >> user shadow stack. It is used to construct the user signal stack as >> described above. >> >> Introduce a signal context extension struct 'sc_ext', which is used to save >> shadow stack restore token address and WAIT_ENDBR status. WAIT_ENDBR will >> be introduced later in the Indirect Branch Tracking (IBT) series, but add >> that into sc_ext now to keep the struct stable in case the IBT series is >> applied later. > > This changelog needs some work. It's got a lot of "what" and not enough > "why". > > Why do we need a token? > What function does it serve? > What does it protect against? > Why do we need a signal context extension? > I will update it. -- Yu-cheng