patch-2.3.27 linux/fs/ext2/file.c

Next file: linux/fs/ext2/ioctl.c
Previous file: linux/fs/exec.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.26/linux/fs/ext2/file.c linux/fs/ext2/file.c
@@ -62,6 +62,8 @@
 		case 1:
 			offset += file->f_pos;
 	}
+	if (offset<0)
+		return -EINVAL;
 	if (((unsigned long long) offset >> 32) != 0) {
 		if (offset > ext2_max_sizes[EXT2_BLOCK_SIZE_BITS(inode->i_sb)])
 			return -EINVAL;

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