patch-2.2.16 linux/fs/read_write.c

Next file: linux/fs/smbfs/cache.c
Previous file: linux/fs/proc/proc_tty.c
Back to the patch index
Back to the overall index

diff -urN v2.2.15/linux/fs/read_write.c linux/fs/read_write.c
@@ -214,6 +214,9 @@
 	for (i = 0 ; i < count ; i++)
 		tot_len += iov[i].iov_len;
 
+	if((long) tot_len <0)
+		return -EINVAL;
+
 	inode = file->f_dentry->d_inode;
 	/* VERIFY_WRITE actually means a read, as we write to user space */
 	ret = locks_verify_area((type == VERIFY_WRITE

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