[lkml]   [2019]   [Aug]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH v2] x86/mm/pti: in pti_clone_pgtable(), increase addr properly
On Wed, 21 Aug 2019, Song Liu wrote:
> > On Aug 20, 2019, at 1:23 PM, Song Liu <> wrote:
> >
> > Before 32-bit support, pti_clone_pmds() always adds PMD_SIZE to addr.
> > This behavior changes after the 32-bit support: pti_clone_pgtable()
> > increases addr by PUD_SIZE for pud_none(*pud) case, and increases addr by
> > PMD_SIZE for pmd_none(*pmd) case. However, this is not accurate because
> > addr may not be PUD_SIZE/PMD_SIZE aligned.
> >
> > Fix this issue by properly rounding up addr to next PUD_SIZE/PMD_SIZE
> > in these two cases.
> After poking around more, I found the following doesn't really make
> sense.

I'm glad you figured that out yourself. Was about to write up something to
that effect.

Still interesting questions remain:

1) How did you end up feeding an unaligned address into that which points
to a 0 PUD?

2) Is this related to Facebook specific changes and unlikely to affect any
regular kernel? I can't come up with a way to trigger that in mainline

3) As this is a user page table and the missing mapping is related to
mappings required by PTI, how is the machine going in/out of user
space in the first place? Or did I just trip over what you called



 \ /
  Last update: 2019-08-21 12:26    [W:0.090 / U:1.760 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site