[ovs-git] [ovn-org/ovn] 01564e: actions: Fix leak of child ports in fwd group.

Ilya Maximets noreply at github.com
Sun Nov 22 19:36:45 UTC 2020


  Branch: refs/heads/branch-20.03
  Home:   https://github.com/ovn-org/ovn
  Commit: 01564e904d584a7a7d4600ab237648702ba49a70
      https://github.com/ovn-org/ovn/commit/01564e904d584a7a7d4600ab237648702ba49a70
  Author: Ilya Maximets <i.maximets at ovn.org>
  Date:   2020-11-23 (Mon, 23 Nov 2020)

  Changed paths:
    M lib/actions.c

  Log Message:
  -----------
  actions: Fix leak of child ports in fwd group.

'child_port_list' is an array of pointers that should be freed too.

  Direct leak of 30 byte(s) in 6 object(s) allocated from:
    #0 0x501fff in malloc (/tests/ovstest+0x501fff)
    #1 0x6227e6 in xmalloc /lib/util.c:138:15
    #2 0x6228b8 in xmemdup0 /lib/util.c:168:15
    #3 0x8183d6 in parse_fwd_group_action /lib/actions.c:3374:30
    #4 0x814b6e in parse_action /lib/actions.c:3610:9
    #5 0x8139ef in parse_actions /lib/actions.c:3637:14
    #6 0x8136a3 in ovnacts_parse /lib/actions.c:3672:9
    #7 0x813c80 in ovnacts_parse_string /lib/actions.c:3699:5
    #8 0x53a979 in test_parse_actions /tests/test-ovn.c:1372:21
    #9 0x54e7a8 in ovs_cmdl_run_command__ /lib/command-line.c:247:17
    #10 0x537c75 in test_ovn_main /tests/test-ovn.c:1630:5
    #11 0x54e7a8 in ovs_cmdl_run_command__ /lib/command-line.c:247:17
    #12 0x537359 in main /tests/ovstest.c:133:9
    #13 0x7f06978f21a2 in __libc_start_main (/lib64/libc.so.6+0x271a2)

CC: Manoj Sharma <manoj.sharma at nutanix.com>
Fixes: edb240081518 ("Forwarding group to load balance l2 traffic with liveness detection")
Acked-by: Dumitru Ceara <dceara at redhat.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>
Signed-off-by: Numan Siddique <numans at ovn.org>

(cherry-picked from master commit 9443464f7335cc8b8ec6299e70a5ad6266bef4c8)


  Commit: 1743aedc104d66c965e7276b91aaa964f0c8ffce
      https://github.com/ovn-org/ovn/commit/1743aedc104d66c965e7276b91aaa964f0c8ffce
  Author: Ilya Maximets <i.maximets at ovn.org>
  Date:   2020-11-23 (Mon, 23 Nov 2020)

  Changed paths:
    M lib/actions.c

  Log Message:
  -----------
  actions: Fix leak of select group members.

'dsts' should be freed in case of any error.

  Direct leak of 4 byte(s) in 1 object(s) allocated from:
    #0 0x502378 in realloc (/tests/ovstest+0x502378)
    #1 0x622826 in xrealloc /lib/util.c:149:9
    #2 0x8194f4 in parse_select_action /lib/actions.c:1185:20
    #3 0x814f49 in parse_set_action /lib/actions.c:3499:13
    #4 0x814341 in parse_action /lib/actions.c:3554:9
    #5 0x8139ef in parse_actions /lib/actions.c:3643:14
    #6 0x8136a3 in ovnacts_parse /lib/actions.c:3678:9
    #7 0x813c80 in ovnacts_parse_string /lib/actions.c:3705:5
    #8 0x53a4e8 in test_parse_actions /tests/test-ovn.c:1321:17
    #9 0x54e7a8 in ovs_cmdl_run_command__ /lib/command-line.c:247:17
    #10 0x537c75 in test_ovn_main /tests/test-ovn.c:1630:5
    #11 0x54e7a8 in ovs_cmdl_run_command__ /lib/command-line.c:247:17
    #12 0x537359 in main /tests/ovstest.c:133:9
    #13 0x7f9ce05ba1a2 in __libc_start_main (/lib64/libc.so.6+0x271a2)

CC: Han Zhou <hzhou at ovn.org>
Fixes: 85b3544aabb2 ("ovn-controller: A new action "select".")
Acked-by: Dumitru Ceara <dceara at redhat.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>
Signed-off-by: Numan Siddique <numans at ovn.org>

(cherry-picked from master commit 18141dbcb023df9cac8c9a4d6aae63c77d8acc69)


  Commit: f749033a3c71e1c4972075c3321e6b28784a719e
      https://github.com/ovn-org/ovn/commit/f749033a3c71e1c4972075c3321e6b28784a719e
  Author: Ilya Maximets <i.maximets at ovn.org>
  Date:   2020-11-23 (Mon, 23 Nov 2020)

  Changed paths:
    M controller/ofctrl.c

  Log Message:
  -----------
  ofctrl: Fix leak of meter mod bands.

'parse_ofp_meter_mod_str' allocates space for meter.bands that
should be freed.

  Direct leak of 448 byte(s) in 7 object(s) allocated from:
    #0 0x52100f in malloc (/controller/ovn-controller+0x52100f)
    #1 0x7523a6 in xmalloc /lib/util.c:138:15
    #2 0x6fd079 in ofpbuf_init /lib/ofpbuf.c:123:26
    #3 0x6cba27 in parse_ofp_meter_mod_str /lib/ofp-meter.c:779:5
    #4 0x5705b8 in add_meter_string /controller/ofctrl.c:1674:19
    #5 0x56f736 in ofctrl_put /controller/ofctrl.c:2105:13
    #6 0x59aebb in main /controller/ovn-controller.c:2627:25
    #7 0x7f07873251a2 in __libc_start_main (/lib64/libc.so.6+0x271a2)

CC: Guoshuai Li <ligs at dtdream.com>
Fixes: c25094b3884d ("ovn: OVN Support QoS meter")
Acked-by: Dumitru Ceara <dceara at redhat.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>
Signed-off-by: Numan Siddique <numans at ovn.org>

(cherry-picked from master commit d058d9a08572520a4cb4ec4a4c6db5afdb35d515)


  Commit: 79698908674136da774dca1f0b0642c49bbe1e32
      https://github.com/ovn-org/ovn/commit/79698908674136da774dca1f0b0642c49bbe1e32
  Author: Ilya Maximets <i.maximets at ovn.org>
  Date:   2020-11-23 (Mon, 23 Nov 2020)

  Changed paths:
    M controller/pinctrl.c

  Log Message:
  -----------
  pinctrl: Fix leak of DNS cache records.

'smap_clear()' doesn't free allocated memory, but 'smap_clone()'
re-initializes hash map clearing internal pointers and leaking
this memory.  'smap_destroy()' should be used instead.

Also, all the records and array of datapaths should be freed on
destruction of a cache entry.

  Direct leak of 16 byte(s) in 2 object(s) allocated from:
    #0 0x5211c7 in calloc (/controller/ovn-controller+0x5211c7)
    #1 0x752364 in xcalloc /lib/util.c:121:31
    #2 0x576e76 in sync_dns_cache /controller/pinctrl.c:2517:25
    #3 0x5758fb in pinctrl_run /controller/pinctrl.c:3158:5
    #4 0x59b06c in main /controller/ovn-controller.c:2642:25
    #5 0x7fb570fc11a2 in __libc_start_main (/lib64/libc.so.6+0x271a2)

  Indirect leak of 26 byte(s) in 2 object(s) allocated from:
    #0 0x52100f in malloc (/controller/ovn-controller+0x52100f)
    #1 0x7523d6 in xmalloc /lib/util.c:138:15
    #2 0x7524a8 in xmemdup0 /lib/util.c:168:15
    #3 0x73d8fc in smap_clone /lib/smap.c:314:45
    #4 0x576e2f in sync_dns_cache /controller/pinctrl.c:2513:13
    #5 0x5758fb in pinctrl_run /controller/pinctrl.c:3158:5
    #6 0x59b06c in main /controller/ovn-controller.c:2642:25
    #7 0x7fb570fc11a2 in __libc_start_main (/lib64/libc.so.6+0x271a2)

Fixes: 6b72068202f1 ("ovn-controller: Add a new thread in pinctrl module to handle packet-ins.")
Acked-by: Dumitru Ceara <dceara at redhat.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>
Signed-off-by: Numan Siddique <numans at ovn.org>

