Jason Baron 8a9093c798 net: sched: correct flower port blocking
tc flower rules that are based on src or dst port blocking are sometimes
ineffective due to uninitialized stack data. __skb_flow_dissect() extracts
ports from the skb for tc flower to match against. However, the port
dissection is not done when when the FLOW_DIS_IS_FRAGMENT bit is set in
key_control->flags. All callers of __skb_flow_dissect(), zero-out the
key_control field except for fl_classify() as used by the flower
classifier. Thus, the FLOW_DIS_IS_FRAGMENT may be set on entry to
__skb_flow_dissect(), since key_control is allocated on the stack
and may not be initialized.

Since key_basic and key_control are present for all flow keys, let's
make sure they are initialized.

Fixes: 62230715fd24 ("flow_dissector: do not dissect l4 ports for fragments")
Co-developed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Jason Baron <jbaron@akamai.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-17 21:33:28 -08:00
..
2019-01-23 11:18:00 -08:00
2019-04-19 14:07:40 -07:00
2020-01-27 11:33:29 +01:00
2019-12-09 09:59:07 +01:00
2019-10-23 20:13:22 -07:00
2019-12-09 10:36:44 -08:00
2019-09-13 21:44:19 +02:00
2020-01-25 08:14:39 +01:00
2018-09-13 09:04:58 -07:00
2020-01-14 11:31:41 -08:00
2019-12-09 10:36:44 -08:00
2017-11-08 16:12:33 +09:00
2017-12-05 14:37:13 -05:00
2018-05-16 07:23:35 +02:00
2019-04-22 21:47:25 -07:00
2019-10-05 16:29:00 -07:00
2020-02-16 19:43:06 -08:00
2019-12-09 10:28:43 -08:00
2019-06-19 11:23:13 -04:00
2019-12-09 09:59:07 +01:00