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: <4C376013.7020208@goop.org>
Date:	Fri, 09 Jul 2010 10:44:51 -0700
From:	Jeremy Fitzhardinge <jeremy@...p.org>
To:	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
CC:	Andrea Arcangeli <aarcange@...hat.com>,
	Stefano Stabellini <stefano.stabellini@...citrix.com>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: [PATCH] remove mmu notifier calls in apply_to_page_range

It is not appropriate for apply_to_page_range() to directly call any
mmu notifiers, because it is a general purpose function whose effect
depends on what context it is called in and what the callback function
does.

In particular, if it is being used as part of an mmu notifier
implementation, the recursive calls can be particularly problematic.

It is up to apply_to_page_range's caller to do any notifier calls
if necessary.  It does not affect any in-tree users because they
all operate on init_mm, and mmu notifiers only pertain to usermode
mappings.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@...rix.com>
Cc: Andrea Arcangeli <aarcange@...hat.com>

diff --git a/mm/memory.c b/mm/memory.c
index 6ab19dd..d6b89eb 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -1890,7 +1890,6 @@ int apply_to_page_range(struct mm_struct *mm, unsigned long addr,
 	int err;
 
 	BUG_ON(addr >= end);
-	mmu_notifier_invalidate_range_start(mm, start, end);
 	pgd = pgd_offset(mm, addr);
 	do {
 		next = pgd_addr_end(addr, end);
@@ -1898,7 +1897,7 @@ int apply_to_page_range(struct mm_struct *mm, unsigned long addr,
 		if (err)
 			break;
 	} while (pgd++, addr = next, addr != end);
-	mmu_notifier_invalidate_range_end(mm, start, end);
+
 	return err;
 }
 EXPORT_SYMBOL_GPL(apply_to_page_range);


--
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