Skip to content

prevent uninitialized access in black_box for zero-sized-types #104110

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Nov 12, 2022

Conversation

krasimirgg
Copy link
Contributor

@krasimirgg krasimirgg commented Nov 7, 2022

Don't read the pointer location in black_box for zero sized types, just emit a memory clobber instead. Addresses #103304 when rust is build against LLVM at HEAD.

Zulip thread: https://rust-lang.zulipchat.com/#narrow/stream/187780-t-compiler.2Fwg-llvm/topic/.28with.20llvm.20at.20HEAD.29.3A.20msan.20error.20in.20core.3A.3Ahint.3A.3Ablack_box

@rustbot
Copy link
Collaborator

rustbot commented Nov 7, 2022

r? @davidtwco

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 7, 2022
@krasimirgg krasimirgg changed the title prevent uninitialized access in black_box for zero-sized-types (WIP) prevent uninitialized access in black_box for zero-sized-types Nov 7, 2022
@davidtwco
Copy link
Member

r? @nagisa

@rustbot rustbot assigned nagisa and unassigned davidtwco Nov 7, 2022
@rust-log-analyzer

This comment has been minimized.

@krasimirgg krasimirgg changed the title (WIP) prevent uninitialized access in black_box for zero-sized-types prevent uninitialized access in black_box for zero-sized-types Nov 8, 2022
@krasimirgg krasimirgg marked this pull request as ready for review November 8, 2022 13:31
@durin42
Copy link
Contributor

durin42 commented Nov 8, 2022

@rustbot label +llvm-main

@rustbot
Copy link
Collaborator

rustbot commented Nov 8, 2022

Error: Label llvm-main can only be set by Rust team members

Please file an issue on GitHub at triagebot if there's a problem with this bot, or reach out on #t-infra on Zulip.

@cuviper cuviper added the llvm-main Marks PRs that are making Rust work with LLVM main (this label is consumed by CI tooling) label Nov 8, 2022
@nagisa
Copy link
Member

nagisa commented Nov 8, 2022

@bors r+

@bors
Copy link
Collaborator

bors commented Nov 8, 2022

📌 Commit 0e0bcd9 has been approved by nagisa

It is now in the queue for this repository.

@bors 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 Nov 8, 2022
Manishearth added a commit to Manishearth/rust that referenced this pull request Nov 10, 2022
prevent uninitialized access in black_box for zero-sized-types

Don't read the pointer location in black_box for zero sized types, just emit a memory clobber instead. Addresses  rust-lang#103304 when rust is build against LLVM at HEAD.

Zulip thread: https://rust-lang.zulipchat.com/#narrow/stream/187780-t-compiler.2Fwg-llvm/topic/.28with.20llvm.20at.20HEAD.29.3A.20msan.20error.20in.20core.3A.3Ahint.3A.3Ablack_box
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Nov 10, 2022
prevent uninitialized access in black_box for zero-sized-types

Don't read the pointer location in black_box for zero sized types, just emit a memory clobber instead. Addresses  rust-lang#103304 when rust is build against LLVM at HEAD.

Zulip thread: https://rust-lang.zulipchat.com/#narrow/stream/187780-t-compiler.2Fwg-llvm/topic/.28with.20llvm.20at.20HEAD.29.3A.20msan.20error.20in.20core.3A.3Ahint.3A.3Ablack_box
Manishearth added a commit to Manishearth/rust that referenced this pull request Nov 11, 2022
prevent uninitialized access in black_box for zero-sized-types

Don't read the pointer location in black_box for zero sized types, just emit a memory clobber instead. Addresses  rust-lang#103304 when rust is build against LLVM at HEAD.

Zulip thread: https://rust-lang.zulipchat.com/#narrow/stream/187780-t-compiler.2Fwg-llvm/topic/.28with.20llvm.20at.20HEAD.29.3A.20msan.20error.20in.20core.3A.3Ahint.3A.3Ablack_box
Manishearth added a commit to Manishearth/rust that referenced this pull request Nov 11, 2022
prevent uninitialized access in black_box for zero-sized-types

Don't read the pointer location in black_box for zero sized types, just emit a memory clobber instead. Addresses  rust-lang#103304 when rust is build against LLVM at HEAD.

Zulip thread: https://rust-lang.zulipchat.com/#narrow/stream/187780-t-compiler.2Fwg-llvm/topic/.28with.20llvm.20at.20HEAD.29.3A.20msan.20error.20in.20core.3A.3Ahint.3A.3Ablack_box
Manishearth added a commit to Manishearth/rust that referenced this pull request Nov 11, 2022
prevent uninitialized access in black_box for zero-sized-types

Don't read the pointer location in black_box for zero sized types, just emit a memory clobber instead. Addresses  rust-lang#103304 when rust is build against LLVM at HEAD.

Zulip thread: https://rust-lang.zulipchat.com/#narrow/stream/187780-t-compiler.2Fwg-llvm/topic/.28with.20llvm.20at.20HEAD.29.3A.20msan.20error.20in.20core.3A.3Ahint.3A.3Ablack_box
Manishearth added a commit to Manishearth/rust that referenced this pull request Nov 11, 2022
prevent uninitialized access in black_box for zero-sized-types

Don't read the pointer location in black_box for zero sized types, just emit a memory clobber instead. Addresses  rust-lang#103304 when rust is build against LLVM at HEAD.

Zulip thread: https://rust-lang.zulipchat.com/#narrow/stream/187780-t-compiler.2Fwg-llvm/topic/.28with.20llvm.20at.20HEAD.29.3A.20msan.20error.20in.20core.3A.3Ahint.3A.3Ablack_box
Manishearth added a commit to Manishearth/rust that referenced this pull request Nov 11, 2022
prevent uninitialized access in black_box for zero-sized-types

Don't read the pointer location in black_box for zero sized types, just emit a memory clobber instead. Addresses  rust-lang#103304 when rust is build against LLVM at HEAD.

Zulip thread: https://rust-lang.zulipchat.com/#narrow/stream/187780-t-compiler.2Fwg-llvm/topic/.28with.20llvm.20at.20HEAD.29.3A.20msan.20error.20in.20core.3A.3Ahint.3A.3Ablack_box
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Nov 12, 2022
prevent uninitialized access in black_box for zero-sized-types

Don't read the pointer location in black_box for zero sized types, just emit a memory clobber instead. Addresses  rust-lang#103304 when rust is build against LLVM at HEAD.

Zulip thread: https://rust-lang.zulipchat.com/#narrow/stream/187780-t-compiler.2Fwg-llvm/topic/.28with.20llvm.20at.20HEAD.29.3A.20msan.20error.20in.20core.3A.3Ahint.3A.3Ablack_box
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 12, 2022
…llaumeGomez

Rollup of 8 pull requests

Successful merges:

 - rust-lang#104110 (prevent uninitialized access in black_box for zero-sized-types)
 - rust-lang#104117 (Mark `trait_upcasting` feature no longer incomplete.)
 - rust-lang#104144 (Suggest removing unnecessary `.` to use a floating point literal)
 - rust-lang#104250 (Migrate no result page link color to CSS variables)
 - rust-lang#104261 (More accurately report error when formal and expected signature types differ)
 - rust-lang#104263 (Add a reference to ilog2 in leading_zeros integer docs)
 - rust-lang#104308 (Remove the old `ValidAlign` name)
 - rust-lang#104319 (Fix non clickable source link)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 798815a into rust-lang:master Nov 12, 2022
@rustbot rustbot added this to the 1.67.0 milestone Nov 12, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
llvm-main Marks PRs that are making Rust work with LLVM main (this label is consumed by CI tooling) 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants