patch-2.3.4 linux/mm/mmap.c

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

diff -u --recursive --new-file v2.3.3/linux/mm/mmap.c linux/mm/mmap.c
@@ -185,6 +185,9 @@
 	if (len > TASK_SIZE || addr > TASK_SIZE-len)
 		return -EINVAL;
 
+	if (off & ~PAGE_MASK)
+		return -EINVAL;
+
 	/* offset overflow? */
 	if (off + len < off)
 		return -EINVAL;

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