diff options
author | Nir Dotan <nird@mellanox.com> | 2018-08-03 15:57:42 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-08-03 12:28:01 -0700 |
commit | dda0a3a3fb92451d4a922e56365ee1f73c8a9586 (patch) | |
tree | aad071e4ac4d01331af1b247f99483c45c36121f /lib/test_kmod.c | |
parent | 3757b255bf20ae3c941abae7624ff215bfd9ef05 (diff) | |
download | linux-stable-dda0a3a3fb92451d4a922e56365ee1f73c8a9586.tar.gz linux-stable-dda0a3a3fb92451d4a922e56365ee1f73c8a9586.tar.bz2 linux-stable-dda0a3a3fb92451d4a922e56365ee1f73c8a9586.zip |
mlxsw: core_acl_flex_actions: Remove redundant resource destruction
Some ACL actions require the allocation of a separate resource
prior to applying the action itself. When facing an error condition
during the setup phase of the action, resource should be destroyed.
For such actions the destruction was done twice which is dangerous
and lead to a potential crash.
The destruction took place first upon error on action setup phase
and then as the rule was destroyed.
The following sequence generated a crash:
# tc qdisc add dev swp49 ingress
# tc filter add dev swp49 parent ffff: \
protocol ip chain 100 pref 10 \
flower skip_sw dst_ip 192.168.101.1 action drop
# tc filter add dev swp49 parent ffff: \
protocol ip pref 10 \
flower skip_sw dst_ip 192.168.101.1 action goto chain 100 \
action mirred egress mirror dev swp4
Therefore add mlxsw_afa_resource_del() as a complement of
mlxsw_afa_resource_add() to add symmetry to resource_list membership
handling. Call this from mlxsw_afa_fwd_entry_ref_destroy() to make the
_fwd_entry_ref_create() and _fwd_entry_ref_destroy() pair of calls a
NOP.
Fixes: 140ce421217e ("mlxsw: core: Convert fwd_entry_ref list to be generic per-block resource list")
Signed-off-by: Nir Dotan <nird@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'lib/test_kmod.c')
0 files changed, 0 insertions, 0 deletions