-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
CTFE/Miri: detect out-of-bounds pointers in offset_from #94827
Merged
Merged
Conversation
This file contains 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
rustbot
added
the
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
label
Mar 10, 2022
Some changes occured to the CTFE / Miri engine cc @rust-lang/miri Some changes occured to the CTFE / Miri engine cc @rust-lang/miri |
rust-highfive
added
the
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
label
Mar 10, 2022
RalfJung
force-pushed
the
offset-from-ub
branch
from
March 10, 2022 23:33
1c45a93
to
8ad862a
Compare
This comment has been minimized.
This comment has been minimized.
RalfJung
force-pushed
the
offset-from-ub
branch
from
March 11, 2022 00:00
8ad862a
to
63ed8e4
Compare
@bors r+ |
📌 Commit 63ed8e4 has been approved by |
bors
added
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Mar 11, 2022
Dylan-DPC
added a commit
to Dylan-DPC/rust
that referenced
this pull request
Mar 11, 2022
CTFE/Miri: detect out-of-bounds pointers in offset_from Also I became uneasy with aggressively doing `try_to_int` here -- this will always succeed on Miri, leading to the wrong codepath being taken. We should rather try to convert them both to pointers, and use the integer path as a fallback, so that's what I implemented now. Hiding whitespaces helps with the diff. Fixes rust-lang/miri#1950 r? `@oli-obk`
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Mar 11, 2022
Rollup of 7 pull requests Successful merges: - rust-lang#87618 (Add missing documentation for std::char types) - rust-lang#94769 (Collapse blanket and auto-trait impls by default) - rust-lang#94798 (`parse_tt` refactorings) - rust-lang#94818 (Rename `IntoFuture::Future` to `IntoFuture::IntoFuture`) - rust-lang#94827 (CTFE/Miri: detect out-of-bounds pointers in offset_from) - rust-lang#94838 (Make float parsing docs more comprehensive) - rust-lang#94839 (Suggest using double colon when a struct field type include single colon) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 tasks
bors
added a commit
to rust-lang/miri
that referenced
this pull request
Mar 12, 2022
add ptr_offset_from OOB test, and update test errors The Miri side of rust-lang/rust#94827.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
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.
Also I became uneasy with aggressively doing
try_to_int
here -- this will always succeed on Miri, leading to the wrong codepath being taken. We should rather try to convert them both to pointers, and use the integer path as a fallback, so that's what I implemented now.Hiding whitespaces helps with the diff.
Fixes rust-lang/miri#1950
r? @oli-obk