[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-05189820da23fc87ee2a7d87c20257f298af27f4@git.kernel.org>
Date: Fri, 20 Apr 2018 02:55:20 -0700
From: tip-bot for Joerg Roedel <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: bp@...e.de, jroedel@...e.de, dave.hansen@...ux.intel.com,
hpa@...or.com, mkubecek@...e.cz, linux-kernel@...r.kernel.org,
mingo@...nel.org, tglx@...utronix.de
Subject: [tip:x86/urgent] x86/power/64: Fix page-table setup for temporary
text mapping
Commit-ID: 05189820da23fc87ee2a7d87c20257f298af27f4
Gitweb: https://git.kernel.org/tip/05189820da23fc87ee2a7d87c20257f298af27f4
Author: Joerg Roedel <jroedel@...e.de>
AuthorDate: Thu, 19 Apr 2018 20:26:00 +0200
Committer: Thomas Gleixner <tglx@...utronix.de>
CommitDate: Fri, 20 Apr 2018 11:52:00 +0200
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@...e.de>
Signed-off-by: Joerg Roedel <jroedel@...e.de>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Tested-by: Michal Kubecek <mkubecek@...e.cz>
Tested-by: Borislav Petkov <bp@...e.de>
Cc: linux-pm@...r.kernel.org
Cc: rjw@...ysocki.net
Cc: pavel@....cz
Cc: hpa@...or.com
Cc: Dave Hansen <dave.hansen@...ux.intel.com>
Link: https://lkml.kernel.org/r/1524162360-26179-1-git-send-email-joro@8bytes.org
---
arch/x86/power/hibernate_64.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/power/hibernate_64.c b/arch/x86/power/hibernate_64.c
index 48b14b534897..ccf4a49bb065 100644
--- a/arch/x86/power/hibernate_64.c
+++ b/arch/x86/power/hibernate_64.c
@@ -98,7 +98,7 @@ static int set_up_temporary_text_mapping(pgd_t *pgd)
set_pgd(pgd + pgd_index(restore_jump_address), new_pgd);
} else {
/* No p4d for 4-level paging: point the pgd to the pud page table */
- pgd_t new_pgd = __pgd(__pa(p4d) | pgprot_val(pgtable_prot));
+ pgd_t new_pgd = __pgd(__pa(pud) | pgprot_val(pgtable_prot));
set_pgd(pgd + pgd_index(restore_jump_address), new_pgd);
}
Powered by blists - more mailing lists