All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Eiichi Tsukata <devel@etsukata.com>
Cc: vsementsov@virtuozzo.com, qemu-devel@nongnu.org,
	qemu-block@nongnu.org, mreitz@redhat.com
Subject: Re: [PATCH] block/backup: fix memory leak in bdrv_backup_top_append()
Date: Mon, 20 Jan 2020 11:32:07 +0100	[thread overview]
Message-ID: <20200120103207.GB4970@linux.fritz.box> (raw)
In-Reply-To: <20191223090632.30653-1-devel@etsukata.com>

Am 23.12.2019 um 10:06 hat Eiichi Tsukata geschrieben:
> bdrv_open_driver() allocates bs->opaque according to drv->instance_size.
> There is no need to allocate it and overwrite opaque in
> bdrv_backup_top_append().
> 
> Reproducer:
> 
>   $ QTEST_QEMU_BINARY=./x86_64-softmmu/qemu-system-x86_64 valgrind -q --leak-check=full tests/test-replication -p /replication/secondary/start
>   ==29792== 24 bytes in 1 blocks are definitely lost in loss record 52 of 226
>   ==29792==    at 0x483AB1A: calloc (vg_replace_malloc.c:762)
>   ==29792==    by 0x4B07CE0: g_malloc0 (in /usr/lib64/libglib-2.0.so.0.6000.7)
>   ==29792==    by 0x12BAB9: bdrv_open_driver (block.c:1289)
>   ==29792==    by 0x12BEA9: bdrv_new_open_driver (block.c:1359)
>   ==29792==    by 0x1D15CB: bdrv_backup_top_append (backup-top.c:190)
>   ==29792==    by 0x1CC11A: backup_job_create (backup.c:439)
>   ==29792==    by 0x1CD542: replication_start (replication.c:544)
>   ==29792==    by 0x1401B9: replication_start_all (replication.c:52)
>   ==29792==    by 0x128B50: test_secondary_start (test-replication.c:427)
>   ...
> 
> Fixes: 7df7868b9640 ("block: introduce backup-top filter driver")
> Signed-off-by: Eiichi Tsukata <devel@etsukata.com>

Thanks, applied to the block layer.

Kevin



      parent reply	other threads:[~2020-01-20 10:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-23  9:06 [PATCH] block/backup: fix memory leak in bdrv_backup_top_append() Eiichi Tsukata
2019-12-23 12:40 ` Vladimir Sementsov-Ogievskiy
2019-12-23 13:40   ` Eiichi Tsukata
2020-01-20 10:42     ` Kevin Wolf
2020-01-18  8:26 ` Eiichi Tsukata
2020-01-20 10:32 ` Kevin Wolf [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200120103207.GB4970@linux.fritz.box \
    --to=kwolf@redhat.com \
    --cc=devel@etsukata.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=vsementsov@virtuozzo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.