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.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,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 51010C433DB for ; Wed, 24 Feb 2021 19:52:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B415764EDD for ; Wed, 24 Feb 2021 19:52:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B415764EDD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 2679E6B0005; Wed, 24 Feb 2021 14:52:40 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 217676B0006; Wed, 24 Feb 2021 14:52:40 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 12F8B6B006C; Wed, 24 Feb 2021 14:52:40 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0062.hostedemail.com [216.40.44.62]) by kanga.kvack.org (Postfix) with ESMTP id F31176B0005 for ; Wed, 24 Feb 2021 14:52:39 -0500 (EST) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id B3A791850365E for ; Wed, 24 Feb 2021 19:52:39 +0000 (UTC) X-FDA: 77854208838.09.9746919 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by imf30.hostedemail.com (Postfix) with ESMTP id 668D5E000100 for ; Wed, 24 Feb 2021 19:52:38 +0000 (UTC) IronPort-SDR: onLZmUXpHeQijxb7QU8A17apo3gJ0Icm65hSQM5O13aBGKF8ArkQQ23QS8hCGcNWsH68P9D/Wq Aha4/0efPe+Q== X-IronPort-AV: E=McAfee;i="6000,8403,9905"; a="182824527" X-IronPort-AV: E=Sophos;i="5.81,203,1610438400"; d="scan'208";a="182824527" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Feb 2021 11:52:34 -0800 IronPort-SDR: yXEcVzW98djE749wmWJeznbw7y/eWDKIg2JFChUy2uVPACaW3lKFTSPh+w1NRB+Semm7HIGoQg 1PmH0DR7BcFQ== X-IronPort-AV: E=Sophos;i="5.81,203,1610438400"; d="scan'208";a="431800681" Received: from yyu32-mobl1.amr.corp.intel.com (HELO [10.212.35.50]) ([10.212.35.50]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Feb 2021 11:52:33 -0800 Subject: Re: [PATCH v21 06/26] x86/cet: Add control-protection fault handler To: Borislav Petkov , Andy Lutomirski Cc: X86 ML , "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , LKML , "open list:DOCUMENTATION" , Linux-MM , linux-arch , Linux API , Arnd Bergmann , Balbir Singh , 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 , Haitao Huang , Michael Kerrisk References: <20210217222730.15819-1-yu-cheng.yu@intel.com> <20210217222730.15819-7-yu-cheng.yu@intel.com> <20210224161343.GE20344@zn.tnic> <32ac05ef-b50b-c947-095d-bc31a42947a3@intel.com> <20210224165332.GF20344@zn.tnic> <20210224192044.GH20344@zn.tnic> <20210224194204.GI20344@zn.tnic> From: "Yu, Yu-cheng" Message-ID: Date: Wed, 24 Feb 2021 11:52:33 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: <20210224194204.GI20344@zn.tnic> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 668D5E000100 X-Stat-Signature: fsna4ir11x55rhau58br9is38x7drb7k Received-SPF: none (intel.com>: No applicable sender policy available) receiver=imf30; identity=mailfrom; envelope-from=""; helo=mga04.intel.com; client-ip=192.55.52.120 X-HE-DKIM-Result: none/none X-HE-Tag: 1614196358-41511 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 2/24/2021 11:42 AM, Borislav Petkov wrote: > On Wed, Feb 24, 2021 at 11:30:34AM -0800, Andy Lutomirski wrote: >> On Wed, Feb 24, 2021 at 11:20 AM Borislav Petkov wrote: >>> >>> On Wed, Feb 24, 2021 at 09:56:13AM -0800, Yu, Yu-cheng wrote: >>>> No. Maybe I am doing too much. The GP fault sets si_addr to zero, for >>>> example. So maybe do the same here? >>> >>> No, you're looking at this from the wrong angle. This is going to be >>> user-visible and the moment it gets upstream, it is cast in stone. >>> >>> So the whole use case of what luserspace needs to do or is going to do >>> or wants to do on a SEGV_CPERR, needs to be described, agreed upon by >>> people etc before it goes out. And thus clarified whether the address >>> gets copied out or not. >> >> I vote 0. The address is in ucontext->gregs[REG_RIP] [0] regardless. >> Why do we need to stick a copy somewhere else? >> >> [0] or however it's spelled. i can never remember. > > Fine with me. Let's have this documented in the manpage and then we can > move forward with this. > > Thx. > The man page at https://man7.org/linux/man-pages/man2/sigaction.2.html says, SIGILL, SIGFPE, SIGSEGV, SIGBUS, and SIGTRAP fill in si_addr with the address of the fault. But it is not entirely true. I will send a patch to update it, and another patch for the si_code. -- Yu-cheng