Skip to content

Commit 6a527ad

Browse files
author
Paolo Abeni
committed
net: fix rc7's __skb_datagram_iter()
JIRA: https://issues.redhat.com/browse/RHEL-46610 Tested: LNST Upstream commit: commit f153831 Author: Hugh Dickins <hughd@google.com> Date: Mon Jul 8 07:46:00 2024 -0700 net: fix rc7's __skb_datagram_iter() 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: d2d30a3 ("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: Paolo Abeni <pabeni@redhat.com>
1 parent 00b84c9 commit 6a527ad

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/core/datagram.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,11 +441,12 @@ static int __skb_datagram_iter(const struct sk_buff *skb, int offset,
441441
if (copy > len)
442442
copy = len;
443443

444+
n = 0;
444445
skb_frag_foreach_page(frag,
445446
skb_frag_off(frag) + offset - start,
446447
copy, p, p_off, p_len, copied) {
447448
vaddr = kmap_local_page(p);
448-
n = INDIRECT_CALL_1(cb, simple_copy_to_iter,
449+
n += INDIRECT_CALL_1(cb, simple_copy_to_iter,
449450
vaddr + p_off, p_len, data, to);
450451
kunmap_local(vaddr);
451452
}

0 commit comments

Comments
 (0)