Thread (10 messages) 10 messages, 3 authors, 2015-05-13

Re: [PATCH v3 net-next 1/5] net: Get skb hash over flow_keys structure

From: David Miller <davem@davemloft.net>
Date: 2015-05-13 19:30:10

From: Tom Herbert <redacted>
Date: Tue, 12 May 2015 08:22:58 -0700
quoted hunk ↗ jump to hunk
@@ -15,6 +15,13 @@
  * All the members, except thoff, are in network byte order.
  */
 struct flow_keys {
+	u16	thoff;
+	u16	padding1;
+#define FLOW_KEYS_HASH_START_FIELD	n_proto
+	__be16	n_proto;
+	u8	ip_proto;
+	u8	padding;
+
This padding works if everyone consistently zero initializes the whole
key structure, but for whatever reason (performance, unintentional
oversight, etc.) not all paths do.

So, for example, inet_set_txhash() is going to have random crap in
keys.padding, so the hashes computed are not stable for a given flow
key tuple.

That's just the first code path I found with this issue, there are
probably several others.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help