From: Zheng Qixing <zhengqixing@huawei.com>
To: Lizhi Xu <lizhi.xu@windriver.com>, <zhengqixing@huaweicloud.com>
Cc: <axboe@kernel.dk>, <houtao1@huawei.com>, <josef@toxicpanda.com>,
<linan122@h-partners.com>, <linux-block@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <nbd@other.debian.org>,
<xiubli@redhat.com>, <yangerkun@huawei.com>,
<yi.zhang@huawei.com>
Subject: Re: [PATCH] nbd: defer config put in recv_work
Date: Mon, 10 Nov 2025 12:05:28 +0800 [thread overview]
Message-ID: <f5a2e5e7-d46e-45fa-bd28-c58bd7134d8e@huawei.com> (raw)
In-Reply-To: <20251110005453.546675-1-lizhi.xu@windriver.com>
Hi,
在 2025/11/10 8:54, Lizhi Xu 写道:
> On Sat, 8 Nov 2025 15:02:02 +0800, Zheng Qixing wrote:
>> Reported-by: syzbot+56fbf4c7ddf65e95c7cc@syzkaller.appspotmail.com
>> Closes: https://lore.kernel.org/all/6907edce.a70a0220.37351b.0014.GAE@google.com/T/
>> Fixes: 87aac3a80af5 ("nbd: make the config put is called before the notifying the waiter")
>> Depends-on: e2daec488c57 ("nbd: Fix hungtask when nbd_config_put")
>> Signed-off-by: Zheng Qixing <zhengqixing@huawei.com>
>> ---
>> drivers/block/nbd.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
>> index a853c65ac65d..215fc18115b7 100644
>> --- a/drivers/block/nbd.c
>> +++ b/drivers/block/nbd.c
>> @@ -1024,9 +1024,9 @@ static void recv_work(struct work_struct *work)
>> nbd_mark_nsock_dead(nbd, nsock, 1);
>> mutex_unlock(&nsock->tx_lock);
>>
>> - nbd_config_put(nbd);
>> atomic_dec(&config->recv_threads);
>> wake_up(&config->recv_wq);
>> + nbd_config_put(nbd);
>> kfree(args);
>> }
> This only makes the problem more hidden, and that's far from enough.
> I tested the same patch on syzbot on October 3rd before you did; you
> can check it out here [1].
>
> [1] https://syzkaller.appspot.com/bug?extid=56fbf4c7ddf65e95c7cc
The same patch was triggered by eslam.medhat1993 on Nov 5 via syzbot,
but it didn't produce the same stack trace. Is this stack trace necessarily
related to the UAF issue in nbd? It seems more likely to be a memory
corruption problem, but I'm not certain.
In addition, this issue arises from the mixed use of netlink and ioctl.
Since
user-space tools generally do not mix these two interfaces, I believe a
simple
solution along these lines could effectively avoid the UAF problem.
Regards,
Qixing
prev parent reply other threads:[~2025-11-10 4:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-08 7:02 Zheng Qixing
2025-11-08 13:40 ` Jens Axboe
2025-11-10 0:54 ` Lizhi Xu
2025-11-10 4:05 ` Zheng Qixing [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=f5a2e5e7-d46e-45fa-bd28-c58bd7134d8e@huawei.com \
--to=zhengqixing@huawei.com \
--cc=axboe@kernel.dk \
--cc=houtao1@huawei.com \
--cc=josef@toxicpanda.com \
--cc=linan122@h-partners.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lizhi.xu@windriver.com \
--cc=nbd@other.debian.org \
--cc=xiubli@redhat.com \
--cc=yangerkun@huawei.com \
--cc=yi.zhang@huawei.com \
--cc=zhengqixing@huaweicloud.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®