From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yu-cheng Yu Subject: Re: [RFC PATCH v2 05/27] Documentation/x86: Add CET description Date: Wed, 11 Jul 2018 08:25:49 -0700 Message-ID: <1531322749.13297.17.camel@intel.com> References: <20180710222639.8241-1-yu-cheng.yu@intel.com> <20180710222639.8241-6-yu-cheng.yu@intel.com> <20180711082739.GA18919@amd> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Return-path: In-Reply-To: <20180711082739.GA18919@amd> Sender: linux-kernel-owner@vger.kernel.org To: Pavel Machek 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 , Cyrill Gorcunov , Dave Hansen , Florian Weimer , "H.J. Lu" , Jann Horn , Jonathan Corbet , Kees Cook , Mike Kravetz , Nadav Amit , Oleg Nesterov , Peter Zijlstra List-Id: linux-api@vger.kernel.org On Wed, 2018-07-11 at 10:27 +0200, Pavel Machek wrote: > On Tue 2018-07-10 15:26:17, Yu-cheng Yu wrote: > > > > Explain how CET works and the no_cet_shstk/no_cet_ibt kernel > > parameters. > > > > > > --- /dev/null > > +++ b/Documentation/x86/intel_cet.txt > > @@ -0,0 +1,250 @@ > > +========================================= > > +Control Flow Enforcement Technology (CET) > > +========================================= > We normally use .rst for this kind of formatted text. I will change this to a .rst file. > > > > > > +[6] The implementation of the SHSTK > > +=================================== > > + > > +SHSTK size > > +---------- > > + > > +A task's SHSTK is allocated from memory to a fixed size that can > > +support 32 KB nested function calls; that is 256 KB for a 64-bit > > +application and 128 KB for a 32-bit application.  The system admin > > +can change the default size. > How does admin change that? We already have ulimit for stack size, > should those be somehow tied together? > > $ ulimit -a > ... > stack size              (kbytes, -s) 8192 > We can do that.  This makes sense to me. Yu-cheng From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga17.intel.com ([192.55.52.151]:46172 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732456AbeGKPeV (ORCPT ); Wed, 11 Jul 2018 11:34:21 -0400 Message-ID: <1531322749.13297.17.camel@intel.com> Subject: Re: [RFC PATCH v2 05/27] Documentation/x86: Add CET description From: Yu-cheng Yu Date: Wed, 11 Jul 2018 08:25:49 -0700 In-Reply-To: <20180711082739.GA18919@amd> References: <20180710222639.8241-1-yu-cheng.yu@intel.com> <20180710222639.8241-6-yu-cheng.yu@intel.com> <20180711082739.GA18919@amd> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-arch-owner@vger.kernel.org List-ID: To: Pavel Machek 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 , Cyrill Gorcunov , Dave Hansen , Florian Weimer , "H.J. Lu" , Jann Horn , Jonathan Corbet , Kees Cook , Mike Kravetz , Nadav Amit , Oleg Nesterov , Peter Zijlstra , "Ravi V. Shankar" , Vedvyas Shanbhogue Message-ID: <20180711152549.eRzUjbQvLkkD2NGLLWMRgajinjg4k0Jv04Mo5VAZBIg@z> On Wed, 2018-07-11 at 10:27 +0200, Pavel Machek wrote: > On Tue 2018-07-10 15:26:17, Yu-cheng Yu wrote: > > > > Explain how CET works and the no_cet_shstk/no_cet_ibt kernel > > parameters. > > > > > > --- /dev/null > > +++ b/Documentation/x86/intel_cet.txt > > @@ -0,0 +1,250 @@ > > +========================================= > > +Control Flow Enforcement Technology (CET) > > +========================================= > We normally use .rst for this kind of formatted text. I will change this to a .rst file. > > > > > > +[6] The implementation of the SHSTK > > +=================================== > > + > > +SHSTK size > > +---------- > > + > > +A task's SHSTK is allocated from memory to a fixed size that can > > +support 32 KB nested function calls; that is 256 KB for a 64-bit > > +application and 128 KB for a 32-bit application.  The system admin > > +can change the default size. > How does admin change that? We already have ulimit for stack size, > should those be somehow tied together? > > $ ulimit -a > ... > stack size              (kbytes, -s) 8192 > We can do that.  This makes sense to me. Yu-cheng From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on archive.lwn.net X-Spam-Level: X-Spam-Status: No, score=-5.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham autolearn_force=no version=3.4.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by archive.lwn.net (Postfix) with ESMTP id 47E687D048 for ; Wed, 11 Jul 2018 15:29:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733241AbeGKPeV (ORCPT ); Wed, 11 Jul 2018 11:34:21 -0400 Received: from mga17.intel.com ([192.55.52.151]:46172 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732456AbeGKPeV (ORCPT ); Wed, 11 Jul 2018 11:34:21 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Jul 2018 08:29:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,338,1526367600"; d="scan'208";a="71458759" Received: from 2b52.sc.intel.com ([143.183.136.52]) by fmsmga001.fm.intel.com with ESMTP; 11 Jul 2018 08:29:26 -0700 Message-ID: <1531322749.13297.17.camel@intel.com> Subject: Re: [RFC PATCH v2 05/27] Documentation/x86: Add CET description From: Yu-cheng Yu To: Pavel Machek 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 , Cyrill Gorcunov , Dave Hansen , Florian Weimer , "H.J. Lu" , Jann Horn , Jonathan Corbet , Kees Cook , Mike Kravetz , Nadav Amit , Oleg Nesterov , Peter Zijlstra , "Ravi V. Shankar" , Vedvyas Shanbhogue Date: Wed, 11 Jul 2018 08:25:49 -0700 In-Reply-To: <20180711082739.GA18919@amd> References: <20180710222639.8241-1-yu-cheng.yu@intel.com> <20180710222639.8241-6-yu-cheng.yu@intel.com> <20180711082739.GA18919@amd> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.18.5.2-0ubuntu3.2 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-doc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org On Wed, 2018-07-11 at 10:27 +0200, Pavel Machek wrote: > On Tue 2018-07-10 15:26:17, Yu-cheng Yu wrote: > > > > Explain how CET works and the no_cet_shstk/no_cet_ibt kernel > > parameters. > > > > > > --- /dev/null > > +++ b/Documentation/x86/intel_cet.txt > > @@ -0,0 +1,250 @@ > > +========================================= > > +Control Flow Enforcement Technology (CET) > > +========================================= > We normally use .rst for this kind of formatted text. I will change this to a .rst file. > > > > > > +[6] The implementation of the SHSTK > > +=================================== > > + > > +SHSTK size > > +---------- > > + > > +A task's SHSTK is allocated from memory to a fixed size that can > > +support 32 KB nested function calls; that is 256 KB for a 64-bit > > +application and 128 KB for a 32-bit application.  The system admin > > +can change the default size. > How does admin change that? We already have ulimit for stack size, > should those be somehow tied together? > > $ ulimit -a > ... > stack size              (kbytes, -s) 8192 > We can do that.  This makes sense to me. Yu-cheng -- To unsubscribe from this list: send the line "unsubscribe linux-doc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f199.google.com (mail-pf0-f199.google.com [209.85.192.199]) by kanga.kvack.org (Postfix) with ESMTP id CEA6D6B0275 for ; Wed, 11 Jul 2018 11:29:31 -0400 (EDT) Received: by mail-pf0-f199.google.com with SMTP id t10-v6so16500259pfh.0 for ; Wed, 11 Jul 2018 08:29:31 -0700 (PDT) Received: from mga03.intel.com (mga03.intel.com. [134.134.136.65]) by mx.google.com with ESMTPS id z1-v6si18787549plo.516.2018.07.11.08.29.30 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Jul 2018 08:29:30 -0700 (PDT) Message-ID: <1531322749.13297.17.camel@intel.com> Subject: Re: [RFC PATCH v2 05/27] Documentation/x86: Add CET description From: Yu-cheng Yu Date: Wed, 11 Jul 2018 08:25:49 -0700 In-Reply-To: <20180711082739.GA18919@amd> References: <20180710222639.8241-1-yu-cheng.yu@intel.com> <20180710222639.8241-6-yu-cheng.yu@intel.com> <20180711082739.GA18919@amd> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: owner-linux-mm@kvack.org List-ID: To: Pavel Machek 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 , Cyrill Gorcunov , Dave Hansen , Florian Weimer , "H.J. Lu" , Jann Horn , Jonathan Corbet , Kees Cook , Mike Kravetz , Nadav Amit , Oleg Nesterov , Peter Zijlstra , "Ravi V. Shankar" , Vedvyas Shanbhogue On Wed, 2018-07-11 at 10:27 +0200, Pavel Machek wrote: > On Tue 2018-07-10 15:26:17, Yu-cheng Yu wrote: > > > > Explain how CET works and the no_cet_shstk/no_cet_ibt kernel > > parameters. > > > > > > --- /dev/null > > +++ b/Documentation/x86/intel_cet.txt > > @@ -0,0 +1,250 @@ > > +========================================= > > +Control Flow Enforcement Technology (CET) > > +========================================= > We normally use .rst for this kind of formatted text. I will change this to a .rst file. > > > > > > +[6] The implementation of the SHSTK > > +=================================== > > + > > +SHSTK size > > +---------- > > + > > +A task's SHSTK is allocated from memory to a fixed size that can > > +support 32 KB nested function calls; that is 256 KB for a 64-bit > > +application and 128 KB for a 32-bit application.A A The system admin > > +can change the default size. > How does admin change that? We already have ulimit for stack size, > should those be somehow tied together? > > $ ulimit -a > ... > stack sizeA A A A A A A A A A A A A A (kbytes, -s) 8192 > We can do that. A This makes sense to me. Yu-cheng