All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Rosemarie ORiorden <roriorden@redhat.com>,
	Eelco Chaudron <echaudro@redhat.com>,
	Paolo Abeni <pabeni@redhat.com>
Subject: [PATCH 5.4 07/60] net: openvswitch: fix parsing of nw_proto for IPv6 fragments
Date: Mon, 27 Jun 2022 13:21:18 +0200	[thread overview]
Message-ID: <20220627111927.866949565@linuxfoundation.org> (raw)
In-Reply-To: <20220627111927.641837068@linuxfoundation.org>

From: Rosemarie O'Riorden <roriorden@redhat.com>

commit 12378a5a75e33f34f8586706eb61cca9e6d4690c upstream.

When a packet enters the OVS datapath and does not match any existing
flows installed in the kernel flow cache, the packet will be sent to
userspace to be parsed, and a new flow will be created. The kernel and
OVS rely on each other to parse packet fields in the same way so that
packets will be handled properly.

As per the design document linked below, OVS expects all later IPv6
fragments to have nw_proto=44 in the flow key, so they can be correctly
matched on OpenFlow rules. OpenFlow controllers create pipelines based
on this design.

This behavior was changed by the commit in the Fixes tag so that
nw_proto equals the next_header field of the last extension header.
However, there is no counterpart for this change in OVS userspace,
meaning that this field is parsed differently between OVS and the
kernel. This is a problem because OVS creates actions based on what is
parsed in userspace, but the kernel-provided flow key is used as a match
criteria, as described in Documentation/networking/openvswitch.rst. This
leads to issues such as packets incorrectly matching on a flow and thus
the wrong list of actions being applied to the packet. Such changes in
packet parsing cannot be implemented without breaking the userspace.

The offending commit is partially reverted to restore the expected
behavior.

The change technically made sense and there is a good reason that it was
implemented, but it does not comply with the original design of OVS.
If in the future someone wants to implement such a change, then it must
be user-configurable and disabled by default to preserve backwards
compatibility with existing OVS versions.

