-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Unsoundness: Patterns in function parameters are not checked for union access #130528
Labels
C-bug
Category: This is a bug.
I-unsound
Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness
P-critical
Critical priority
regression-from-stable-to-stable
Performance or correctness regression from one stable version to another.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
rustbot
added
the
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
label
Sep 18, 2024
Urgau
added
regression-from-stable-to-stable
Performance or correctness regression from one stable version to another.
I-unsound
Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness
labels
Sep 18, 2024
rustbot
added
I-prioritize
Issue: Indicates that prioritization has been requested for this issue.
labels
Sep 18, 2024
Seems to have regressed between 1.76 and 1.77. In 1.76 (and below) it gave:
It's probably related to the THIR unsafeck which was stabilized in that release. |
I'll take a look at this. I think I may have found out what's going on. @rustbot claim |
This was referenced Sep 18, 2024
saethlin
added
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
and removed
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
labels
Sep 18, 2024
workingjubilee
added a commit
to workingjubilee/rustc
that referenced
this issue
Sep 19, 2024
…m, r=Urgau Check params for unsafety in THIR Self-explanatory. I'm not surprised this was overlooked, given the way that THIR visitors work. Perhaps we should provide a better entrypoint. Fixes rust-lang#130528
workingjubilee
added a commit
to workingjubilee/rustc
that referenced
this issue
Sep 19, 2024
…m, r=Urgau Check params for unsafety in THIR Self-explanatory. I'm not surprised this was overlooked, given the way that THIR visitors work. Perhaps we should provide a better entrypoint. Fixes rust-lang#130528
workingjubilee
added a commit
to workingjubilee/rustc
that referenced
this issue
Sep 19, 2024
…, r=Nadrieril Never patterns constitute a read for unsafety This code is otherwise unsound if we don't emit an unsafety error here. Noticed when fixing rust-lang#130528, but it's totally unrelated. r? `@Nadrieril`
WG-prioritization assigning priority (Zulip discussion). @rustbot label -I-prioritize +P-critical |
rustbot
added
P-critical
Critical priority
and removed
I-prioritize
Issue: Indicates that prioritization has been requested for this issue.
labels
Sep 19, 2024
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Sep 19, 2024
Rollup merge of rust-lang#130533 - compiler-errors:never-pat-unsafeck, r=Nadrieril Never patterns constitute a read for unsafety This code is otherwise unsound if we don't emit an unsafety error here. Noticed when fixing rust-lang#130528, but it's totally unrelated. r? `@Nadrieril`
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Sep 19, 2024
Rollup merge of rust-lang#130531 - compiler-errors:thir-unsafeck-param, r=Urgau Check params for unsafety in THIR Self-explanatory. I'm not surprised this was overlooked, given the way that THIR visitors work. Perhaps we should provide a better entrypoint. Fixes rust-lang#130528
Reopening for beta nomination. |
Fix backported via #130531 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
C-bug
Category: This is a bug.
I-unsound
Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness
P-critical
Critical priority
regression-from-stable-to-stable
Performance or correctness regression from one stable version to another.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I tried this code:
Playground.
I expected to see this happen: rustc rejecting this code. We are transmuting arbitrary types without unsafe, this is clearly unsound.
Instead, this happened: rustc accepted this code, and it SIGSEGVs at runtime.
The text was updated successfully, but these errors were encountered: