]> www.infradead.org Git - nvme.git/commit
udp: Compute L4 checksum as usual when not segmenting the skb
authorJakub Sitnicki <jakub@cloudflare.com>
Fri, 11 Oct 2024 12:17:30 +0000 (14:17 +0200)
committerJakub Kicinski <kuba@kernel.org>
Wed, 16 Oct 2024 01:12:33 +0000 (18:12 -0700)
commitd96016a764f6aa5c7528c3d3f9cb472ef7266951
treec7dc07ed19111059d1bb421a04d520df3aa67645
parent56440d7ec28d60f8da3bfa09062b3368ff9b16db
udp: Compute L4 checksum as usual when not segmenting the skb

If:

  1) the user requested USO, but
  2) there is not enough payload for GSO to kick in, and
  3) the egress device doesn't offer checksum offload, then

we want to compute the L4 checksum in software early on.

In the case when we are not taking the GSO path, but it has been requested,
the software checksum fallback in skb_segment doesn't get a chance to
compute the full checksum, if the egress device can't do it. As a result we
end up sending UDP datagrams with only a partial checksum filled in, which
the peer will discard.

Fixes: 10154dbded6d ("udp: Allow GSO transmit from devices with no checksum offload")
Reported-by: Ivan Babrou <ivan@cloudflare.com>
Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com>
Acked-by: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20241011-uso-swcsum-fixup-v2-1-6e1ddc199af9@cloudflare.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv4/udp.c
net/ipv6/udp.c