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]
Date:	Thu, 12 Feb 2009 16:21:04 -0800
From:	Jeremy Fitzhardinge <jeremy@...p.org>
To:	Andrew Morton <akpm@...ux-foundation.org>
CC:	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: [PATCH] mm: disable preemption in apply_to_pte_range

commit 79d9c90453a7bc9e7613ae889a97ff6b44ab8380
Author: Jeremy Fitzhardinge <jeremy.fitzhardinge@...rix.com>
Date:   Thu Feb 12 13:45:34 2009 -0800

    mm: disable preemption in apply_to_pte_range
    
    Lazy mmu mode needs preemption disabled, so if we're apply to
    init_mm (which doesn't require any pte locks), then explicitly
    disable preemption.
    
    Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@...rix.com>

diff --git a/mm/memory.c b/mm/memory.c
index baa999e..71b3fb8 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -1710,9 +1710,11 @@ static int apply_to_pte_range(struct mm_struct *mm, pmd_t *pmd,
 	pgtable_t token;
 	spinlock_t *uninitialized_var(ptl);
 
-	pte = (mm == &init_mm) ?
-		pte_alloc_kernel(pmd, addr) :
-		pte_alloc_map_lock(mm, pmd, addr, &ptl);
+	if (mm == &init_mm) {
+		preempt_disable();
+		pte = pte_alloc_kernel(pmd, addr);
+	} else
+		pte = pte_alloc_map_lock(mm, pmd, addr, &ptl);
 	if (!pte)
 		return -ENOMEM;
 
@@ -1732,6 +1734,9 @@ static int apply_to_pte_range(struct mm_struct *mm, pmd_t *pmd,
 
 	if (mm != &init_mm)
 		pte_unmap_unlock(pte-1, ptl);
+	else
+		preempt_enable();
+
 	return err;
 }


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