net/mlx5: fix crash on GRE flow rule parsing
authorSuanming Mou <suanmingm@mellanox.com>
Tue, 26 Nov 2019 14:08:35 +0000 (16:08 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 26 Nov 2019 17:22:27 +0000 (18:22 +0100)
When set the GRE item, GRE key should follow after GRE header, or the
header gre_item pointer used by the key will be invalid.

Currently in the mlx5_flow_validate_item_gre_key() function, the header
gre_item pointer is access before checking if the key is after the
header or not. Once the key item is before the header, invalid gre_item
pointer access happens.

Move the gre_item pointer access after the GRE header check to avoid the
crash issue.

Fixes: a7a0365565a4 ("net/mlx5: match GRE key and present bits")
Cc: stable@dpdk.org
Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>

No differences found