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: <1524755647-18695-1-git-send-email-joro@8bytes.org>
Date:   Thu, 26 Apr 2018 17:14:07 +0200
From:   Joerg Roedel <joro@...tes.org>
To:     Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>
Cc:     hpa@...or.com, Michal Hocko <mhocko@...e.com>,
        Borislav Petkov <bp@...e.de>,
        Matthew Wilcox <willy@...radead.org>, stable@...r.kernel.org,
        Andrew Morton <akpm@...ux-foundation.org>,
        linux-kernel@...r.kernel.org, x86@...nel.org,
        Toshi Kani <toshi.kani@....com>, Joerg Roedel <jroedel@...e.de>
Subject: [PATCH] Revert "x86/mm: implement free pmd/pte page interfaces"

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

This reverts commit 28ee90fe6048fa7b7ceaeb8831c0e4e454a4cf89.

This commit is broken for x86, as it unmaps the PTE and PMD
pages and immediatly frees them without doing a TLB flush.

Further this lacks synchronization with other page-tables in
the system when the PMD pages are not shared between
mm_structs.

On x86-32 with PAE and PTI patches on-top this patch
triggers the BUG_ON in vmalloc_sync_one() because the kernel
and the process page-table were not synchronized.

Signed-off-by: Joerg Roedel <jroedel@...e.de>
---
 arch/x86/mm/pgtable.c | 28 ++--------------------------
 1 file changed, 2 insertions(+), 26 deletions(-)

diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c
index ae98d4c5e32a..fd02a537a80f 100644
--- a/arch/x86/mm/pgtable.c
+++ b/arch/x86/mm/pgtable.c
@@ -787,22 +787,7 @@ int pmd_clear_huge(pmd_t *pmd)
  */
 int pud_free_pmd_page(pud_t *pud)
 {
-	pmd_t *pmd;
-	int i;
-
-	if (pud_none(*pud))
-		return 1;
-
-	pmd = (pmd_t *)pud_page_vaddr(*pud);
-
-	for (i = 0; i < PTRS_PER_PMD; i++)
-		if (!pmd_free_pte_page(&pmd[i]))
-			return 0;
-
-	pud_clear(pud);
-	free_page((unsigned long)pmd);
-
-	return 1;
+	return pud_none(*pud);
 }
 
 /**
@@ -814,15 +799,6 @@ int pud_free_pmd_page(pud_t *pud)
  */
 int pmd_free_pte_page(pmd_t *pmd)
 {
-	pte_t *pte;
-
-	if (pmd_none(*pmd))
-		return 1;
-
-	pte = (pte_t *)pmd_page_vaddr(*pmd);
-	pmd_clear(pmd);
-	free_page((unsigned long)pte);
-
-	return 1;
+	return pmd_none(*pmd);
 }
 #endif	/* CONFIG_HAVE_ARCH_HUGE_VMAP */
-- 
2.13.6

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