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

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


  Branch: refs/heads/branch-20.06
  Home:   https://github.com/ovn-org/ovn
  Commit: abdb60512c92f308256552b1e0cfab11c904d2bc
      https://github.com/ovn-org/ovn/commit/abdb60512c92f308256552b1e0cfab11c904d2bc
  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: 53e00897dabd684e107b0fc8cdedea97082eab5f
      https://github.com/ovn-org/ovn/commit/53e00897dabd684e107b0fc8cdedea97082eab5f
  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: c99dd6117c6feac445ca7ca0b6fcb4a301251558
      https://github.com/ovn-org/ovn/commit/c99dd6117c6feac445ca7ca0b6fcb4a301251558
  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: 6f79237fb0b233e4c3ac8ff21ac02c86b6a6906a
      https://github.com/ovn-org/ovn/commit/6f79237fb0b233e4c3ac8ff21ac02c86b6a6906a
  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: 000482b536b40442861befcbfb6beae9484a45c4
      https://github.com/ovn-org/ovn/commit/000482b536b40442861befcbfb6beae9484a45c4
  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: 1e8d0e478400df590923477d05ba2cf1545a5481
      https://github.com/ovn-org/ovn/commit/1e8d0e478400df590923477d05ba2cf1545a5481
  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: 61ab9b4d53a6326726fe210981c1188e91888136
      https://github.com/ovn-org/ovn/commit/61ab9b4d53a6326726fe210981c1188e91888136
  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: df2b3cc38440b38f6176850e5e56a36a7b6b1ada
      https://github.com/ovn-org/ovn/commit/df2b3cc38440b38f6176850e5e56a36a7b6b1ada
  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: 96c6e83308d49f677c85f1faa600bcd1a29320bb
      https://github.com/ovn-org/ovn/commit/96c6e83308d49f677c85f1faa600bcd1a29320bb
  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/f378bf34112c...96c6e83308d4


More information about the git mailing list