Skip to content

Commit

Permalink
Revert "net: micro-optimize skb_datagram_iter"
Browse files Browse the repository at this point in the history
This reverts commit 934c299.
This triggered a usercopy BUG() in systems with HIGHMEM, reported
by the test robot in:
 https://lore.kernel.org/oe-lkp/202406161539.b5ff7b20-oliver.sang@intel.com

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Link: https://patch.msgid.link/20240626070153.759257-1-sagi@grimberg.me
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Sagi Grimberg authored and Jakub Kicinski committed Jun 27, 2024
1 parent 3a158e2 commit 2d5f680
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/core/datagram.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,14 +417,14 @@ static int __skb_datagram_iter(const struct sk_buff *skb, int offset,
end = start + skb_frag_size(frag);
if ((copy = end - offset) > 0) {
struct page *page = skb_frag_page(frag);
u8 *vaddr = kmap_local_page(page);
u8 *vaddr = kmap(page);

if (copy > len)
copy = len;
n = INDIRECT_CALL_1(cb, simple_copy_to_iter,
vaddr + skb_frag_off(frag) + offset - start,
copy, data, to);
kunmap_local(vaddr);
kunmap(page);
offset += n;
if (n != copy)
goto short_copy;
Expand Down

0 comments on commit 2d5f680

Please sign in to comment.