(cherry-picked from master commit 79b946da70442ab2610c47752555dffbbce490a5)


  Commit: 2b3601132d9a408f6e2b9dffd3b48c8c531862e2
      https://github.com/ovn-org/ovn/commit/2b3601132d9a408f6e2b9dffd3b48c8c531862e2
  Author: Ilya Maximets <i.maximets at ovn.org>
  Date:   2020-11-23 (Mon, 23 Nov 2020)

  Changed paths:
    M controller/ovn-controller.c

  Log Message:
  -----------
  ovn-controller: Fix leak of pending ct zones.

shash contains pointers to the data that should be freed.

  Direct leak of 32 byte(s) in 2 object(s) allocated from:
    #0 0x52100f in malloc (/controller/ovn-controller+0x52100f)
    #1 0x752436 in xmalloc /lib/util.c:138:15
    #2 0x5a2f0b in add_pending_ct_zone_entry /controller/ovn-controller.c:548:45
    #3 0x5a2d1d in update_ct_zones /controller/ovn-controller.c:668:9
    #4 0x59d8c6 in en_ct_zones_run /controller/ovn-controller.c:1495:5
    #5 0x5dade4 in engine_run /lib/inc-proc-eng.c:377:9
    #6 0x59adf4 in main /controller/ovn-controller.c
    #7 0x7f0799ef41a2 in __libc_start_main (/lib64/libc.so.6+0x271a2)

CC: xu rong <xu.rong at zte.com.cn>
Fixes: 252e1642fb59 ("ovn-controller: pending_ct_zones should be destroyed")
Acked-by: Dumitru Ceara <dceara at redhat.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>
Signed-off-by: Numan Siddique <numans at ovn.org>

(cherry-picked from master commit 11bd9d337b670f5a3fe3c6abb2dd932039a6518d)


  Commit: dd94424d8664ead76bc6352af68906bbe71137aa
      https://github.com/ovn-org/ovn/commit/dd94424d8664ead76bc6352af68906bbe71137aa
  Author: Ilya Maximets <i.maximets at ovn.org>
  Date:   2020-11-23 (Mon, 23 Nov 2020)

  Changed paths:
    M utilities/ovn-nbctl.c

  Log Message:
  -----------
  ovn-nbctl: Fix error leak on duplicated switch port.

Error is allocated from heap and should be freed.

Fixes: 738295605b44 ("ovn: Detect and prevent duplicate address assignments.")
Acked-by: Dumitru Ceara <dceara at redhat.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>
Signed-off-by: Numan Siddique <numans at ovn.org>

(cherry-picked from master commit 6f4353df304cdf8e32afb32bf243599b99851d5a)


  Commit: 531d8832db4b8853d4c60ec0aabfe9dbb2c51849
      https://github.com/ovn-org/ovn/commit/531d8832db4b8853d4c60ec0aabfe9dbb2c51849
  Author: Ilya Maximets <i.maximets at ovn.org>
  Date:   2020-11-23 (Mon, 23 Nov 2020)

  Changed paths:
    M northd/ovn-northd.c

  Log Message:
  -----------
  northd: Fix leak of dynamic string for fwd group ports.

'group_ports' never destroyed and re-created on each iteration.

CC: Manoj Sharma <manoj.sharma at nutanix.com>
Fixes: edb240081518 ("Forwarding group to load balance l2 traffic with liveness detection")
Acked-by: Dumitru Ceara <dceara at redhat.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>
Signed-off-by: Numan Siddique <numans at ovn.org>

(cherry-picked from master commit 44f41669812c633bc180074e6d91e0d0f3a781a1)


  Commit: 8fe336ac3ca4dc1200c8566c59b720a83c381c21
      https://github.com/ovn-org/ovn/commit/8fe336ac3ca4dc1200c8566c59b720a83c381c21
  Author: Ilya Maximets <i.maximets at ovn.org>
  Date:   2020-11-23 (Mon, 23 Nov 2020)

  Changed paths:
    M lib/actions.c

  Log Message:
  -----------
  actions: Fix leak of dynamic string on fwd group encoding failure.

CC: Manoj Sharma <manoj.sharma at nutanix.com>
Fixes: edb240081518 ("Forwarding group to load balance l2 traffic with liveness detection")
Acked-by: Dumitru Ceara <dceara at redhat.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>
Signed-off-by: Numan Siddique <numans at ovn.org>

(cherry-picked from master commit 61d209bbf2abacb71cdb63555fe1fe6b0020daf3)


Compare: https://github.com/ovn-org/ovn/compare/26483a226232...8fe336ac3ca4


More information about the git mailing list