Repository navigation
Conversation
Author
|
Upstream branch: de52810 |
Author
|
Upstream branch: de52810 |
Multiple BUGs were seen after the following sequence: 1) ctrl A in subsys A allocs ns nvmeAcAn1 and ns_head nvmeAn1 and sets both as live 2) ctrl B in subsys A allocs ns nvmeAcBn1 under ns_head nvmeAn1, but is interrupted or stalled between nvme_init_ns_head and healthy return 3) the namespace is removed from subsystem, triggering rescan 4) nvmeAcAn1 completes nvme_ns_remove 5) nvmeAcBn1 allocation returns through an error pathway in nvme_alloc_ns In this sequence, when nvmeAcBn1 returns, it is the last path and has the responsibility of shutting down the live ns_head, but does not call nvme_mpath_shutdown_disk. Failure to call nvme_mpath_shutdown_disk leaves the gendisk active in sysfs/devfs while components around it are freed. The result is that a new nvme_ns_head with the same namespace number cannot be created in sysfs and freed memory can be accessed through remaining userspace files. Most observed panics were seen from paths utilizing nvme_find_path, such as nuse_show or blkdev_ioctl, though occasionally corruption of the dpm list was detected as well. Fix here is to simply keep ns_head cleanup the same as nvme_ns_remove. This ensures we don't break delayed removal and that we clean up the gendisk when appropriate. Signed-off-by: Kyle Smith <kyles@hpe.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
ghost
force-pushed
the
series/1203581=>for-next
branch
from
November 10, 2026 10:31
8e79a13 to
17dcf72
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull request for series with
subject: nvme: Fix potential gendisk leak in nvme_alloc_ns
version: 1
url: https://patchwork.kernel.org/series/1203581/