[ovs-git] [ovn-org/ovn] 7a8c5e: northd: Fix leaks of strings while formatting ecmp...

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


  Branch: refs/heads/branch-20.09
  Home:   https://github.com/ovn-org/ovn
  Commit: 7a8c5e11a7a77263b4ce015d3a6b7f09fcde5df9
      https://github.com/ovn-org/ovn/commit/7a8c5e11a7a77263b4ce015d3a6b7f09fcde5df9
  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 leaks of strings while formatting ecmp flows.

Result of 'normalize_v46_prefix()' should be freed and all dynamic
strings should be destroyed.

Fixes: 4fdca656857d ("Add ECMP symmetric replies.")
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>


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

  Changed paths:
    M tests/test-ovn.c

  Log Message:
  -----------
  test-ovn: Fix expression leak.

No need to clone when assigning to the same variable.

Fixes: 024500aeab9a ("expr: Evaluate the condition expression in a separate step.")
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>


  Commit: 5d34043eb74aa85908d703bc74c5acc98822c17e
      https://github.com/ovn-org/ovn/commit/5d34043eb74aa85908d703bc74c5acc98822c17e
  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>


  Commit: 44eec1a34faf809f9c520d8808186c77636672d4
      https://github.com/ovn-org/ovn/commit/44eec1a34faf809f9c520d8808186c77636672d4
  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>


  Commit: 6ee1077994806bccde1c5e84ffdfa1ce7548b9ee
      https://github.com/ovn-org/ovn/commit/6ee1077994806bccde1c5e84ffdfa1ce7548b9ee
  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>


  Commit: 40b8a7359bed2b0ebd29b905221931f23a5c4955
      https://github.com/ovn-org/ovn/commit/40b8a7359bed2b0ebd29b905221931f23a5c4955
  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>


  Commit: fd3157900ee31c51d938afc3aec43f40a1a01500
      https://github.com/ovn-org/ovn/commit/fd3157900ee31c51d938afc3aec43f40a1a01500
  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>


  Commit: 81cc8e7ff08ca034e422756c9ccca759d7c36b69
      https://github.com/ovn-org/ovn/commit/81cc8e7ff08ca034e422756c9ccca759d7c36b69
  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>


  Commit: 61b6e797d2432ed0ecaa5db14ba119aca5cf22b4
      https://github.com/ovn-org/ovn/commit/61b6e797d2432ed0ecaa5db14ba119aca5cf22b4
  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: 678373a3f8be04495962c9c05d9f8537bcdb13cc
      https://github.com/ovn-org/ovn/commit/678373a3f8be04495962c9c05d9f8537bcdb13cc
  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)


  Commit: 4f41120b4b570839fe94a2a8d9bbf1bea0fc4108
      https://github.com/ovn-org/ovn/commit/4f41120b4b570839fe94a2a8d9bbf1bea0fc4108
  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 leak of IPs while configuring NAT.

CC: Ankur Sharma <ankur.sharma at nutanix.com>
Fixes: 20bc58a67f39 ("External IP based NAT: Add Columns and CLI")
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>
Acked-by: Dumitru Ceara <dceara at redhat.com>
Acked-by: Ankur Sharma <ankur.sharma at nutanix.com>
Signed-off-by: Numan Siddique <numans at ovn.org>

(cherry-picked from master commit f9e449fce78b2e0682cef53ba09cade492b4d260)


  Commit: d5838f9afce1d0dddd3decd7688feb321e2c0dba
      https://github.com/ovn-org/ovn/commit/d5838f9afce1d0dddd3decd7688feb321e2c0dba
  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 IP leak on router NAT addition failure.

Cleanup needed instead of direct return.

Fixes: 43f42ecb3a5a ("Use normalized IP addreses in `ovn-nbctl lr-nat-add`")
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 360b5bf20f23eb103edf86f3b13ab0a5fe0490db)


  Commit: 56c1d846a68fea46e145d2309dfb69bc8292285c
      https://github.com/ovn-org/ovn/commit/56c1d846a68fea46e145d2309dfb69bc8292285c
  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 IP leak on failure of lr policy addition.

Fixes: 742474bad730 ("ovn-nbctl: Enhance lr-policy-add to set the options.")
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 47385c83f865306b5c85a61d530e2a9383640ceb)


  Commit: 5879e323a9e5c1ae59e945abd67340f394c0bb93
      https://github.com/ovn-org/ovn/commit/5879e323a9e5c1ae59e945abd67340f394c0bb93
  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 leak of array of new policies.

CC: Tao YunXiang <taoyunxiang at cmss.chinamobile.com>
Fixes: 5820502a5507 ("ovn-nbctl.c: Fix lr-policy-del command")
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 f3b8cbb2f2c55f9debec56ff881190de7e9b2d63)


Compare: https://github.com/ovn-org/ovn/compare/91af4256153a...5879e323a9e5


More information about the git mailing list