diff options
author | Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com> | 2014-01-27 20:07:12 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-28 00:02:40 -0500 |
commit | 53e0ee9fc59cb17fcad57e481b5889c791afe6c3 (patch) | |
tree | d7138cd4711ec89420ec9352d60910aade05cde2 | |
parent | e7ca2552369c1dfe0216c626baf82c3d83ec36bb (diff) |
splice: fix unexpected size truncation
@splice_desc.total_len is 32 bit(unsigned int) which is used to store the
size passed from userspace which is 64 bit(size_t) so that the size is
unexpectedly truncated
That means vmsplice can not work if the size passed from userspace is >=
4G, for example, we noticed in vmsplice, splice-reader does not do
anything and splice-writer is waiting for available buffer forever if the
size is 4G
Fix it by extending @splice_desc.total_len to 64 bits as well
Signed-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Cc: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | include/linux/splice.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/splice.h b/include/linux/splice.h index 74575cbf2d6f..0e43906d2fda 100644 --- a/include/linux/splice.h +++ b/include/linux/splice.h | |||
@@ -24,7 +24,8 @@ | |||
24 | * Passed to the actors | 24 | * Passed to the actors |
25 | */ | 25 | */ |
26 | struct splice_desc { | 26 | struct splice_desc { |
27 | unsigned int len, total_len; /* current and remaining length */ | 27 | size_t total_len; /* remaining length */ |
28 | unsigned int len; /* current length */ | ||
28 | unsigned int flags; /* splice flags */ | 29 | unsigned int flags; /* splice flags */ |
29 | /* | 30 | /* |
30 | * actor() private data | 31 | * actor() private data |