ovn-controller has uninitialized flow cookie because ofctrl_dup_flow()
doesn't copy it from the original flow while duplicating.  This could
cause redundant flow updates or other issues.

Valgrind reports:

 Conditional jump or move depends on uninitialised value(s)
    at 0x414B1C: ofctrl_put (ofctrl.c:1192)
    by 0x409ACB: main (ovn-controller.c:2086)
  Uninitialised value was created by a heap allocation
    at 0x483980B: malloc (vg_replace_malloc.c:309)
    by 0x4C8474: xmalloc (util.c:138)
    by 0x414553: ofctrl_dup_flow (ofctrl.c:793)
    by 0x4152CD: ofctrl_put (ofctrl.c:1231)
    by 0x409ACB: main (ovn-controller.c:2086)

Fixes: d25e286ddb5c ("ovn-controller: Tie OpenFlow and logical flows using 
OpenFlow cookie.")
Signed-off-by: Ilya Maximets <[email protected]>
---
 controller/ofctrl.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/controller/ofctrl.c b/controller/ofctrl.c
index 4b51cd86e..e5e78d9b6 100644
--- a/controller/ofctrl.c
+++ b/controller/ofctrl.c
@@ -799,6 +799,7 @@ ofctrl_dup_flow(struct ovn_flow *src)
     dst->sb_uuid = src->sb_uuid;
     dst->match_hmap_node.hash = src->match_hmap_node.hash;
     dst->uuid_hindex_node.hash = uuid_hash(&src->sb_uuid);
+    dst->cookie = src->cookie;
     return dst;
 }
 
-- 
2.25.4

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to