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 <[email protected]>
Cc: Ulrich Drepper <[email protected]>
Cc: Andi Kleen <[email protected]>
Cc: Al Viro <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
Linus Torvalds 2006-01-04 16:20:40 -08:00
commit e28cc71572
3 changed files with 28 additions and 12 deletions

View file

@ -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;