]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
readv/writev: do the same MAX_RW_COUNT truncation that read/write does
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 29 Oct 2010 17:36:49 +0000 (10:36 -0700)
committerWilly Tarreau <w@1wt.eu>
Sat, 12 Mar 2016 13:25:41 +0000 (14:25 +0100)
commitadfdad98d876fc9e43746522d6329d482edca6b3
treec9c9f66b424afc50c358b8497c1eba5fd538dc62
parentcde5406e80c478bf89b6c2874f02126ba37a7d91
readv/writev: do the same MAX_RW_COUNT truncation that read/write does

commit 435f49a518c78eec8e2edbbadd912737246cbe20 upstream.

We used to protect against overflow, but rather than return an error, do
what read/write does, namely to limit the total size to MAX_RW_COUNT.
This is not only more consistent, but it also means that any broken
low-level read/write routine that still keeps counts in 'int' can't
break.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Willy Tarreau <w@1wt.eu>
fs/read_write.c
include/linux/fs.h