mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
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:
parent
a020ff412f
commit
e28cc71572
3 changed files with 28 additions and 12 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue