From: Yu Kuai <yukuai1@huaweicloud.com>
To: Yu Kuai <yukuai1@huaweicloud.com>,
Liu Shixin <liushixin2@huawei.com>, Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
"yukuai (C)" <yukuai3@huawei.com>
Subject: Re: [PATCH] blk-mq: only unregister sysfs when registration succeeded
Date: Sat, 12 Nov 2022 18:57:07 +0800 [thread overview]
Message-ID: <58ab3673-3e39-9ea9-1749-eebfcfb8a10f@huaweicloud.com> (raw)
In-Reply-To: <607beb5b-8d54-b795-8a05-76352d7ed863@huaweicloud.com>
在 2022/11/12 18:44, Yu Kuai 写道:
> Hi,
>
> 在 2022/11/12 19:07, Liu Shixin 写道:
>> kobject_del() must not be called if kobject_add() has not been called.
>> Hence only unregister sysfs when registration succeeded.
>>
>
> From what I see, the blk_queue_registered() from caller
> blk_unregister_queue() can already prevent that. QUEUE_FLAG_REGISTERED
> will only be set if blk_register_queue() succeed.
I see that the return value of blk_mq_sysfs_register() is not checked
from blk_register_queue(), there will be memleak or uaf from error path.
Hence I think better thing to do is to handle the case that
blk_mq_sysfs_register() faild, and clean up if blk_mq_sysfs_register()
succeed while follow up procedures failed from blk_register_queue().
prev parent reply other threads:[~2022-11-12 10:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-12 11:07 Liu Shixin
2022-11-12 10:44 ` Yu Kuai
2022-11-12 10:57 ` Yu Kuai [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=58ab3673-3e39-9ea9-1749-eebfcfb8a10f@huaweicloud.com \
--to=yukuai1@huaweicloud.com \
--cc=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liushixin2@huawei.com \
--cc=yukuai3@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
all inboxes | Powered by JetHome®