From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dave Hansen Subject: Re: [RFC PATCH v9 06/27] mm: Introduce VM_SHSTK for Shadow Stack memory Date: Wed, 26 Feb 2020 10:07:54 -0800 Message-ID: <021394ef-e552-0639-0294-472e32e0d3fc@intel.com> References: <20200205181935.3712-1-yu-cheng.yu@intel.com> <20200205181935.3712-7-yu-cheng.yu@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: In-Reply-To: <20200205181935.3712-7-yu-cheng.yu@intel.com> Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org To: Yu-cheng Yu , 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 List-Id: linux-arch.vger.kernel.org On 2/5/20 10:19 AM, Yu-cheng Yu wrote: > A Shadow Stack (SHSTK) PTE must be read-only and have _PAGE_DIRTY set. > However, read-only and Dirty PTEs also exist for copy-on-write (COW) pages. > These two cases are handled differently for page faults and a new VM flag > is necessary for tracking SHSTK VMAs. > > v9: > - Add VM_SHSTK case to arch_vma_name(). > - Revise the commit log to explain why a new VM flag is needed. To be honest, a flag is not strictly *needed*. It is certainly convenient and straightforward, but it's far from being truly necessary. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com ([192.55.52.88]:36691 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726787AbgBZSH5 (ORCPT ); Wed, 26 Feb 2020 13:07:57 -0500 Subject: Re: [RFC PATCH v9 06/27] mm: Introduce VM_SHSTK for Shadow Stack memory References: <20200205181935.3712-1-yu-cheng.yu@intel.com> <20200205181935.3712-7-yu-cheng.yu@intel.com> From: Dave Hansen Message-ID: <021394ef-e552-0639-0294-472e32e0d3fc@intel.com> Date: Wed, 26 Feb 2020 10:07:54 -0800 MIME-Version: 1.0 In-Reply-To: <20200205181935.3712-7-yu-cheng.yu@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-arch-owner@vger.kernel.org List-ID: To: Yu-cheng Yu , 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 , x86-patch-review@intel.com Message-ID: <20200226180754.7F5zQOP29WHHu9YR6Ois_NpQeOjVe_A4z_DLIqBCIkg@z> On 2/5/20 10:19 AM, Yu-cheng Yu wrote: > A Shadow Stack (SHSTK) PTE must be read-only and have _PAGE_DIRTY set. > However, read-only and Dirty PTEs also exist for copy-on-write (COW) pages. > These two cases are handled differently for page faults and a new VM flag > is necessary for tracking SHSTK VMAs. > > v9: > - Add VM_SHSTK case to arch_vma_name(). > - Revise the commit log to explain why a new VM flag is needed. To be honest, a flag is not strictly *needed*. It is certainly convenient and straightforward, but it's far from being truly necessary.