Cc: stable@vger.kernel.org
Fixes: fa642f08839b ("openvswitch: Derive IP protocol number for IPv6 later frags")
Link: https://docs.openvswitch.org/en/latest/topics/design/#fragments
Signed-off-by: Rosemarie O'Riorden <roriorden@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Link: https://lore.kernel.org/r/20220621204845.9721-1-roriorden@redhat.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 net/openvswitch/flow.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/net/openvswitch/flow.c
+++ b/net/openvswitch/flow.c
@@ -265,7 +265,7 @@ static int parse_ipv6hdr(struct sk_buff
 	if (flags & IP6_FH_F_FRAG) {
 		if (frag_off) {
 			key->ip.frag = OVS_FRAG_TYPE_LATER;
-			key->ip.proto = nexthdr;
+			key->ip.proto = NEXTHDR_FRAGMENT;
 			return 0;
 		}
 		key->ip.frag = OVS_FRAG_TYPE_FIRST;



  parent reply	other threads:[~2022-06-27 11:34 UTC|newest]

Thread overview: 76+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-27 11:21 [PATCH 5.4 00/60] 5.4.202-rc1 review Greg Kroah-Hartman
2022-06-27 11:21 ` [PATCH 5.4 01/60] vt: drop old FONT ioctls Greg Kroah-Hartman
2022-06-27 11:21 ` [PATCH 5.4 02/60] random: schedule mix_interrupt_randomness() less often Greg Kroah-Hartman
2022-06-27 11:21 ` [PATCH 5.4 03/60] ALSA: hda/via: Fix missing beep setup Greg Kroah-Hartman
2022-06-27 11:21 ` [PATCH 5.4 04/60] ALSA: hda/conexant: " Greg Kroah-Hartman
2022-06-27 11:21 ` [PATCH 5.4 05/60] ALSA: hda/realtek - ALC897 headset MIC no sound Greg Kroah-Hartman
2022-06-27 11:21 ` [PATCH 5.4 06/60] ALSA: hda/realtek: Add quirk for Clevo PD70PNT Greg Kroah-Hartman
2022-06-27 11:21 ` Greg Kroah-Hartman [this message]
2022-06-27 11:21 ` [PATCH 5.4 08/60] mmc: sdhci-pci-o2micro: Fix card detect by dealing with debouncing Greg Kroah-Hartman
2022-06-27 11:21 ` [PATCH 5.4 09/60] mtd: rawnand: gpmi: Fix setting busy timeout setting Greg Kroah-Hartman
2022-06-27 11:21 ` [PATCH 5.4 10/60] ata: libata: add qc->flags in ata_qc_complete_template tracepoint Greg Kroah-Hartman
2022-06-27 11:21 ` [PATCH 5.4 11/60] dm era: commit metadata in postsuspend after worker stops Greg Kroah-Hartman
2022-06-27 11:21 ` [PATCH 5.4 12/60] dm mirror log: clear log bits up to BITS_PER_LONG boundary Greg Kroah-Hartman
2022-06-27 11:21 ` [PATCH 5.4 13/60] random: quiet urandom warning ratelimit suppression message Greg Kroah-Hartman
2022-06-27 11:21 ` [PATCH 5.4 14/60] USB: serial: option: add Telit LE910Cx 0x1250 composition Greg Kroah-Hartman
2022-06-27 11:21 ` [PATCH 5.4 15/60] USB: serial: option: add Quectel EM05-G modem Greg Kroah-Hartman
2022-06-27 11:21 ` [PATCH 5.4 16/60] USB: serial: option: add Quectel RM500K module support Greg Kroah-Hartman
2022-06-27 11:21 ` [PATCH 5.4 17/60] bpf: Fix request_sock leak in sk lookup helpers Greg Kroah-Hartman
2022-06-27 11:21 ` [PATCH 5.4 18/60] phy: aquantia: Fix AN when higher speeds than 1G are not advertised Greg Kroah-Hartman
2022-06-27 11:21 ` [PATCH 5.4 19/60] bonding: ARP monitor spams NETDEV_NOTIFY_PEERS notifiers Greg Kroah-Hartman
2022-06-27 11:21 ` [PATCH 5.4 20/60] net/sched: sch_netem: Fix arithmetic in netem_dump() for 32-bit platforms Greg Kroah-Hartman
2022-06-27 11:21 ` [PATCH 5.4 21/60] drm/msm/mdp4: Fix refcount leak in mdp4_modeset_init_intf Greg Kroah-Hartman
2022-06-27 11:21 ` [PATCH 5.4 22/60] erspan: do not assume transport header is always set Greg Kroah-Hartman
2022-06-27 11:21 ` [PATCH 5.4 23/60] net/tls: fix tls_sk_proto_close executed repeatedly Greg Kroah-Hartman
2022-06-27 11:21 ` [PATCH 5.4 24/60] udmabuf: add back sanity check Greg Kroah-Hartman
2022-06-27 11:21 ` [PATCH 5.4 25/60] x86/xen: Remove undefined behavior in setup_features() Greg Kroah-Hartman
2022-06-27 11:21 ` [PATCH 5.4 26/60] MIPS: Remove repetitive increase irq_err_count Greg Kroah-Hartman
2022-06-27 11:21 ` [PATCH 5.4 27/60] afs: Fix dynamic root getattr Greg Kroah-Hartman
2022-06-27 11:21 ` [PATCH 5.4 28/60] ice: ethtool: advertise 1000M speeds properly Greg Kroah-Hartman
2022-06-27 11:21 ` [PATCH 5.4 29/60] regmap-irq: Fix a bug in regmap_irq_enable() for type_in_mask chips Greg Kroah-Hartman
2022-06-27 11:21 ` [PATCH 5.4 30/60] igb: Make DMA faster when CPU is active on the PCIe link Greg Kroah-Hartman
2022-06-27 11:21 ` [PATCH 5.4 31/60] virtio_net: fix xdp_rxq_info bug after suspend/resume Greg Kroah-Hartman
2022-06-27 11:21 ` [PATCH 5.4 32/60] Revert "net/tls: fix tls_sk_proto_close executed repeatedly" Greg Kroah-Hartman
2022-06-27 11:21 ` [PATCH 5.4 33/60] gpio: winbond: Fix error code in winbond_gpio_get() Greg Kroah-Hartman
2022-06-27 11:21 ` [PATCH 5.4 34/60] s390/cpumf: Handle events cycles and instructions identical Greg Kroah-Hartman
2022-06-27 11:21 ` [PATCH 5.4 35/60] iio: adc: vf610: fix conversion mode sysfs node name Greg Kroah-Hartman
2022-06-27 11:21 ` [PATCH 5.4 36/60] xhci: turn off port power in shutdown Greg Kroah-Hartman
2022-06-27 11:21 ` [PATCH 5.4 37/60] usb: chipidea: udc: check request status before setting device address Greg Kroah-Hartman
2022-06-27 11:21 ` [PATCH 5.4 38/60] iio:chemical:ccs811: rearrange iio trigger get and register Greg Kroah-Hartman
2022-06-27 11:21 ` [PATCH 5.4 39/60] iio:accel:bma180: " Greg Kroah-Hartman
2022-06-27 11:21 ` [PATCH 5.4 40/60] iio:accel:mxc4005: " Greg Kroah-Hartman
2022-06-27 11:21 ` [PATCH 5.4 41/60] iio: accel: mma8452: ignore the return value of reset operation Greg Kroah-Hartman
2022-06-27 11:21 ` [PATCH 5.4 42/60] iio: gyro: mpu3050: Fix the error handling in mpu3050_power_up() Greg Kroah-Hartman
2022-06-27 11:21 ` [PATCH 5.4 43/60] iio: trigger: sysfs: fix use-after-free on remove Greg Kroah-Hartman
2022-06-27 11:21 ` [PATCH 5.4 44/60] iio: adc: stm32: fix maximum clock rate for stm32mp15x Greg Kroah-Hartman
2022-06-27 11:21 ` [PATCH 5.4 45/60] iio: adc: axp288: Override TS pin bias current for some models Greg Kroah-Hartman
2022-06-27 11:21 ` [PATCH 5.4 46/60] xtensa: xtfpga: Fix refcount leak bug in setup Greg Kroah-Hartman
2022-06-27 11:21 ` [PATCH 5.4 47/60] xtensa: Fix refcount leak bug in time.c Greg Kroah-Hartman
2022-06-27 11:21 ` [PATCH 5.4 48/60] parisc: Enable ARCH_HAS_STRICT_MODULE_RWX Greg Kroah-Hartman
2022-06-27 11:22 ` [PATCH 5.4 49/60] powerpc: Enable execve syscall exit tracepoint Greg Kroah-Hartman
2022-06-27 11:22 ` [PATCH 5.4 50/60] powerpc/rtas: Allow ibm,platform-dump RTAS call with null buffer address Greg Kroah-Hartman
2022-06-27 11:22 ` [PATCH 5.4 51/60] powerpc/powernv: wire up rng during setup_arch Greg Kroah-Hartman
2022-06-27 11:22 ` [PATCH 5.4 52/60] ARM: dts: imx6qdl: correct PU regulator ramp delay Greg Kroah-Hartman
2022-06-27 11:22 ` [PATCH 5.4 53/60] ARM: exynos: Fix refcount leak in exynos_map_pmu Greg Kroah-Hartman
2022-06-27 11:22 ` [PATCH 5.4 54/60] soc: bcm: brcmstb: pm: pm-arm: Fix refcount leak in brcmstb_pm_probe Greg Kroah-Hartman
2022-06-27 11:22 ` [PATCH 5.4 55/60] ARM: Fix refcount leak in axxia_boot_secondary Greg Kroah-Hartman
2022-06-27 11:22 ` [PATCH 5.4 56/60] ARM: cns3xxx: Fix refcount leak in cns3xxx_init Greg Kroah-Hartman
2022-06-27 11:22 ` [PATCH 5.4 57/60] modpost: fix section mismatch check for exported init/exit sections Greg Kroah-Hartman
2022-06-27 17:03   ` Florian Fainelli
2022-06-28 19:11     ` Nick Desaulniers
2022-06-28 20:32       ` Florian Fainelli
2022-06-29  5:38       ` Christoph Hellwig
2022-06-29 16:59         ` Nick Desaulniers
2022-06-29 16:59           ` Nick Desaulniers
2022-06-30  9:21           ` Greg Kroah-Hartman
2022-06-30  9:21             ` Greg Kroah-Hartman
2022-06-27 11:22 ` [PATCH 5.4 58/60] random: update comment from copy_to_user() -> copy_to_iter() Greg Kroah-Hartman
2022-06-27 11:22 ` [PATCH 5.4 59/60] kbuild: link vmlinux only once for CONFIG_TRIM_UNUSED_KSYMS (2nd attempt) Greg Kroah-Hartman
2022-06-27 11:22 ` [PATCH 5.4 60/60] powerpc/pseries: wire up rng during setup_arch() Greg Kroah-Hartman
2022-06-27 14:44 ` [PATCH 5.4 00/60] 5.4.202-rc1 review Jon Hunter
2022-06-27 16:27 ` Florian Fainelli
2022-06-27 19:08 ` Daniel Díaz
2022-06-27 21:58 ` Shuah Khan
2022-06-27 23:41 ` Guenter Roeck
2022-06-28 13:16 ` Sudip Mukherjee
2022-06-29  1:08 ` Samuel Zou

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=20220627111927.866949565@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=echaudro@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=roriorden@redhat.com \
    --cc=stable@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.