linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Jason Yan <yanaijie@huawei.com>, Jan Kara <jack@suse.cz>
Cc: Markus Elfring <Markus.Elfring@web.de>,
	linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	hulkci@huawei.com, kernel-janitors@vger.kernel.org,
	linux-kernel@vger.kernel.org, Al Viro <viro@zeniv.linux.org.uk>,
	Christoph Hellwig <hch@lst.de>, Jens Axboe <axboe@kernel.dk>,
	Ming Lei <ming.lei@redhat.com>
Subject: Re: [PATCH v2] block: Fix use-after-free in blkdev_get()
Date: Fri, 5 Jun 2020 12:43:54 +0300	[thread overview]
Message-ID: <20200605094353.GS30374@kadam> (raw)
In-Reply-To: <5fa658bf-3028-9b5c-30cc-dbdef6bf8f7a@huawei.com>

A lot of maintainers have blocked Markus and asked him to stop trying
to help people write commit message.  Saying "bdev" instead of "block
device" is more clear so your original message was better.

The Fixes tag is a good idea though:

Fixes: 89e524c04fa9 ("loop: Fix mount(2) failure due to race with LOOP_SET_FD")

It broke last July.  Before that, we used to check if __blkdev_get()
failed before dereferencing "bdev".

I wonder if maybe the best fix is to re-add the "if (!res) " check back
to blkdev_get().  The __blkdev_get() looks like it can also free "whole"
though if it calls itself recursively and I don't really know this code
so I can't say for sure...

regards,
dan carpenter


  reply	other threads:[~2020-06-05  9:44 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-05  8:30 [PATCH v2] block: Fix use-after-free in blkdev_get() Markus Elfring
2020-06-05  9:05 ` Jason Yan
2020-06-05  9:43   ` Dan Carpenter [this message]
2020-06-05 10:56     ` Markus Elfring
2020-06-05 11:10       ` Dan Carpenter
2020-06-05 11:40         ` Markus Elfring
2020-06-05 11:42           ` Matthew Wilcox
2020-06-05 12:47             ` Markus Elfring
2020-06-05 12:52               ` Matthew Wilcox
2020-06-05 13:12                 ` Markus Elfring
2020-06-05 15:15                   ` Matthew Wilcox
2020-06-05 15:25                     ` Markus Elfring
2020-06-05 11:10       ` [PATCH v2] " Matthew Wilcox
2020-06-05 11:48         ` Markus Elfring
2020-06-05 11:51           ` Matthew Wilcox
2020-06-05 13:01             ` Markus Elfring
2020-06-05 13:01             ` Markus Elfring
2020-06-05 13:04               ` Jens Axboe
2020-06-05 13:23                 ` Markus Elfring
2020-06-05 11:10     ` [PATCH v2] " Sedat Dilek
2020-06-05 14:42     ` Jan Kara
2020-06-05 18:08       ` Dan Carpenter
  -- strict thread matches above, loose matches on Subject: below --
2020-06-05  6:43 Jason Yan

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=20200605094353.GS30374@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=Markus.Elfring@web.de \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=hulkci@huawei.com \
    --cc=jack@suse.cz \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ming.lei@redhat.com \
    --cc=viro@zeniv.linux.org.uk \
    --cc=yanaijie@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).