[lkml]   [2021]   [Feb]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH v19 14/25] x86/mm: Update maybe_mkwrite() for shadow stack
On Wed, Feb 03, 2021 at 02:55:36PM -0800, Yu-cheng Yu wrote:
> When serving a page fault, maybe_mkwrite() makes a PTE writable if its vma
> has VM_WRITE.
> A shadow stack vma has VM_SHSTK. Its PTEs have _PAGE_DIRTY, but not
> _PAGE_WRITE. In fork(), _PAGE_DIRTY is cleared to effect copy-on-write,
> and in page fault, _PAGE_DIRTY is restored and the shadow stack page is
> writable again.
> Update maybe_mkwrite() by introducing arch_maybe_mkwrite(), which sets
> _PAGE_DIRTY for a shadow stack PTE.
> Apply the same changes to maybe_pmd_mkwrite().
> Signed-off-by: Yu-cheng Yu <>

Reviewed-by: Kees Cook <>

Kees Cook

 \ /
  Last update: 2021-02-04 21:27    [W:0.376 / U:0.512 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site