Skip to contentSkip to conversation

Patch "nvme: do not reset controllers in NVME_CTRL_NEW state" has been added to the 6.6-stable tree

DISCUSSION Maurizio Lombardi 2 participants 2 messages Oct 5 1 message not in the archive Stable branch

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

Sasha,

Please remove this patch from the stable trees.

A regression has been reported and this patch must be reverted.
https://lore.kernel.org/linux-nvme/[email protected]/T/#mff8a81bd072a044c77e85070e754532d969155b2

Thanks.

po 5. 10. 2026 v 8:37 odesílatel Sasha Levin <[email protected]> napsal:

Quoted 65 lines

This is a note to let you know that I've just added the patch titled

nvme: do not reset controllers in NVME_CTRL_NEW state

to the 6.6-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
nvme-do-not-reset-controllers-in-nvme_ctrl_new-state.patch
and it can be found in the queue-6.6 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

commit 03198f12b3bd565406a3549fe54e2eac163ff506

Author: Maurizio Lombardi <[email protected]>
Date:   Tue Sep 15 11:58:27 2026 +0200

nvme: do not reset controllers in NVME_CTRL_NEW state

[ Upstream commit c20bba234f3e1dcd81f7a2ec21ea7bf01a4cf35f ]

During NVMe controller creation, the controller is exposed to sysfs via nvme_add_ctrl() while it is still in the NVME_CTRL_NEW state. This creates a narrow race window where a userspace process can write to the reset_controller sysfs node before the initialization thread transitions the state to NVME_CTRL_CONNECTING.

If a reset is triggered during this window, the state machine allows the transition from NVME_CTRL_NEW to NVME_CTRL_RESETTING, and the reset work is queued. However, the original creation thread continues its execution, subsequently moving the state to NVME_CTRL_CONNECTING and finally to NVME_CTRL_LIVE.

When the delayed reset work finally executes, it attempts to tear down the controller and transition the state to NVME_CTRL_CONNECTING. Because the state is now NVME_CTRL_LIVE, this transition fails, triggering a WARN_ON in the reset work.

Fix this by removing NVME_CTRL_NEW from the allowed prior states for the NVME_CTRL_RESETTING transition.

Fixes 8bfc3b4c6f9d ("nvmet: switch loopback target state to connecting when resetting")
Reported-by [email protected]
drivers/nvme/host/core.c +0 -1
index c34ecb2c96562..76d781aaf31fc 100644
@@ -512,7 +512,6 @@ bool nvme_change_ctrl_state(struct nvme_ctrl *ctrl,
                break;
        case NVME_CTRL_RESETTING:
                switch (old_state) {
-               case NVME_CTRL_NEW:
                case NVME_CTRL_LIVE:
                        changed = true;
                        fallthrough;
maintainer
#2 lore raw
Quoted 3 lines

Please remove this patch from the stable trees.

A regression has been reported and this patch must be reverted.

Dropped from all trees (7.2, 6.18, 6.12, 6.6, 6.1, 5.15 and 5.10). It stays out until upstream has a fix or a revert.

Signature · 2 lines
Thanks,
Sasha