linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] clear_page_tables
@ 2001-08-23 19:05 Ben LaHaise
  0 siblings, 0 replies; only message in thread
From: Ben LaHaise @ 2001-08-23 19:05 UTC (permalink / raw)
  To: alan; +Cc: linux-mm

Heylo,

The patch below fixes a lack of locking in clear_page_tables which could
result in kswapd poking at page tables that have been freed.

		-ben

/patches/v2.4.8-ac9-clear_page_tables-lock.diff...
diff -ur /md0/kernels/2.4/v2.4.8-ac9/mm/memory.c vm-v2.4.8-ac9/mm/memory.c
--- /md0/kernels/2.4/v2.4.8-ac9/mm/memory.c	Thu Aug 23 13:48:25 2001
+++ vm-v2.4.8-ac9/mm/memory.c	Thu Aug 23 14:45:46 2001
@@ -129,11 +129,13 @@
 {
 	pgd_t * page_dir = mm->pgd;
 
+	spin_lock(&mm->page_table_lock);
 	page_dir += first;
 	do {
 		free_one_pgd(page_dir);
 		page_dir++;
 	} while (--nr);
+	spin_unlock(&mm->page_table_lock);
 
 	/* keep the page table cache within bounds */
 	check_pgt_cache();
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-08-23 19:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-23 19:05 [PATCH] clear_page_tables Ben LaHaise

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox