acl-plugin: tuplemerge: avoid batch-resize of the applied entries vector - VPP-1352 42/15142/2
authorAndrew Yourtchenko <ayourtch@gmail.com>
Thu, 4 Oct 2018 13:11:01 +0000 (15:11 +0200)
committerDave Barach <openvpp@barachs.net>
Thu, 4 Oct 2018 17:53:44 +0000 (17:53 +0000)
commit6f40a8a4c5792c5c5e5c77366e98b1f10370d685
tree8c7382d588c9b8a801537b132bcbe9832d50fcef
parenta44d6b133bfb7ee0fb11d6ae8d9f0f00e57f242c
acl-plugin: tuplemerge: avoid batch-resize of the applied entries vector - VPP-1352

If the number of rules within a given partition exceeds the limit,
the split_partition() might get called, in which we calculate
the relaxed mask, create a new partition with that mask and
attempt to reallocate some entries from the overcrowded partition.

The non-TM code was pre-expanding the vector with rules by
the number of rules in the new ACL being applied - which
caused the split_partition() to iterate over the rules
filled with zeroes. Most of the time it is benign, but
if a newly created relaxed partition is such that these
entries can be "relocated", then the code attempts to
do so, which does not end well.

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