From: Xiao Guangrong Date: Tue, 28 Jan 2014 01:07:12 +0000 (-0800) Subject: splice: fix unexpected size truncation X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=53e0ee9fc59cb17fcad57e481b5889c791afe6c3;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git 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 Cc: Jens Axboe Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- 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 @@ * 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