Netdev List
 help / color / mirror / Atom feed
From: Richard Gobert <richardbgobert@gmail.com>
To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, dsahern@kernel.org,
	willemdebruijn.kernel@gmail.com, alexander.duyck@gmail.com,
	aleksander.lobakin@intel.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: Richard Gobert <richardbgobert@gmail.com>
Subject: [PATCH net v2 0/3] net: gro: add flush/flush_id checks and fix wrong offset in udp
Date: Fri, 19 Apr 2024 17:35:39 +0200	[thread overview]
Message-ID: <20240419153542.121087-1-richardbgobert@gmail.com> (raw)

This series fixes a bug in the complete phase of UDP in GRO, in which
socket lookup fails due to using network_header when parsing encapsulated
packets. The fix is to add network_offset and inner_network_offset to
napi_gro_cb and use these offsets for socket lookup.

In addition p->flush/flush_id should be checked in all UDP flows. The
same logic from tcp_gro_receive is applied for all the flows in
udp_gro_receive_segment. This prevents packets with mismatching network
headers (flush/flush_id turned on) from merging in UDP GRO.

The original series includes a change to vxlan test which adds the local
parameter to prevent similar future bugs. I plan to submit it separately to
net-next.

This series is part of a previously submitted series to net-next:
https://lore.kernel.org/all/20240408141720.98832-1-richardbgobert@gmail.com/

v1 -> v2:
 - Use network_offsets instead of p_poff param as suggested by Willem
 - Check flush before postpull, and for all UDP GRO flows (previously
   reviewed by Willem, and was changed since)
 - v1:
 https://lore.kernel.org/netdev/20240412152120.115067-1-richardbgobert@gmail.com/

Richard Gobert (3):
  net: gro: add {inner_}network_offset to napi_gro_cb
  net: gro: fix udp bad offset in socket lookup
  net: gro: add flush check in udp_gro_receive_segment

 drivers/net/geneve.c           |  1 +
 drivers/net/vxlan/vxlan_core.c |  1 +
 include/net/gro.h              | 18 ++++++++++++++++--
 net/8021q/vlan_core.c          |  2 ++
 net/core/gro.c                 |  1 +
 net/ethernet/eth.c             |  1 +
 net/ipv4/af_inet.c             |  5 +----
 net/ipv4/gre_offload.c         |  1 +
 net/ipv4/udp.c                 |  3 ++-
 net/ipv4/udp_offload.c         | 15 +++++++++++++--
 net/ipv6/ip6_offload.c         |  8 ++++----
 net/ipv6/udp.c                 |  3 ++-
 net/ipv6/udp_offload.c         |  3 ++-
 13 files changed, 47 insertions(+), 15 deletions(-)

-- 
2.36.1


             reply	other threads:[~2024-04-19 15:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-19 15:35 Richard Gobert [this message]
2024-04-19 15:35 ` [PATCH net v2 1/3] net: gro: add {inner_}network_offset to napi_gro_cb Richard Gobert
2024-04-19 18:51   ` Willem de Bruijn
2024-04-22  8:32     ` Richard Gobert
2024-04-22 16:56       ` Willem de Bruijn
2024-04-23  9:27         ` Richard Gobert
2024-04-23 13:55           ` Willem de Bruijn
2024-04-19 15:35 ` [PATCH net v2 2/3] net: gro: fix udp bad offset in socket lookup Richard Gobert
2024-04-19 15:35 ` [PATCH net v2 3/3] net: gro: add flush check in udp_gro_receive_segment Richard Gobert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240419153542.121087-1-richardbgobert@gmail.com \
    --to=richardbgobert@gmail.com \
    --cc=aleksander.lobakin@intel.com \
    --cc=alexander.duyck@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=willemdebruijn.kernel@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox