public inbox for linux-kernel@vger.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, wenxu <wenxu@ucloud.cn>,
	Cong Wang <xiyou.wangcong@gmail.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: [PATCH 5.7 70/79] net/sched: act_ct: fix miss set mru for ovs after defrag in act_ct
Date: Mon, 10 Aug 2020 17:21:29 +0200	[thread overview]
Message-ID: <20200810151815.687796652@linuxfoundation.org> (raw)
In-Reply-To: <20200810151812.114485777@linuxfoundation.org>

From: wenxu <wenxu@ucloud.cn>

[ Upstream commit 038ebb1a713d114d54dbf14868a73181c0c92758 ]

When openvswitch conntrack offload with act_ct action. Fragment packets
defrag in the ingress tc act_ct action and miss the next chain. Then the
packet pass to the openvswitch datapath without the mru. The over
mtu packet will be dropped in output action in openvswitch for over mtu.

"kernel: net2: dropped over-mtu packet: 1528 > 1500"

This patch add mru in the tc_skb_ext for adefrag and miss next chain
situation. And also add mru in the qdisc_skb_cb. The act_ct set the mru
to the qdisc_skb_cb when the packet defrag. And When the chain miss,
The mru is set to tc_skb_ext which can be got by ovs datapath.

Fixes: b57dc7c13ea9 ("net/sched: Introduce action ct")
Signed-off-by: wenxu <wenxu@ucloud.cn>
Reviewed-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 include/linux/skbuff.h    |    1 +
 include/net/sch_generic.h |    3 ++-
 net/openvswitch/flow.c    |    1 +
 net/sched/act_ct.c        |    8 ++++++--
 net/sched/cls_api.c       |    1 +
 5 files changed, 11 insertions(+), 3 deletions(-)

--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -283,6 +283,7 @@ struct nf_bridge_info {
  */
 struct tc_skb_ext {
 	__u32 chain;
+	__u16 mru;
 };
 #endif
 
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -380,6 +380,7 @@ struct qdisc_skb_cb {
 	};
 #define QDISC_CB_PRIV_LEN 20
 	unsigned char		data[QDISC_CB_PRIV_LEN];
+	u16			mru;
 };
 
 typedef void tcf_chain_head_change_t(struct tcf_proto *tp_head, void *priv);
@@ -459,7 +460,7 @@ static inline void qdisc_cb_private_vali
 {
 	struct qdisc_skb_cb *qcb;
 
-	BUILD_BUG_ON(sizeof(skb->cb) < offsetof(struct qdisc_skb_cb, data) + sz);
+	BUILD_BUG_ON(sizeof(skb->cb) < sizeof(*qcb));
 	BUILD_BUG_ON(sizeof(qcb->data) < sz);
 }
 
