From 7fad624b09f8d1256360222dc547519d8b40dd1c Mon Sep 17 00:00:00 2001 From: Andrew Yourtchenko Date: Thu, 9 Aug 2018 15:30:57 +0200 Subject: acl-plugin: fix failures in some of IPv4 test-debug testcases Commit 1c7bf5d41737984907e8bad1dc832eb6cb1d6288 added the poisoning of the newly freed memory in debug builds, exposing a logic error in mask assignment code - it passed a pointer to within a pool to a function which might potentially expand the pool. This resulted in a failure of the test in the debug version. Fix that by making a local copy of the value before passing a pointer to it. Change-Id: I73f3670672c3d86778aad0f944d052d0480cc593 Signed-off-by: Andrew Yourtchenko --- src/plugins/acl/hash_lookup.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/plugins/acl/hash_lookup.c') diff --git a/src/plugins/acl/hash_lookup.c b/src/plugins/acl/hash_lookup.c index dcc5f791d4b..c8941148036 100644 --- a/src/plugins/acl/hash_lookup.c +++ b/src/plugins/acl/hash_lookup.c @@ -610,17 +610,17 @@ assign_mask_type_index_to_pae(acl_main_t *am, u32 lc_index, int is_ip6, applied_ hash_ace_info_t *ace_info = vec_elt_at_index(ha->rules, pae->hash_ace_info_index); ace_mask_type_entry_t *mte; - fa_5tuple_t *mask; + fa_5tuple_t mask; /* * Start taking base_mask associated to ace, and essentially copy it. * With TupleMerge we will assign a relaxed mask here. */ mte = vec_elt_at_index(am->ace_mask_type_pool, ace_info->base_mask_type_index); - mask = &mte->mask; + mask = mte->mask; if (am->use_tuple_merge) - pae->mask_type_index = tm_assign_mask_type_index(am, mask, is_ip6, lc_index); + pae->mask_type_index = tm_assign_mask_type_index(am, &mask, is_ip6, lc_index); else - pae->mask_type_index = assign_mask_type_index(am, mask); + pae->mask_type_index = assign_mask_type_index(am, &mask); } static void -- cgit 1.2.3-korg