lkml.org 
[lkml]   [2021]   [Mar]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v21 10/26] x86/mm: Update pte_modify for _PAGE_COW
From
Date
On 3/5/2021 6:29 AM, Borislav Petkov wrote:
> On Wed, Feb 17, 2021 at 02:27:14PM -0800, Yu-cheng Yu wrote:
>> @@ -787,16 +802,34 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
>> */
>> val &= _PAGE_CHG_MASK;
>> val |= check_pgprot(newprot) & ~_PAGE_CHG_MASK;
>> + val = fixup_dirty_pte(val);
>
> Do I see it correctly that you can do here and below:
>
> /*
> * Fix up potential shadow stack page flags because the RO, Dirty PTE is
> * special.
> */
> if (pte_dirty()) {
> pte_mkclean();
> pte_mkdirty();
> }
>
> ?

Yes, this looks better. Thanks!

>
> That fixup thing looks grafted and not like a normal flow to me.
>

\
 
 \ /
  Last update: 2021-03-08 17:53    [W:0.062 / U:1.748 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site