net/i40e: fix out-of-bounds access
authorBeilei Xing <beilei.xing@intel.com>
Tue, 5 Jul 2016 06:10:05 +0000 (14:10 +0800)
committerBruce Richardson <bruce.richardson@intel.com>
Fri, 8 Jul 2016 20:50:59 +0000 (22:50 +0200)
commit73f9509e0e1e1c095f4dc6ef69871da834596969
tree8b69f848e722d3ea9fb13eaaa05fa4129ec10f5b
parentb282ea2ada5dc519266d4cb4630fdff2f8c593d3
net/i40e: fix out-of-bounds access

When calling i40e_flowtype_to_pctype in i40e_get_hash_filter_global_config
and i40e_set_hash_filter_global_config, function i40e_flowtype_to_pctype
will be possibly make an out-of-bounds access, because size of the array
is 15. So check the flow type is valid before calling
i40e_flowtype_to_pctype.
In the process fix other occurances of the same problem

Coverity issue: 37793, 37794
Fixes: 782c8c92f13f ("i40e: add hash configuration")
Fixes: f2b2e2354bbd ("i40e: split function for hash and flow director input")
Fixes: 98f055707685 ("i40e: configure input fields for RSS or flow director")

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
drivers/net/i40e/i40e_ethdev.c