patch-2.4.23 linux-2.4.23/mm/mmap.c

Next file: linux-2.4.23/mm/mprotect.c
Previous file: linux-2.4.23/mm/memory.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.22/mm/mmap.c linux-2.4.23/mm/mmap.c
@@ -69,7 +69,7 @@
 	    return 1;
 
 	/* The page cache contains buffer pages these days.. */
-	free = atomic_read(&page_cache_size);
+	free = page_cache_size;
 	free += nr_free_pages();
 	free += nr_swap_pages;
 
@@ -1041,6 +1041,9 @@
 	if (!len)
 		return addr;
 
+	if ((addr + len) > TASK_SIZE || (addr + len) < addr)
+		return -EINVAL;
+
 	/*
 	 * mlock MCL_FUTURE?
 	 */

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)