lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1524162360-26179-1-git-send-email-joro@8bytes.org>
Date:   Thu, 19 Apr 2018 20:26:00 +0200
From:   Joerg Roedel <joro@...tes.org>
To:     Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>
Cc:     rjw@...ysocki.net, pavel@....cz, hpa@...or.com,
        Michal Kubecek <mkubecek@...e.cz>,
        Borislav Petkov <bp@...e.de>, x86@...nel.org,
        linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
        Joerg Roedel <jroedel@...e.de>
Subject: [PATCH] x86/power/64: Fix page-table setup for temporary text mapping

From: Joerg Roedel <jroedel@...e.de>

When we have a 4-level page-table there is no p4d, so we map
the pud in the pgd. The old code before commit fb43d6cb91ef
already did that.

With the change from above commit we end up with an invalid
page-table which causes undefined behavior. In one report it
caused triple faults.

Fix it by changing the p4d back to pud so that we have a
correct page-table.

Reported-by: Borislav Petkov <bp@...e.de>
Fixes: fb43d6cb91ef ('x86/mm: Do not auto-massage page protections')
Tested-by: Michal Kubecek <mkubecek@...e.cz>
Tested-by: Borislav Petkov <bp@...e.de>
Signed-off-by: Joerg Roedel <jroedel@...e.de>
---
 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);
 	}
 
-- 
2.13.6

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