summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
author배석진 <soukjin.bae@samsung.com>2018-11-09 16:53:06 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-11-23 08:20:34 +0100
commita09bd930e90a5c13a9f7367da76af1fe0ee1f8ca (patch)
tree6f46fb5695dcfdf304a2bb4b4aa3e0a7c7454136 /net
parent7a4dc3f8399780455a16a167068a03f317e1204d (diff)
downloadlinux-stable-a09bd930e90a5c13a9f7367da76af1fe0ee1f8ca.tar.gz
linux-stable-a09bd930e90a5c13a9f7367da76af1fe0ee1f8ca.tar.bz2
linux-stable-a09bd930e90a5c13a9f7367da76af1fe0ee1f8ca.zip
flow_dissector: do not dissect l4 ports for fragments
[ Upstream commit 62230715fd2453b3ba948c9d83cfb3ada9169169 ] Only first fragment has the sport/dport information, not the following ones. If we want consistent hash for all fragments, we need to ignore ports even for first fragment. This bug is visible for IPv6 traffic, if incoming fragments do not have a flow label, since skb_get_hash() will give different results for first fragment and following ones. It is also visible if any routing rule wants dissection and sport or dport. See commit 5e5d6fed3741 ("ipv6: route: dissect flow in input path if fib rules need it") for details. [edumazet] rewrote the changelog completely. Fixes: 06635a35d13d ("flow_dissect: use programable dissector in skb_flow_dissect and friends") Signed-off-by: 배석진 <soukjin.bae@samsung.com> Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net')
-rw-r--r--net/core/flow_dissector.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
index 862d63ec56e4..ab7c50026cae 100644
--- a/net/core/flow_dissector.c
+++ b/net/core/flow_dissector.c
@@ -538,8 +538,8 @@ ip_proto_again:
break;
}
- if (dissector_uses_key(flow_dissector,
- FLOW_DISSECTOR_KEY_PORTS)) {
+ if (dissector_uses_key(flow_dissector, FLOW_DISSECTOR_KEY_PORTS) &&
+ !(key_control->flags & FLOW_DIS_IS_FRAGMENT)) {
key_ports = skb_flow_dissector_target(flow_dissector,
FLOW_DISSECTOR_KEY_PORTS,
target_container);