x86/power/64: Fix page-table setup for temporary text mapping
authorJoerg Roedel <jroedel@suse.de>
Thu, 19 Apr 2018 18:26:00 +0000 (20:26 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Fri, 20 Apr 2018 09:52:00 +0000 (11:52 +0200)
commit05189820da23fc87ee2a7d87c20257f298af27f4
tree16d58f879aa85e8cd404b402f425d355569661dc
parentd6ef1f194b7569af8b8397876dc9ab07649d63cb
x86/power/64: Fix page-table setup for temporary text mapping

On a system with 4-level page-tables there is no p4d, so the pud in the pgd
should be mapped. The old code before commit fb43d6cb91ef already did that.

The change from above commit causes an invalid page-table which causes
undefined behavior. In one report it caused triple faults.

Fix it by changing the p4d back to pud.

Fixes: fb43d6cb91ef ('x86/mm: Do not auto-massage page protections')
Reported-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Michal Kubecek <mkubecek@suse.cz>
Tested-by: Borislav Petkov <bp@suse.de>
Cc: linux-pm@vger.kernel.org
Cc: rjw@rjwysocki.net
Cc: pavel@ucw.cz
Cc: hpa@zytor.com
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Link: https://lkml.kernel.org/r/1524162360-26179-1-git-send-email-joro@8bytes.org
arch/x86/power/hibernate_64.c