diff options
author | Dan Carpenter <dan.carpenter@linaro.org> | 2023-05-26 16:39:15 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2023-05-30 07:59:56 +0300 |
commit | ef1bc119ceb52d22a83f72b8dfce1dd64a3cca05 (patch) | |
tree | b056301510b19ba6e5cbc9ac4b748211243fa8fc | |
parent | 404621fab27310c231bab9a3999eab858390cb45 (diff) | |
download | linux-ef1bc119ceb52d22a83f72b8dfce1dd64a3cca05.tar.xz |
net: fix signedness bug in skb_splice_from_iter()
The "len" variable needs to be signed for the error handling to work
correctly.
Fixes: 2e910b95329c ("net: Add a function to splice pages into an skbuff for MSG_SPLICE_PAGES")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: David Howells <dhowells@redhat.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Link: https://lore.kernel.org/r/366861a7-87c8-4bbf-9101-69dd41021d07@kili.mountain
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-rw-r--r-- | net/core/skbuff.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 653abd8a6975..7c4338221b17 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -6931,8 +6931,8 @@ ssize_t skb_splice_from_iter(struct sk_buff *skb, struct iov_iter *iter, unsigned int i; while (iter->count > 0) { - ssize_t space, nr; - size_t off, len; + ssize_t space, nr, len; + size_t off; ret = -EMSGSIZE; space = frag_limit - skb_shinfo(skb)->nr_frags; |