acl-plugin: VPP-1400: VPP may crash when performing ACL modifications on applied... 51/14551/2
authorAndrew Yourtchenko <ayourtch@gmail.com>
Wed, 29 Aug 2018 15:23:03 +0000 (17:23 +0200)
committerDamjan Marion <dmarion@me.com>
Mon, 3 Sep 2018 16:08:02 +0000 (16:08 +0000)
commit1edc406da3d4f6e63de2f278360b5753f55c00df
treebd33d374b1367e36ae39ae5e202eceddbed53c29
parentd039281e11cfc4580fe140e72390c1c48688c722
acl-plugin: VPP-1400: VPP may crash when performing ACL modifications on applied ACLs

The partition_split() did not increment the refcount when using a mask type index,
thus subsequent modifications potentially resulted in double frees and in the best case
immediate crash, in the worst case delayed crash in another place.

Introduce the lock_mask_type_index() and call it, move the mask type index
related functions closer to the top of the file.

Make the assignment of the new mask type indices
for the tuplemerge case to use the assign_mask_type_index().

Keep some debugs in case we need to investigate this further at some point.

Change-Id: Iae370f5cd92e1fe1442480db34656a8a3442dbc0
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
src/plugins/acl/acl.h
src/plugins/acl/hash_lookup.c