[PATCH] x86/pgtable: Don't set huge pud/pmd on non-leaf entries

From: Joerg Roedel
Date: Wed Apr 11 2018 - 11:24:46 EST


Hi Ingo, Thomas,

below patch is an update to this series and I plan to include it in the
next post. David H. Gutteridge (CC'ed) was so kind to do additional
testing of these patches and found that a BUG_ON was triggered in
vmalloc_sync_one() when PTI is enabled.

My debugging showed that the bug was present before my patches but that
they uncovered this bug by setting SHARED_KERNEL_PMD to 0 when PTI is
enabled.

So please have a look at the issue description below and the patch and
let me know what you think. I know there are other and better variants
to fix that, but I felt a rework to make the generic ioremap code more
safe against this is out-of-scope at least for this patch-set.


Thanks,

Joerg