summaryrefslogtreecommitdiffstats
path: root/fs/compat.c
diff options
context:
space:
mode:
authorLinus Torvalds2006-01-05 01:20:40 +0100
committerLinus Torvalds2006-01-05 01:20:40 +0100
commite28cc71572da38a5a12c1cfe4d7032017adccf69 (patch)
treebea9af22a98ea2988a38f5e9fc2467ccbbf3ae70 /fs/compat.c
parent[PATCH] Fix pragma packing in ip2 driver (diff)
downloadkernel-qcow2-linux-e28cc71572da38a5a12c1cfe4d7032017adccf69.tar.gz
kernel-qcow2-linux-e28cc71572da38a5a12c1cfe4d7032017adccf69.tar.xz
kernel-qcow2-linux-e28cc71572da38a5a12c1cfe4d7032017adccf69.zip
Relax the rw_verify_area() error checking.
In particular, allow over-large read- or write-requests to be downgraded to a more reasonable range, rather than considering them outright errors. We want to protect lower layers from (the sadly all too common) overflow conditions, but prefer to do so by chopping the requests up, rather than just refusing them outright. Cc: Peter Anvin <hpa@zytor.com> Cc: Ulrich Drepper <drepper@redhat.com> Cc: Andi Kleen <ak@suse.de> Cc: Al Viro <viro@ftp.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/compat.c')
-rw-r--r--fs/compat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/compat.c b/fs/compat.c
index 818634120b69..55ac0324aaf1 100644
--- a/fs/compat.c
+++ b/fs/compat.c
@@ -1170,7 +1170,7 @@ static ssize_t compat_do_readv_writev(int type, struct file *file,
}
ret = rw_verify_area(type, file, pos, tot_len);
- if (ret)
+ if (ret < 0)
goto out;
fnv = NULL;