Repository navigation
Conversation
Author
|
Upstream branch: de52810 |
Author
|
Upstream branch: de52810 |
NVMET_MAX_ANAGRPS is the highest valid ANA group id, not the size of nvmet_ana_group_enabled[]: the array has NVMET_MAX_ANAGRPS + 1 entries and the controller advertises anagrpmax == NVMET_MAX_ANAGRPS. Both array_index_nospec() calls however pass NVMET_MAX_ANAGRPS as the size, so for the last group the mask is 0 and the index quietly becomes 0: - nvmet_ana_groups_make_group() increments enabled[0] while the group keeps grpid == 128, so the later nvmet_ana_group_release() decrements enabled[128], which underflows to 0xffffffff. The ANA log page then reports group 128 as inaccessible forever even though the configfs group no longer exists, and the increment on enabled[0] is never undone. - nvmet_ns_ana_grpid_store() accepts 128, stores 0 in ns->anagrpid and returns success, so the namespace silently stays in the default ANA group instead of the one the user asked for. Both failures are silent, and they change what the target reports in its ANA log page, which is what a host uses to select paths. Pass the real array size in both calls, so the masking is kept but the last group is no longer folded onto index 0. Fixes: 20dc66f ("nvme: prevent potential spectre v1 gadget") Cc: stable@vger.kernel.org Signed-off-by: Yuehong Wu <wuyuehong@cmss.chinamobile.com>
ghost
force-pushed
the
series/1203821=>for-next
branch
from
November 10, 2026 10:29
4e73c43 to
963e02f
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: nvmet: clamp the last ANA group index against the real array size
version: 1
url: https://patchwork.kernel.org/series/1203821/