Re: Linux 4.4.34

From: Eric Dumazet
Date: Tue Nov 22 2016 - 12:46:59 EST


.
>
> I was wondering if we shouldn't just cap all cases?
>
> It seems like this could potentially return a value greater than skb-
>>len in the "good" case since things like IP header length isn't
> validated other then making sure it meets the minimum value, and if
> there isn't a recognized L4 header after that we could return that as a
> final value.
>

I honestly think you are looking at the wrong causes.

This is an aliasing problem.
Tom code is hard to read and understand.

Andre, could you try :

diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
index 69e4463a4b1b..b045980faaea 100644
--- a/net/core/flow_dissector.c
+++ b/net/core/flow_dissector.c
@@ -157,6 +157,7 @@ bool __skb_flow_dissect(const struct sk_buff *skb,
memcpy(key_eth_addrs, &eth->h_dest, sizeof(*key_eth_addrs));
}

+ barrier();
again:
switch (proto) {
case htons(ETH_P_IP): {