1. 09 9月, 2021 10 次提交
  2. 08 9月, 2021 11 次提交
  3. 07 9月, 2021 14 次提交
    • B
      Auto merge of #88710 - Mark-Simulacrum:tyvid-idx, r=jackh726 · 69c4aa29
      bors 提交于
      Use index newtyping for TyVid
      
      This is useful for using TyVid in types like VecGraph, and just otherwise seems like a small win.
      69c4aa29
    • M
      Bump RLS submodule · c13808fb
      Mark Rousskov 提交于
      c13808fb
    • B
      Auto merge of #88161 - michaelwoerister:fix-whole-archive-no-bundle, r=petrochenkov · 73641cd2
      bors 提交于
      Fix handling of +whole-archive native link modifier.
      
      This PR fixes a bug in `add_upstream_native_libraries` that led to the `+whole-archive` modifier being ignored when linking in native libs.
      
      ~~Note that the PR does not address the situation when `+whole-archive` is combined with `+bundle`.~~
      `@wesleywiser's` commit adds validation code that turns combining `+whole-archive` with `+bundle` into an error.
      
      Fixes https://github.com/rust-lang/rust/issues/88085.
      
      r? `@petrochenkov`
      cc `@wesleywiser` `@gcoakes`
      73641cd2
    • M
    • J
      Fix docs for `uX::checked_next_multiple_of` · 56bb6f5a
      Jacob Pratt 提交于
      56bb6f5a
    • B
      Auto merge of #88689 - Aaron1011:confused-std-resolver, r=cjgillot · 385f8e20
      bors 提交于
      Move `confused_type_with_std_module` to `ResolverOutputs`
      
      This eliminates untracked global state from `Session`.
      385f8e20
    • M
      Use index newtyping for TyVid · 2eac09d2
      Mark Rousskov 提交于
      2eac09d2
    • B
      Auto merge of #88448 - xu-cheng:btree-blk-build, r=Mark-Simulacrum · ffaf8570
      bors 提交于
      BTreeMap/BTreeSet::from_iter: use bulk building to improve the performance
      
      Bulk building is a common technique to increase the performance of building a fresh btree map. Instead of inserting items one-by-one, we sort all the items beforehand then create the BtreeMap in bulk.
      
      Benchmark
      ```
      ./x.py bench library/alloc --test-args btree::map::from_iter
      ```
      
      * Before
      ```
      test btree::map::from_iter_rand_100                      ... bench:       3,694 ns/iter (+/- 840)
      test btree::map::from_iter_rand_10_000                   ... bench:   1,033,446 ns/iter (+/- 192,950)
      test btree::map::from_iter_seq_100                       ... bench:       5,689 ns/iter (+/- 1,259)
      test btree::map::from_iter_seq_10_000                    ... bench:     861,033 ns/iter (+/- 118,815)
      ```
      
      * After
      ```
      test btree::map::from_iter_rand_100                      ... bench:       3,033 ns/iter (+/- 707)
      test btree::map::from_iter_rand_10_000                   ... bench:     775,958 ns/iter (+/- 105,152)
      test btree::map::from_iter_seq_100                       ... bench:       2,969 ns/iter (+/- 336)
      test btree::map::from_iter_seq_10_000                    ... bench:     258,292 ns/iter (+/- 29,364)
      ```
      ffaf8570
    • B
      Auto merge of #83214 - cjgillot:dep-map, r=michaelwoerister · 11bbb523
      bors 提交于
      Mmap the incremental data instead of reading it.
      
      Instead of reading the full incremental state using `fs::read_file`, we memmap it using a private read-only file-backed map.
      This allows the system to reclaim any memory we are not using, while ensuring we are not polluted by
      outside modifications to the file.
      
      Suggested in https://github.com/rust-lang/rust/pull/83036#issuecomment-800458082 by `@bjorn3`
      11bbb523
    • B
      Auto merge of #88692 - hyd-dev:miri, r=RalfJung · 1698e3ca
      bors 提交于
      Update Miri
      
      Fixes #88671.
      
      r? `@RalfJung`
      1698e3ca
    • H
      Update `Cargo.lock` · e671c356
      hyd-dev 提交于
      e671c356
    • H
      Update Miri · 6eec72ed
      hyd-dev 提交于
      6eec72ed
    • A
      Move `confused_type_with_std_module` to `ResolverOutputs` · 40440243
      Aaron Hill 提交于
      This eliminates untracked global state from `Session`.
      40440243
    • B
      Auto merge of #88362 - pietroalbini:bump-stage0, r=Mark-Simulacrum · 8ceea01b
      bors 提交于
      Pin bootstrap checksums and add a tool to update it automatically
      
        This is just a proactive hardening we're performing on the build system, and it's not prompted by any known compromise. If you're aware of security issues being exploited please [check out our responsible disclosure page](https://www.rust-lang.org/policies/security).  
      
      ---
      
      This PR aims to improve Rust's supply chain security by pinning the checksums of the bootstrap compiler downloaded by `x.py`, preventing a compromised `static.rust-lang.org` from affecting building the compiler. The checksums are stored in `src/stage0.json`, which replaces `src/stage0.txt`. This PR also adds a tool to automatically update the bootstrap compiler.
      
      The changes in this PR were originally discussed in [Zulip](https://zulip-archive.rust-lang.org/stream/241545-t-release/topic/pinning.20stage0.20hashes.html).
      
      ## Potential attack
      
      Before this PR, an attacker who wanted to compromise the bootstrap compiler would "just" need to:
      
      1. Gain write access to `static.rust-lang.org`, either by compromising DNS or the underlying storage.
      2. Upload compromised binaries and corresponding `.sha256` files to `static.rust-lang.org`.
      
      There is no signature verification in `x.py` as we don't want the build system to depend on GPG. Also, since the checksums were not pinned inside the repository, they were downloaded from `static.rust-lang.org` too: this only protected from accidental changes in `static.rust-lang.org` that didn't change the `*.sha256` files. The attack would allow the attacker to compromise past and future invocations of `x.py`.
      
      ## Mitigations introduced in this PR
      
      This PR adds pinned checksums for all the bootstrap components in `src/stage0.json` instead of downloading the checksums from `static.rust-lang.org`. This changes the attack scenario to:
      
      1. Gain write access to `static.rust-lang.org`, either by compromising DNS or the underlying storage.
      2. Upload compromised binaries to `static.rust-lang.org`.
      3. Land a (reviewed) change in the `rust-lang/rust` repository changing the pinned hashes.
      
      Even with a successful attack, existing clones of the Rust repository won't be affected, and once the attack is detected reverting the pinned hashes changes should be enough to be protected from the attack. This also enables further mitigations to be implemented in following PRs, such as verifying signatures when pinning new checksums (removing the trust on first use aspect of this PR) and adding a check in CI making sure a PR updating the checksum has not been tampered with (see the future improvements section).
      
      ## Additional changes
      
      There are additional changes implemented in this PR to enable the mitigation:
      
      * The `src/stage0.txt` file has been replaced with `src/stage0.json`. The reasoning for the change is that there is existing tooling to read and manipulate JSON files compared to the custom format we were using before, and the slight challenge of manually editing JSON files (no comments, no trailing commas) are not a problem thanks to the new `bump-stage0`.
      
      * A new tool has been added to the repository, `bump-stage0`. When invoked, the tool automatically calculates which release should be used as the bootstrap compiler given the current version and channel, gathers all the relevant checksums and updates `src/stage0.json`. The tool can be invoked by running:
      
        ```
        ./x.py run src/tools/bump-stage0
        ```
      
      * Support for downloading releases from `https://dev-static.rust-lang.org` has been removed, as it's not possible to verify checksums there (it's customary to replace existing artifacts there if a rebuild is warranted). This will require a change to the release process to avoid bumping the bootstrap compiler on beta before the stable release.
      
      ## Future improvements
      
      * Add signature verification as part of `bump-stage0`, which would require the attacker to also obtain the release signing keys in order to successfully compromise the bootstrap compiler. This would be fine to add now, as the burden of installing the tool to verify signatures would only be placed on whoever updates the bootstrap compiler, instead of everyone compiling Rust.
      
      * Add a check on CI that ensures the checksums in `src/stage0.json` are the expected ones. If a PR changes the stage0 file CI should also run the `bump-stage0` tool and fail if the output in CI doesn't match the committed file. This prevents the PR author from tweaking the output of the tool manually, which would otherwise be close to impossible for a human to detect.
      
      * Automate creating the PRs bumping the bootstrap compiler, by setting up a scheduled job in GitHub Actions that runs the tool and opens a PR.
      
      * Investigate whether a similar mitigation can be done for "download from CI" components like the prebuilt LLVM.
      
      r? `@Mark-Simulacrum`
      8ceea01b
  4. 06 9月, 2021 5 次提交