From: Jens Axboe <axboe@kernel.dk>
To: "Matias Bjørling" <mb@lightnvm.io>,
"Gustavo A. R. Silva" <gustavo@embeddedor.com>,
"Igor Konopko" <igor.j.konopko@intel.com>
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] lightnvm: pblk: fix use-after-free bug
Date: Sat, 22 Dec 2018 14:45:18 -0700 [thread overview]
Message-ID: <06e20d48-1029-6dad-6037-d88e13a1708e@kernel.dk> (raw)
In-Reply-To: <1992ea52-cc13-c704-4653-7fbe667b1c5a@lightnvm.io>
On 12/22/18 11:30 AM, Matias Bjørling wrote:
> On 12/22/18 8:39 AM, Gustavo A. R. Silva wrote:
>> Remove one of the calls to function bio_put(), so *bio* is only
>> freed once.
>>
>> Notice that bio is being dereferenced in bio_put(), hence leading to
>> a use-after-free bug once *bio* has already been freed.
>>
>> Addresses-Coverity-ID: 1475952 ("Use after free")
>> Fixes: 55d8ec35398e ("lightnvm: pblk: support packed metadata")
>> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
>> ---
>> drivers/lightnvm/pblk-recovery.c | 1 -
>> 1 file changed, 1 deletion(-)
>>
>> diff --git a/drivers/lightnvm/pblk-recovery.c b/drivers/lightnvm/pblk-recovery.c
>> index 3fcf062d752c..5ee20da7bdb3 100644
>> --- a/drivers/lightnvm/pblk-recovery.c
>> +++ b/drivers/lightnvm/pblk-recovery.c
>> @@ -418,7 +418,6 @@ static int pblk_recov_scan_oob(struct pblk *pblk, struct pblk_line *line,
>> if (ret) {
>> pblk_err(pblk, "I/O submission failed: %d\n", ret);
>> bio_put(bio);
>> - bio_put(bio);
>> return ret;
>> }
>>
>>
>
> Thanks Gustavo. I missed that one.
>
> Jens, if possible could you please pick this up?
Yep, added for the later pull.
--
Jens Axboe
prev parent reply other threads:[~2018-12-22 21:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20181222073952.GA11561@embeddedor>
2018-12-22 18:30 ` Matias Bjørling
2018-12-22 19:01 ` Gustavo A. R. Silva
2018-12-22 21:45 ` Jens Axboe [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=06e20d48-1029-6dad-6037-d88e13a1708e@kernel.dk \
--to=axboe@kernel.dk \
--cc=gustavo@embeddedor.com \
--cc=igor.j.konopko@intel.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mb@lightnvm.io \
/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
all inboxes | Powered by JetHome®