[PATCH v2 1/3] nvme: fix a possible use-after-free in controller reset during load
Max Gurtovoy
mgurtovoy at nvidia.com
Thu Feb 3 07:47:42 PST 2022
On 2/3/2022 5:03 PM, Sagi Grimberg wrote:
>
>>> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
>>> index dd18861f77c0..c11cd3a814fd 100644
>>> --- a/drivers/nvme/host/core.c
>>> +++ b/drivers/nvme/host/core.c
>>> @@ -4251,6 +4251,8 @@ static void nvme_async_event_work(struct
>>> work_struct *work)
>>> container_of(work, struct nvme_ctrl, async_event_work);
>>> nvme_aen_uevent(ctrl);
>>> + if (ctrl->state != NVME_CTRL_LIVE)
>>> + return;
>>
>> any reason you moved the queue_ready check in the transport drivers ?
>>
>> Is it redundant ?
>>
>
> Yes, see the discussion with Christoph
The discussion was on the need for local variable, wasn't it ? not on
the need for the check itself.
But yes, I see it's redundant. this flush you added is actually
nvme_disable_aen (like we have nvme_start_keep_alive/nvme_stop_keep_alive).
I think it would be nice to have similar naming like we have for KA
(nvme_enable_aen/nvme_disable_aen) but the series looks good
with/without that,
Reviewed-by: Max Gurtovoy <mgurtovoy at nvidia.com>
More information about the Linux-nvme
mailing list