linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Christoph Hellwig <hch@infradead.org>
Cc: Yufen Yu <yuyufen@huawei.com>,
	axboe@kernel.dk, linux-block@vger.kernel.org, tj@kernel.org,
	jack@suse.cz, bvanassche@acm.org, tytso@mit.edu,
	gregkh@linuxfoundation.org
Subject: Re: [PATCH v4 0/6] bdi: fix use-after-free for bdi device
Date: Wed, 15 Apr 2020 11:34:59 +0200	[thread overview]
Message-ID: <20200415093459.GH501@quack2.suse.cz> (raw)
In-Reply-To: <20200414155228.GA17487@infradead.org>

On Tue 14-04-20 08:52:28, Christoph Hellwig wrote:
> Looking through this series the whoe approach of using a lock to clear
> the ->dev pointer looks rather odd to me.  What is the reason for now
> simply adding a separately allocated name field to struct
> backing_dev_info that the name is copied to on allocation, and then
> the ->dev field is not relevant for name printing and we don't need
> to copy out the name in the potentionally more fast path callers that
> want to print it?

Yeah, that's what I was suggesting as well [1] - especially since we
already have bdi->name with a dubious value (but looking into it now, we
would need a separate dev_name field since bdi->name is visible in sysfs so
we cannot change that). But Yufen explained to me that this could result in
bogus name being reported when bdi gets re-registered. Not sure if that's
serious enough but it could happen...

								Honza

[1] https://lore.kernel.org/linux-block/20200219125505.GP16121@quack2.suse.cz

-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

  reply	other threads:[~2020-04-15  9:35 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-25 12:38 [PATCH v4 0/6] bdi: fix use-after-free for bdi device Yufen Yu
2020-03-25 12:38 ` [PATCH v4 1/6] bdi: use bdi_dev_name() to get device name Yufen Yu
2020-03-25 12:38 ` [PATCH v4 2/6] bdi: protect bdi->dev with spinlock Yufen Yu
2020-03-25 12:38 ` [PATCH v4 3/6] bfq: fix potential kernel crash when print error info Yufen Yu
2020-03-25 12:38 ` [PATCH v4 4/6] memcg: fix crash in wb_workfn when bdi unregister Yufen Yu
2020-03-25 12:38 ` [PATCH v4 5/6] blk-wbt: replace bdi_dev_name() with bdi_get_dev_name() Yufen Yu
2020-03-25 12:38 ` [PATCH v4 6/6] blkcg: fix use-after-free for bdi->dev Yufen Yu
2020-04-09 13:28 ` [PATCH v4 0/6] bdi: fix use-after-free for bdi device Yufen Yu
2020-04-14 14:44   ` Theodore Y. Ts'o
2020-04-14 15:52 ` Christoph Hellwig
2020-04-15  9:34   ` Jan Kara [this message]
2020-04-16  5:36     ` Christoph Hellwig

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=20200415093459.GH501@quack2.suse.cz \
    --to=jack@suse.cz \
    --cc=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hch@infradead.org \
    --cc=linux-block@vger.kernel.org \
    --cc=tj@kernel.org \
    --cc=tytso@mit.edu \
    --cc=yuyufen@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).