--- a/net/openvswitch/flow.c
+++ b/net/openvswitch/flow.c
@@ -890,6 +890,7 @@ int ovs_flow_key_extract(const struct ip
 	if (static_branch_unlikely(&tc_recirc_sharing_support)) {
 		tc_ext = skb_ext_find(skb, TC_SKB_EXT);
 		key->recirc_id = tc_ext ? tc_ext->chain : 0;
+		OVS_CB(skb)->mru = tc_ext ? tc_ext->mru : 0;
 	} else {
 		key->recirc_id = 0;
 	}
--- a/net/sched/act_ct.c
+++ b/net/sched/act_ct.c
@@ -704,8 +704,10 @@ static int tcf_ct_handle_fragments(struc
 		if (err && err != -EINPROGRESS)
 			goto out_free;
 
-		if (!err)
+		if (!err) {
 			*defrag = true;
+			cb.mru = IPCB(skb)->frag_max_size;
+		}
 	} else { /* NFPROTO_IPV6 */
 #if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6)
 		enum ip6_defrag_users user = IP6_DEFRAG_CONNTRACK_IN + zone;
@@ -715,8 +717,10 @@ static int tcf_ct_handle_fragments(struc
 		if (err && err != -EINPROGRESS)
 			goto out_free;
 
-		if (!err)
+		if (!err) {
 			*defrag = true;
+			cb.mru = IP6CB(skb)->frag_max_size;
+		}
 #else
 		err = -EOPNOTSUPP;
 		goto out_free;
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -1679,6 +1679,7 @@ int tcf_classify_ingress(struct sk_buff
 		if (WARN_ON_ONCE(!ext))
 			return TC_ACT_SHOT;
 		ext->chain = last_executed_chain;
+		ext->mru = qdisc_skb_cb(skb)->mru;
 	}
 
 	return ret;



  parent reply	other threads:[~2020-08-10 15:38 UTC|newest]

Thread overview: 83+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-10 15:20 [PATCH 5.7 00/79] 5.7.15-rc1 review Greg Kroah-Hartman
2020-08-10 15:20 ` [PATCH 5.7 01/79] scsi: ufs: Fix and simplify setup_xfer_req variant operation Greg Kroah-Hartman
2020-08-10 15:20 ` [PATCH 5.7 02/79] USB: serial: qcserial: add EM7305 QDL product ID Greg Kroah-Hartman
2020-08-10 15:20 ` [PATCH 5.7 03/79] USB: iowarrior: fix up report size handling for some devices Greg Kroah-Hartman
2020-08-10 15:20 ` [PATCH 5.7 04/79] usb: xhci: define IDs for various ASMedia host controllers Greg Kroah-Hartman
2020-08-10 15:20 ` [PATCH 5.7 05/79] usb: xhci: Fix ASMedia ASM1142 DMA addressing Greg Kroah-Hartman
2020-08-10 15:20 ` [PATCH 5.7 06/79] Revert "ALSA: hda: call runtime_allow() for all hda controllers" Greg Kroah-Hartman
2020-08-10 15:20 ` [PATCH 5.7 07/79] ALSA: hda/realtek: Add alc269/alc662 pin-tables for Loongson-3 laptops Greg Kroah-Hartman
2020-08-10 15:20 ` [PATCH 5.7 08/79] ALSA: hda/ca0132 - Add new quirk ID for Recon3D Greg Kroah-Hartman
2020-08-10 15:20 ` [PATCH 5.7 09/79] ALSA: hda/ca0132 - Fix ZxR Headphone gain control get value Greg Kroah-Hartman
2020-08-10 15:20 ` [PATCH 5.7 10/79] ALSA: hda/ca0132 - Fix AE-5 microphone selection commands Greg Kroah-Hartman
2020-08-10 15:20 ` [PATCH 5.7 11/79] ALSA: seq: oss: Serialize ioctls Greg Kroah-Hartman
2020-08-10 15:20 ` [PATCH 5.7 12/79] staging: android: ashmem: Fix lockdep warning for write operation Greg Kroah-Hartman
2020-08-10 15:20 ` [PATCH 5.7 13/79] staging: rtl8712: handle firmware load failure Greg Kroah-Hartman
2020-08-10 15:20 ` [PATCH 5.7 14/79] Staging: rtl8188eu: rtw_mlme: Fix uninitialized variable authmode Greg Kroah-Hartman
2020-08-10 15:20 ` [PATCH 5.7 15/79] Bluetooth: Fix slab-out-of-bounds read in hci_extended_inquiry_result_evt() Greg Kroah-Hartman
2020-08-10 15:20 ` [PATCH 5.7 16/79] Bluetooth: Prevent out-of-bounds read in hci_inquiry_result_evt() Greg Kroah-Hartman
2020-08-10 15:20 ` [PATCH 5.7 17/79] Bluetooth: Prevent out-of-bounds read in hci_inquiry_result_with_rssi_evt() Greg Kroah-Hartman
2020-08-10 15:20 ` [PATCH 5.7 18/79] omapfb: dss: Fix max fclk divider for omap36xx Greg Kroah-Hartman
2020-08-10 15:20 ` [PATCH 5.7 19/79] binder: Prevent context manager from incrementing ref 0 Greg Kroah-Hartman
2020-08-10 15:20 ` [PATCH 5.7 20/79] Smack: fix use-after-free in smk_write_relabel_self() Greg Kroah-Hartman
2020-08-10 15:20 ` [PATCH 5.7 21/79] scripts: add dummy report mode to add_namespace.cocci Greg Kroah-Hartman
2020-08-10 15:20 ` [PATCH 5.7 22/79] lkdtm/heap: Avoid edge and middle of slabs Greg Kroah-Hartman
2020-08-10 15:20 ` [PATCH 5.7 23/79] vgacon: Fix for missing check in scrollback handling Greg Kroah-Hartman
2020-08-10 15:20 ` [PATCH 5.7 24/79] mtd: properly check all write ioctls for permissions Greg Kroah-Hartman
2020-08-10 15:20 ` [PATCH 5.7 25/79] leds: wm831x-status: fix use-after-free on unbind Greg Kroah-Hartman
2020-08-10 15:20 ` [PATCH 5.7 26/79] leds: lm36274: " Greg Kroah-Hartman
2020-08-10 15:20 ` [PATCH 5.7 27/79] leds: da903x: " Greg Kroah-Hartman
2020-08-10 15:20 ` [PATCH 5.7 28/79] leds: lm3533: " Greg Kroah-Hartman
2020-08-10 15:20 ` [PATCH 5.7 29/79] leds: 88pm860x: " Greg Kroah-Hartman
2020-08-10 15:20 ` [PATCH 5.7 30/79] gpio: max77620: Fix missing release of interrupt Greg Kroah-Hartman
2020-08-10 15:20 ` [PATCH 5.7 31/79] bpf: Fix NULL pointer dereference in __btf_resolve_helper_id() Greg Kroah-Hartman
2020-08-10 15:20 ` [PATCH 5.7 32/79] net/9p: validate fds in p9_fd_open Greg Kroah-Hartman
2020-08-10 15:20 ` [PATCH 5.7 33/79] drm/nouveau/kms/tu102: wait for core update to complete when assigning windows Greg Kroah-Hartman
2020-08-10 15:20 ` [PATCH 5.7 34/79] drm/nouveau/fbcon: fix module unload when fbcon init has failed for some reason Greg Kroah-Hartman
2020-08-10 15:20 ` [PATCH 5.7 35/79] drm/nouveau/fbcon: zero-initialise the mode_cmd2 structure Greg Kroah-Hartman
2020-08-10 15:20 ` [PATCH 5.7 36/79] io_uring: fix lockup in io_fail_links() Greg Kroah-Hartman
2020-08-10 15:20 ` [PATCH 5.7 37/79] nvme-pci: prevent SK hynix PC400 from using Write Zeroes command Greg Kroah-Hartman
2020-08-10 15:20 ` [PATCH 5.7 38/79] drm/bridge/adv7511: set the bridge type properly Greg Kroah-Hartman
2020-08-10 15:20 ` [PATCH 5.7 39/79] drm/panel: Fix auo, kd101n80-45na horizontal noise on edges of panel Greg Kroah-Hartman
2020-08-10 15:20 ` [PATCH 5.7 40/79] drm/drm_fb_helper: fix fbdev with sparc64 Greg Kroah-Hartman
2020-08-10 15:21 ` [PATCH 5.7 41/79] net: mscc: ocelot: fix hardware timestamp dequeue logic Greg Kroah-Hartman
2020-08-10 15:21 ` [PATCH 5.7 42/79] i2c: slave: improve sanity check when registering Greg Kroah-Hartman
2020-08-10 15:21 ` [PATCH 5.7 43/79] i2c: slave: add sanity check when unregistering Greg Kroah-Hartman
2020-08-10 15:21 ` [PATCH 5.7 44/79] usb: hso: check for return value in hso_serial_common_create() Greg Kroah-Hartman
2020-08-10 15:21 ` [PATCH 5.7 45/79] net: ethernet: mtk_eth_soc: Always call mtk_gmac0_rgmii_adjust() for mt7623 Greg Kroah-Hartman
2020-08-10 15:21 ` [PATCH 5.7 46/79] ALSA: hda: fix NULL pointer dereference during suspend Greg Kroah-Hartman
2020-08-10 15:21 ` [PATCH 5.7 47/79] firmware: Fix a reference count leak Greg Kroah-Hartman
2020-08-10 15:21 ` [PATCH 5.7 48/79] cfg80211: check vendor command doit pointer before use Greg Kroah-Hartman
2020-08-10 15:21 ` [PATCH 5.7 49/79] igb: reinit_locked() should be called with rtnl_lock Greg Kroah-Hartman
2020-08-10 15:21 ` [PATCH 5.7 50/79] atm: fix atm_dev refcnt leaks in atmtcp_remove_persistent Greg Kroah-Hartman
2020-08-10 15:21 ` [PATCH 5.7 51/79] tools lib traceevent: Fix memory leak in process_dynamic_array_len Greg Kroah-Hartman
2020-08-10 15:21 ` [PATCH 5.7 52/79] xattr: break delegations in {set,remove}xattr Greg Kroah-Hartman
2020-08-10 15:21 ` [PATCH 5.7 53/79] Revert "powerpc/kasan: Fix shadow pages allocation failure" Greg Kroah-Hartman
2020-08-10 15:21 ` [PATCH 5.7 54/79] PCI: tegra: Revert tegra124 raw_violation_fixup Greg Kroah-Hartman
2020-08-10 15:21 ` [PATCH 5.7 55/79] ipv4: Silence suspicious RCU usage warning Greg Kroah-Hartman
2020-08-10 15:21 ` [PATCH 5.7 56/79] ipv6: fix memory leaks on IPV6_ADDRFORM path Greg Kroah-Hartman
2020-08-10 15:21 ` [PATCH 5.7 57/79] ipv6: Fix nexthop refcnt leak when creating ipv6 route info Greg Kroah-Hartman
2020-08-10 15:21 ` [PATCH 5.7 58/79] rxrpc: Fix race between recvmsg and sendmsg on immediate call failure Greg Kroah-Hartman
2020-08-10 15:21 ` [PATCH 5.7 59/79] vxlan: Ensure FDB dump is performed under RCU Greg Kroah-Hartman
2020-08-10 15:21 ` [PATCH 5.7 60/79] net: lan78xx: replace bogus endpoint lookup Greg Kroah-Hartman
2020-08-10 15:21 ` [PATCH 5.7 61/79] rhashtable: Restore RCU marking on rhash_lock_head Greg Kroah-Hartman
2020-08-10 15:21 ` [PATCH 5.7 62/79] devlink: ignore -EOPNOTSUPP errors on dumpit Greg Kroah-Hartman
2020-08-10 15:21 ` [PATCH 5.7 63/79] appletalk: Fix atalk_proc_init() return path Greg Kroah-Hartman
2020-08-10 15:21 ` [PATCH 5.7 64/79] dpaa2-eth: Fix passing zero to PTR_ERR warning Greg Kroah-Hartman
2020-08-10 15:21 ` [PATCH 5.7 65/79] hv_netvsc: do not use VF device if link is down Greg Kroah-Hartman
2020-08-10 15:21 ` [PATCH 5.7 66/79] net: bridge: clear bridges private skb space on xmit Greg Kroah-Hartman
2020-08-10 15:21 ` [PATCH 5.7 67/79] net: gre: recompute gre csum for sctp over gre tunnels Greg Kroah-Hartman
2020-08-10 15:21 ` [PATCH 5.7 68/79] net: macb: Properly handle phylink on at91sam9x Greg Kroah-Hartman
2020-08-10 15:21 ` [PATCH 5.7 69/79] net: mvpp2: fix memory leak in mvpp2_rx Greg Kroah-Hartman
2020-08-10 15:21 ` Greg Kroah-Hartman [this message]
2020-08-10 15:21 ` [PATCH 5.7 71/79] net: thunderx: use spin_lock_bh in nicvf_set_rx_mode_task() Greg Kroah-Hartman
2020-08-10 15:21 ` [PATCH 5.7 72/79] openvswitch: Prevent kernel-infoleak in ovs_ct_put_key() Greg Kroah-Hartman
2020-08-10 15:21 ` [PATCH 5.7 73/79] Revert "vxlan: fix tos value before xmit" Greg Kroah-Hartman
2020-08-10 15:21 ` [PATCH 5.7 74/79] selftests/net: relax cpu affinity requirement in msg_zerocopy test Greg Kroah-Hartman
2020-08-10 15:21 ` [PATCH 5.7 75/79] tcp: apply a floor of 1 for RTT samples from TCP timestamps Greg Kroah-Hartman
2020-08-10 15:21 ` [PATCH 5.7 76/79] mptcp: be careful on subflow creation Greg Kroah-Hartman
2020-08-10 15:21 ` [PATCH 5.7 77/79] mptcp: fix bogus sendmsg() return code under pressure Greg Kroah-Hartman
2020-08-10 15:21 ` [PATCH 5.7 78/79] ima: move APPRAISE_BOOTPARAM dependency on ARCH_POLICY to runtime Greg Kroah-Hartman
2020-08-10 15:21 ` [PATCH 5.7 79/79] arm64: kaslr: Use standard early random function Greg Kroah-Hartman
2020-08-10 23:07 ` [PATCH 5.7 00/79] 5.7.15-rc1 review Shuah Khan
2020-08-11  7:10 ` Naresh Kamboju
2020-08-11 14:23 ` Guenter Roeck

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=20200810151815.687796652@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=wenxu@ucloud.cn \
    --cc=xiyou.wangcong@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