From: Ming Lei <ming.lei@redhat.com>
To: Justin Tee <justin.tee@broadcom.com>
Cc: Jens Axboe <axboe@kernel.dk>,
linux-block@vger.kernel.org, Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH] block: fix memleak of bio integrity data
Date: Thu, 5 Dec 2019 15:49:32 +0800 [thread overview]
Message-ID: <20191205074932.GA21955@ming.t460p> (raw)
In-Reply-To: <CAAmqgVN6huL60c9aw41yC6wz6fG0w-T4xR0Tuoz0PqX2BqwKDA@mail.gmail.com>
On Wed, Dec 04, 2019 at 09:41:24PM -0800, Justin Tee wrote:
> Hi Ming,
>
> I understand the patch, but I have a concern.
>
> Is it possible to come across a double-free? from bio_endio ->
> bio_integrity_endio -> __bio_integrity_endio -> bio_integrity_free; And
> then, resuming in bio_endio -> bio_uninit -> bio_integrity_free;. Maybe
> it's even possible queue_work bio_integrity_verify_fn was scheduled and
> called bio_integrity_free from there as well. So, should also remove
> bio_integrity_free from bio_integrity_verify_fn and __bio_integrity_endio
> routines?
Yeah, double-free could be caused for READ between bio_integrity_verify_fn()
and bio_uninit().
I think it is enough to remove bio_integrity_free() from both
bio_integrity_verify_fn() and __bio_integrity_endio().
Will do it in V2.
Thanks,
Ming
next prev parent reply other threads:[~2019-12-05 7:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-05 2:09 [PATCH] block: fix memleak of bio integrity data Ming Lei
[not found] ` <CAAmqgVN6huL60c9aw41yC6wz6fG0w-T4xR0Tuoz0PqX2BqwKDA@mail.gmail.com>
2019-12-05 7:49 ` Ming Lei [this message]
2019-12-05 8:09 ` Ming Lei
2019-12-05 18:30 ` Justin Tee
2019-12-05 18:38 ` Jens Axboe
2019-12-05 9:52 ` Christoph Hellwig
2019-12-05 10:08 ` John Garry
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=20191205074932.GA21955@ming.t460p \
--to=ming.lei@redhat.com \
--cc=axboe@kernel.dk \
--cc=hch@lst.de \
--cc=justin.tee@broadcom.com \
--cc=linux-block@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox