Re: [PATCH 1/4] nvmet: fix NULL pointer dereference in nvmet_execute_identify_nslist()

Guixin Liu <[email protected]> Fri, 31 Jul 2026 09:57:27 +0800
Newsgroups org.infradead.lists.linux-nvme
Message-ID <[email protected]>

在 2026/7/30 19:34, Christoph Hellwig 写道:
> Looks good:
>
> Reviewed-by: Christoph Hellwig <[email protected]>
>
> On Thu, Jul 30, 2026 at 12:31:02PM +0800, Guixin Liu wrote:
>> When a host issues an Identify command with CNS 07h (Active Namespace ID
>> List for a specific I/O Command Set), nvmet_execute_identify_nslist() is
>> called with match_css set. The command-set filter dereferences req->ns,
>> but this handler never calls nvmet_req_find_ns(), so req->ns is always
>> NULL (nvmet_req_init() resets it to NULL). As soon as an enabled
>> namespace with an NSID greater than the requested value exists,
>> req->ns->csi dereferences a NULL pointer and oopses.
> Can you submit a testcase for that to blktests?
Sure, I will send a patch for that.

Best Regards,
Guixin Liu