Fix get msr index list for demo#80
Merged
Merged
Conversation
added 2 commits
October 22, 2021 11:38
Instead of using a pointer for the indices entry in kvm_msr_list, use a normal array and define the KVM_MSR_GET_INDEX_LIST ioctl using the _IOWR_LIST macro (see "shim/linux: add _IOWR_LIST macro"). Define MSR_LIST_MAX_INDICES to be 128, as this leaves some room to keep the stack frame < 1024 bytes. This may be too low of a max, but is plenty for our current QEMU and integration testing. Signed-off-by: Nick Rosbrook <rosbrookn@ainfosec.com>
The KVM API states that when the number of MSRs is greater than the value set in nmsrs by the caller, the kernel will set the correct value in nmsrs and return -E2BIG. This behavior was excluded from the first implementation of KVM_GET_MSR_INDEX_LIST. Define SHIM_2BIG so that other shim functions can implement this behavior, which is a common pattern in ioctls. Signed-off-by: Nick Rosbrook <rosbrookn@ainfosec.com>
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.
No description provided.