[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1516675339-962-2-git-send-email-eswierk@skyportsystems.com>
Date: Mon, 22 Jan 2018 18:42:19 -0800
From: Ed Swierk <eswierk@...portsystems.com>
To: Pravin Shelar <pshelar@....org>, netdev@...r.kernel.org,
ovs-dev@...nvswitch.org
Cc: Ed Swierk <eswierk@...portsystems.com>
Subject: [PATCH v3 2/2] openvswitch: Remove padding from packet before L3+ conntrack processing
In the OVS conntrack receive path, ovs_ct_execute() pulls the skb to
the L3 header but does not trim it to the L3 length before calling
nf_conntrack_in(NF_INET_PRE_ROUTING). When nf_conntrack_proto_tcp
encounters a packet with lower-layer padding, nf_checksum() fails and
logs "nf_ct_tcp: bad TCP checksum". While extra zero bytes don't
affect the checksum, the length in the IP pseudoheader does. That
length is based on skb->len, and without trimming, it doesn't match
the length the sender used when computing the checksum.
In ovs_ct_execute(), call skb_network_trim() before any L3+ conntrack
processing.
Signed-off-by: Ed Swierk <eswierk@...portsystems.com>
---
net/openvswitch/conntrack.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/net/openvswitch/conntrack.c b/net/openvswitch/conntrack.c
index d558e88..1d24709 100644
--- a/net/openvswitch/conntrack.c
+++ b/net/openvswitch/conntrack.c
@@ -1111,6 +1111,10 @@ int ovs_ct_execute(struct net *net, struct sk_buff *skb,
nh_ofs = skb_network_offset(skb);
skb_pull_rcsum(skb, nh_ofs);
+ err = skb_network_trim(skb);
+ if (err)
+ return err;
+
if (key->ip.frag != OVS_FRAG_TYPE_NONE) {
err = handle_fragments(net, key, info->zone.id, skb);
if (err)
--
1.9.1
Powered by blists - more mailing lists