提交 53e0ee9f 编写于 作者: X Xiao Guangrong 提交者: Linus Torvalds

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: NXiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Cc: Jens Axboe <axboe@kernel.dk>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 e7ca2552
......@@ -24,7 +24,8 @@
* Passed to the actors
*/
struct splice_desc {
unsigned int len, total_len; /* current and remaining length */
size_t total_len; /* remaining length */
unsigned int len; /* current length */
unsigned int flags; /* splice flags */
/*
* actor() private data
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册