From: Greg KH <gregkh@linuxfoundation.org>
To: Li Lingfeng <lilingfeng@huaweicloud.com>
Cc: stable@vger.kernel.org, jsperbeck@google.com, beanhuo@micron.com,
hch@lst.de, axboe@kernel.dk, sashal@kernel.org,
yukuai1@huaweicloud.com, houtao1@huawei.com, yi.zhang@huawei.com,
yangerkun@huawei.com, lilingfeng3@huawei.com
Subject: Re: [PATCH 5.10] nvme: use nvme_cid to generate command_id in trace event
Date: Fri, 29 Mar 2024 12:59:54 +0100 [thread overview]
Message-ID: <2024032924-cadet-purely-06a9@gregkh> (raw)
In-Reply-To: <20240306112506.1699133-1-lilingfeng@huaweicloud.com>
On Wed, Mar 06, 2024 at 07:25:06PM +0800, Li Lingfeng wrote:
> From: Li Lingfeng <lilingfeng3@huawei.com>
>
> A null-ptr-deref problem may occur since commit 706960d328f5 ("nvme: use
> command_id instead of req->tag in trace_nvme_complete_rq()") tries to get
> command_id by nvme_req(req)->cmd while nvme_req(req)->cmd is NULL.
> The problem has been sloved since the patch has been reverted by commit
> 929ba86476b3. However, cmd->common.command_id is set to req->tag again
> which should be ((genctl & 0xf)< 12 | req->tag).
> Generating command_id by nvme_cid() in trace event instead of
> nvme_req(req)->cmd->common.command_id to set it to
> ((genctl & 0xf)< 12 | req->tag) without trigging the null-ptr-deref
> problem.
>
> Fixes: commit 706960d328f5 ("nvme: use command_id instead of req->tag in trace_nvme_complete_rq()")
This committ is reverted in the 5.10.208 release, so is this change
still needed?
thanks,
greg k-h
next prev parent reply other threads:[~2024-03-29 11:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-06 11:25 [PATCH 5.10] nvme: use nvme_cid to generate command_id in trace event Li Lingfeng
2024-03-29 11:59 ` Greg KH [this message]
2024-03-30 1:30 ` Li Lingfeng
2024-03-30 6:58 ` Greg KH
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=2024032924-cadet-purely-06a9@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=axboe@kernel.dk \
--cc=beanhuo@micron.com \
--cc=hch@lst.de \
--cc=houtao1@huawei.com \
--cc=jsperbeck@google.com \
--cc=lilingfeng3@huawei.com \
--cc=lilingfeng@huaweicloud.com \
--cc=sashal@kernel.org \
--cc=stable@vger.kernel.org \
--cc=yangerkun@huawei.com \
--cc=yi.zhang@huawei.com \
--cc=yukuai1@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