summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorHugh Dickins <hughd@google.com>2024-07-08 07:46:00 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-07-18 13:18:33 +0200
commit7382fc5dd13c9269619f954ed35a1357e181c0bb (patch)
tree59decfbad108e8a9e77c8c9f403f380c2d0549e8 /net
parent61b2cda8aa68e97206c9a4c252144c50345e1e52 (diff)
downloadlinux-7382fc5dd13c9269619f954ed35a1357e181c0bb.tar.gz
linux-7382fc5dd13c9269619f954ed35a1357e181c0bb.tar.bz2
linux-7382fc5dd13c9269619f954ed35a1357e181c0bb.zip
net: fix rc7's __skb_datagram_iter()
[ Upstream commit f153831097b4435f963e385304cc0f1acba1c657 ] X would not start in my old 32-bit partition (and the "n"-handling looks just as wrong on 64-bit, but for whatever reason did not show up there): "n" must be accumulated over all pages before it's added to "offset" and compared with "copy", immediately after the skb_frag_foreach_page() loop. Fixes: d2d30a376d9c ("net: allow skb_datagram_iter to be called from any context") Signed-off-by: Hugh Dickins <hughd@google.com> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Link: https://patch.msgid.link/fef352e8-b89a-da51-f8ce-04bc39ee6481@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net')
-rw-r--r--net/core/datagram.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/core/datagram.c b/net/core/datagram.c
index cdd65ca3124a..87c39cc12327 100644
--- a/net/core/datagram.c
+++ b/net/core/datagram.c
@@ -441,11 +441,12 @@ static int __skb_datagram_iter(const struct sk_buff *skb, int offset,
if (copy > len)
copy = len;
+ n = 0;
skb_frag_foreach_page(frag,
skb_frag_off(frag) + offset - start,
copy, p, p_off, p_len, copied) {
vaddr = kmap_local_page(p);
- n = INDIRECT_CALL_1(cb, simple_copy_to_iter,
+ n += INDIRECT_CALL_1(cb, simple_copy_to_iter,
vaddr + p_off, p_len, data, to);
kunmap_local(vaddr);
}