qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 157e94: numa: do not leak NumaOptions


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 157e94: numa: do not leak NumaOptions
Date: Mon, 08 Aug 2016 05:30:04 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 157e94e8a2f7d3e14060d833bd1519a83099eaa9
      
https://github.com/qemu/qemu/commit/157e94e8a2f7d3e14060d833bd1519a83099eaa9
  Author: Marc-André Lureau <address@hidden>
  Date:   2016-08-07 (Sun, 07 Aug 2016)

  Changed paths:
    M numa.c

  Log Message:
  -----------
  numa: do not leak NumaOptions

In all cases, call qapi_free_NumaOptions(), by using a common ending
block.

Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: 5b498459b441f4639fd4c39c35345637bfc6c16c
      
https://github.com/qemu/qemu/commit/5b498459b441f4639fd4c39c35345637bfc6c16c
  Author: Marc-André Lureau <address@hidden>
  Date:   2016-08-08 (Mon, 08 Aug 2016)

  Changed paths:
    M qemu-char.c

  Log Message:
  -----------
  char: free the tcp connection data when closing

Make sure the connection data got freed when closing the chardev, to
avoid leaks. Introduce tcp_chr_free_connection() to clean all connection
related data, and move some tcp_chr_close() clean-ups there.

(while at it, set write_msgfds_num to 0 when clearing array in
tcp_set_msgfds())

Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>


  Commit: 1371a3693650c4cf5f12bc103a8c0dae83e6de15
      
https://github.com/qemu/qemu/commit/1371a3693650c4cf5f12bc103a8c0dae83e6de15
  Author: Marc-André Lureau <address@hidden>
  Date:   2016-08-08 (Mon, 08 Aug 2016)

  Changed paths:
    M qemu-char.c

  Log Message:
  -----------
  char: free MuxDriver when closing

Similarly to other chr_close callbacks, free char type specific data.

Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: 9d324b0e67c2b570df389c1361f591b95a4e4278
      
https://github.com/qemu/qemu/commit/9d324b0e67c2b570df389c1361f591b95a4e4278
  Author: Marc-André Lureau <address@hidden>
  Date:   2016-08-08 (Mon, 08 Aug 2016)

  Changed paths:
    M hw/ide/ahci.c

  Log Message:
  -----------
  ahci: free irqs array

Each irq is referenced by the IDEBus in ide_init2(), thus we can free
the no longer used array.

Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: John Snow <address@hidden>
Acked-by: John Snow <address@hidden>


  Commit: df37dd6ffe49dc0da919c5034fb89e1f85e3c98f
      
https://github.com/qemu/qemu/commit/df37dd6ffe49dc0da919c5034fb89e1f85e3c98f
  Author: Marc-André Lureau <address@hidden>
  Date:   2016-08-08 (Mon, 08 Aug 2016)

  Changed paths:
    M migration/qjson.c

  Log Message:
  -----------
  qjson: free str

Release the qstring allocated in qjson_new().

Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: 0137a557aac07480ff8447ef372f0581af5ee65a
      
https://github.com/qemu/qemu/commit/0137a557aac07480ff8447ef372f0581af5ee65a
  Author: Marc-André Lureau <address@hidden>
  Date:   2016-08-08 (Mon, 08 Aug 2016)

  Changed paths:
    M hw/input/virtio-input.c

  Log Message:
  -----------
  virtio-input: free config list

Clear the list when finalizing. The list is created during realize with
virtio_input_idstr_config() and later by further calls to
virtio_input_init_config() and virtio_input_add_config().

This leak can be reproduced with device-introspect-test -p
/x86_64/device/introspect/concrete.

Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Gerd Hoffmann <address@hidden>


  Commit: ec507f112361ddf6dac0f0a30e84d9da1b4910b6
      
https://github.com/qemu/qemu/commit/ec507f112361ddf6dac0f0a30e84d9da1b4910b6
  Author: Marc-André Lureau <address@hidden>
  Date:   2016-08-08 (Mon, 08 Aug 2016)

  Changed paths:
    M hw/usb/bus.c

  Log Message:
  -----------
  usb: free USBDevice.strings

The list is created during instance init and further populated with
usb_desc_set_string(). Clear it when unrealizing the device.

Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Gerd Hoffmann <address@hidden>


  Commit: 9ef617246b629109e2779835b9a3a8400029484d
      
https://github.com/qemu/qemu/commit/9ef617246b629109e2779835b9a3a8400029484d
  Author: Marc-André Lureau <address@hidden>
  Date:   2016-08-08 (Mon, 08 Aug 2016)

  Changed paths:
    M hw/usb/desc.c

  Log Message:
  -----------
  usb: free leaking path

qdev_get_dev_path() returns an allocated string, free it when no longer
needed.

Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Gerd Hoffmann <address@hidden>


  Commit: 5839df7b71540a2af2580bb53ad1e2005bb175e6
      
https://github.com/qemu/qemu/commit/5839df7b71540a2af2580bb53ad1e2005bb175e6
  Author: Marc-André Lureau <address@hidden>
  Date:   2016-08-08 (Mon, 08 Aug 2016)

  Changed paths:
    M hw/ide/ahci.c
    M hw/ide/core.c

  Log Message:
  -----------
  ahci: fix sglist leak on retry

ahci-test /x86_64/ahci/io/dma/lba28/retry triggers the following leak:

Direct leak of 16 byte(s) in 1 object(s) allocated from:
    #0 0x7fc4b2a25e20 in malloc (/lib64/libasan.so.3+0xc6e20)
    #1 0x7fc4993bce58 in g_malloc (/lib64/libglib-2.0.so.0+0x4ee58)
    #2 0x556a187d4b34 in ahci_populate_sglist hw/ide/ahci.c:896
    #3 0x556a187d8237 in ahci_dma_prepare_buf hw/ide/ahci.c:1367
    #4 0x556a187b5a1a in ide_dma_cb hw/ide/core.c:844
    #5 0x556a187d7eec in ahci_start_dma hw/ide/ahci.c:1333
    #6 0x556a187b650b in ide_start_dma hw/ide/core.c:921
    #7 0x556a187b61e6 in ide_sector_start_dma hw/ide/core.c:911
    #8 0x556a187b9e26 in cmd_write_dma hw/ide/core.c:1486
    #9 0x556a187bd519 in ide_exec_cmd hw/ide/core.c:2027
    #10 0x556a187d71c5 in handle_reg_h2d_fis hw/ide/ahci.c:1204
    #11 0x556a187d7681 in handle_cmd hw/ide/ahci.c:1254
    #12 0x556a187d168a in check_cmd hw/ide/ahci.c:510
    #13 0x556a187d0afc in ahci_port_write hw/ide/ahci.c:314
    #14 0x556a187d105d in ahci_mem_write hw/ide/ahci.c:435
    #15 0x556a1831d959 in memory_region_write_accessor 
/home/elmarco/src/qemu/memory.c:525
    #16 0x556a1831dc35 in access_with_adjusted_size 
/home/elmarco/src/qemu/memory.c:591
    #17 0x556a18323ce3 in memory_region_dispatch_write 
/home/elmarco/src/qemu/memory.c:1262
    #18 0x556a1828cf67 in address_space_write_continue 
/home/elmarco/src/qemu/exec.c:2578
    #19 0x556a1828d20b in address_space_write /home/elmarco/src/qemu/exec.c:2635
    #20 0x556a1828d92b in address_space_rw /home/elmarco/src/qemu/exec.c:2737
    #21 0x556a1828daf7 in cpu_physical_memory_rw 
/home/elmarco/src/qemu/exec.c:2746
    #22 0x556a183068d3 in cpu_physical_memory_write 
/home/elmarco/src/qemu/include/exec/cpu-common.h:72
    #23 0x556a18308194 in qtest_process_command 
/home/elmarco/src/qemu/qtest.c:382
    #24 0x556a18309999 in qtest_process_inbuf /home/elmarco/src/qemu/qtest.c:573
    #25 0x556a18309a4a in qtest_read /home/elmarco/src/qemu/qtest.c:585
    #26 0x556a18598b85 in qemu_chr_be_write_impl 
/home/elmarco/src/qemu/qemu-char.c:387
    #27 0x556a18598c52 in qemu_chr_be_write 
/home/elmarco/src/qemu/qemu-char.c:399
    #28 0x556a185a2afa in tcp_chr_read /home/elmarco/src/qemu/qemu-char.c:2902
    #29 0x556a18cbaf52 in qio_channel_fd_source_dispatch io/channel-watch.c:84

Follow John Snow recommendation:
  Everywhere else ncq_err is used, it is accompanied by a list cleanup
  except for ncq_cb, which is the case you are fixing here.

  Move the sglist destruction inside of ncq_err and then delete it from
  the other two locations to keep it tidy.

  Call dma_buf_commit in ide_dma_cb after the early return. Though, this
  is also a little wonky because this routine does more than clear the
  list, but it is at the moment the centralized "we're done with the
  sglist" function and none of the other side effects that occur in
  dma_buf_commit will interfere with the reset that occurs from
  ide_restart_bh, I think

Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: John Snow <address@hidden>


  Commit: 9efaf7f5f5729f7fa8dcf413fabe3d46ad382f90
      
https://github.com/qemu/qemu/commit/9efaf7f5f5729f7fa8dcf413fabe3d46ad382f90
  Author: Peter Maydell <address@hidden>
  Date:   2016-08-08 (Mon, 08 Aug 2016)

  Changed paths:
    M hw/ide/ahci.c
    M hw/ide/core.c
    M hw/input/virtio-input.c
    M hw/usb/bus.c
    M hw/usb/desc.c
    M migration/qjson.c
    M numa.c
    M qemu-char.c

  Log Message:
  -----------
  Merge remote-tracking branch 
'remotes/elmarco/tags/leaks-for-2.7-pull-request' into staging

# gpg: Signature made Sun 07 Aug 2016 21:03:14 BST
# gpg:                using RSA key 0xDAE8E10975969CE5
# gpg: Good signature from "Marc-André Lureau <address@hidden>"
# gpg:                 aka "Marc-André Lureau <address@hidden>"
# gpg: WARNING: This key is not certified with sufficiently trusted signatures!
# gpg:          It is not certain that the signature belongs to the owner.
# Primary key fingerprint: 87A9 BD93 3F87 C606 D276  F62D DAE8 E109 7596 9CE5

* remotes/elmarco/tags/leaks-for-2.7-pull-request:
  ahci: fix sglist leak on retry
  usb: free leaking path
  usb: free USBDevice.strings
  virtio-input: free config list
  qjson: free str
  ahci: free irqs array
  char: free MuxDriver when closing
  char: free the tcp connection data when closing
  numa: do not leak NumaOptions

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/cbda16c010a2...9efaf7f5f572

reply via email to

[Prev in Thread] Current Thread [Next in Thread]