Skip to content
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

Fix strict provenance use of pointers #100

Merged
merged 1 commit into from
Apr 10, 2023
Merged

Fix strict provenance use of pointers #100

merged 1 commit into from
Apr 10, 2023

Conversation

jamesmunns
Copy link
Owner

No description provided.

@netlify
Copy link

netlify bot commented Apr 10, 2023

Deploy Preview for cute-starship-2d9c9b canceled.

Name Link
🔨 Latest commit c5c4111
🔍 Latest deploy log https://app.netlify.com/sites/cute-starship-2d9c9b/deploys/64335e0d0350cd0008e98cde

@jamesmunns
Copy link
Owner Author

Adding miri failure output in case someone searches for it in the future:

error: Undefined Behavior: attempting a write access using <22282> at alloc4545[0x0], but that tag does not exist in the borrow stack for this location
   --> /Users/will/.cargo/registry/src/index.crates.io-6f17d22bba15001f/postcard-1.0.4/src/ser/flavors.rs:179:17
    |
179 | ...   core::ptr::copy_nonoverlapping(b.as_ptr(), self.cursor, blen);
    |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |       |
    |       attempting a write access using <22282> at alloc4545[0x0], but that tag does not exist in the borrow stack for this location
    |       this error occurs as part of an access at alloc4545[0x0..0x1]
    |
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
help: <22282> was created by a SharedReadWrite retag at offsets [0x0..0x1e0]
   --> examples/main.rs:20:25
    |
20  | ...ice = postcard::to_slice(data, &mut self.data[ix.to_usize()])?;
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: <22282> was later invalidated at offsets [0x0..0x1e0] by a Unique function-entry retag inside this call
   --> examples/main.rs:20:25
    |
20  | ...ice = postcard::to_slice(data, &mut self.data[ix.to_usize()])?;
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ```

@jamesmunns jamesmunns merged commit 978b561 into main Apr 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant