-
Notifications
You must be signed in to change notification settings - Fork 105
Follow-up to #368 — change verification to follow new vm-memory code #371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Updates the requirements on [vm-memory](https://github.com/rust-vmm/vm-memory) to permit the latest version. Updates `vm-memory` to 0.17.1 - [Release notes](https://github.com/rust-vmm/vm-memory/releases) - [Changelog](https://github.com/rust-vmm/vm-memory/blob/v0.16.1/CHANGELOG.md) - [Commits](rust-vmm/vm-memory@v0.16.0...v0.17.1) --- updated-dependencies: - dependency-name: vm-memory dependency-version: 0.17.1 dependency-type: direct:production dependency-group: vm-virtio ... Signed-off-by: dependabot[bot] <[email protected]> [SG: Set the right version in the commit message and updated vm-memory also in fuzz/] [SG: Adapted `fuzz/common/src/vsock.rs` to the new vm-memory code] Signed-off-by: Stefano Garzarella <[email protected]>
359b643 to
0131f3f
Compare
|
Will fix the build failures |
0131f3f to
cd2426d
Compare
|
The GuestMemory architecture has changed beyond the addition/deletion of methods. Currently load from our StubRegion is not working. Likely an unwrap is being called on the value being loaded (the happy path is that there is no failure and hence kani does not have to compute an error message) and I suspect rust-vmm/vm-memory#339 is the source of the issue. I ran out of time to look more into this. Can someone who is familiar with vm-memory take a look? |
|
|
I would need someone to explain more verbosely what's going on. :) the linked PR changes get_slice() to an iterator, is that related? |
|
Yes, at least a stack trace to know where the failure is would be good.
As far as I can tell, the only panic that it adds to the rust-vmm/vm-memory#349 added another panic, checking that |
|
This is the full error So it looks like an Replacing various So the problem is not a new |
|
Ah, I think I got it. As far as I can tell, the error comes from the default impl |
|
Adding this to fn get_slice(
&self,
offset: MemoryRegionAddress,
count: usize,
) -> GuestMemoryResult<VolatileSlice<()>> {
Ok(unsafe {
VolatileSlice::with_bitmap(
self.buffer.add(offset.raw_value() as usize),
count,
(),
None,
)
})
}I don’t know if it’s right, I just copied it from https://github.com/rust-vmm/vm-memory/blob/main/src/mmap/unix.rs#L394 – but at least it does make the test pass. (EDIT: I really should add that it’s at least missing a bounds check.) |
|
@XanClic thank you very much! After applying your fix, now I have another failure that is unrelated to that issue. I guess it's related Otherwise we should disable kani in the CI, since we would like to do a new release with the new vm-memory to update vhost/vhot-devices. |
I will give a look, apologies for the delay. |
|
I looked into this a bit.
To validate this hypothesis, a programmer can manually unroll the iterator once and then iterate when References |
The only quick solution I can see is to 1) add Hanna's changes and 2) disable verify_add_used() for the moment. That we'll give us more time to understand how to fix it. |
verify_add_used is disabled until rust-vmm#373 is fixed Signed-off-by: Siddharth Priya <[email protected]>
cd2426d to
3259a54
Compare
|
Thanks @priyasiddharth! I think this PR can be split into two commits. First, the changes that correspond with following new vm-memory. Second, the disabling of the verify_add_used proof. WDYT? |
3 similar comments
|
Thanks @priyasiddharth! I think this PR can be split into two commits. First, the changes that correspond with following new vm-memory. Second, the disabling of the verify_add_used proof. WDYT? |
|
Thanks @priyasiddharth! I think this PR can be split into two commits. First, the changes that correspond with following new vm-memory. Second, the disabling of the verify_add_used proof. WDYT? |
|
Thanks @priyasiddharth! I think this PR can be split into two commits. First, the changes that correspond with following new vm-memory. Second, the disabling of the verify_add_used proof. WDYT? |
|
@stefano-garzarella (and code-owners) please add other comments also. I want to make all changes in a single shot if possible. |
Summary of the PR
Fix to virtio-queue verification code to follow new vm-memory code
Requirements
Before submitting your PR, please make sure you addressed the following
requirements:
git commit -s), and the commit message has max 60 characters for thesummary and max 75 characters for each description line.
test.
Release" section of CHANGELOG.md (if no such section exists, please create one).
unsafecode is properly documented.