netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] flow_dissector: Add IPv6 flow label to symmetric keys
@ 2020-08-04 15:56 Tom Herbert
  2020-08-04 23:12 ` David Miller
  2020-08-05  8:26 ` Willem de Bruijn
  0 siblings, 2 replies; 5+ messages in thread
From: Tom Herbert @ 2020-08-04 15:56 UTC (permalink / raw)
  To: davem, netdev; +Cc: Tom Herbert

The definition for symmetric keys does not include the flow label so
that when symmetric keys is used a non-zero IPv6 flow label is not
extracted. Symmetric keys are used in functions to compute the flow
hash for packets, and these functions also set "stop at flow label".
The upshot is that for IPv6 packets with a non-zero flow label, hashes
are only based on the address two tuple and there is no input entropy
from transport layer information. This patch fixes this bug.
---
 net/core/flow_dissector.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
index 29806eb765cf..d72e13d125fb 100644
--- a/net/core/flow_dissector.c
+++ b/net/core/flow_dissector.c
@@ -1765,6 +1765,10 @@ static const struct flow_dissector_key flow_keys_dissector_symmetric_keys[] = {
 		.key_id = FLOW_DISSECTOR_KEY_PORTS,
 		.offset = offsetof(struct flow_keys, ports),
 	},
+	{
+		.key_id = FLOW_DISSECTOR_KEY_FLOW_LABEL,
+		.offset = offsetof(struct flow_keys, tags),
+	},
 };
 
 static const struct flow_dissector_key flow_keys_basic_dissector_keys[] = {
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-08-17 19:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-04 15:56 [PATCH net-next] flow_dissector: Add IPv6 flow label to symmetric keys Tom Herbert
2020-08-04 23:12 ` David Miller
2020-08-05  8:26 ` Willem de Bruijn
2020-08-17 14:44   ` Tom Herbert
2020-08-17 15:35     ` Willem de Bruijn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).