Re: "bad pmd" errors + oops with KPTI on 4.14.11 after loading X.509 certs

Thomas Gleixner
2018-01-04T16:34:15Z

On Thu, 4 Jan 2018, Andy Lutomirski wrote:
> On Thu, Jan 4, 2018 at 4:28 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
> > --- a/arch/x86/include/asm/pgtable_64_types.h
> > +++ b/arch/x86/include/asm/pgtable_64_types.h
> > @@ -88,7 +88,7 @@ typedef struct { pteval_t pte; } pte_t;
> > # define VMALLOC_SIZE_TB _AC(32, UL)
> > # define __VMALLOC_BASE _AC(0xffffc90000000000, UL)
> > # define __VMEMMAP_BASE _AC(0xffffea0000000000, UL)
> > -# define LDT_PGD_ENTRY _AC(-4, UL)
> > +# define LDT_PGD_ENTRY _AC(-3, UL)
> > # define LDT_BASE_ADDR (LDT_PGD_ENTRY << PGDIR_SHIFT)
> > #endif
>
> If you actually change the memory map order, you need to change the
> shadow copy in mm/dump_pagetables.c, too. I have a draft patch to
> just sort the damn list, but that's not ready yet.

Yes, I forgot that in the first attempt. Noticed myself when dumping it,
but that should be irrelevant to figure out whether it fixes the problem at
hand.