patch-2.4.18 linux/mm/shmem.c

Next file: linux/mm/swapfile.c
Previous file: linux/mm/page_alloc.c
Back to the patch index
Back to the overall index

diff -Naur -X /home/marcelo/lib/dontdiff linux.orig/mm/shmem.c linux/mm/shmem.c
@@ -752,6 +752,11 @@
 	long		status;
 	int		err;
 
+	if ((ssize_t) count < 0)
+		return -EINVAL;
+
+	if (!access_ok(VERIFY_READ, buf, count))
+		return -EFAULT;
 
 	down(&inode->i_sem);
 

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