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

Enable ASLR for windows-gnu #75406

Merged
merged 1 commit into from
Oct 13, 2020
Merged

Enable ASLR for windows-gnu #75406

merged 1 commit into from
Oct 13, 2020

Conversation

mati865
Copy link
Contributor

@mati865 mati865 commented Aug 11, 2020

Fixes #16514
Fixes #16593
Fixes #17684

Passes the tests for me with x86_64 toolchain.

@rust-highfive
Copy link
Collaborator

r? @kennytm

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

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 11, 2020
@kennytm
Copy link
Member

kennytm commented Aug 12, 2020

@bors try

@bors
Copy link
Contributor

bors commented Aug 12, 2020

⌛ Trying commit 41e7b830c72706ac9967cb3307ef5937b8efe43b with merge 7cb9e7614df03dbbb4dae293eb27fcffa3df4987...

@rust-log-analyzer
Copy link
Collaborator

The job i686-mingw-1 of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
   Compiling gimli v0.22.0
   Compiling miniz_oxide v0.4.0
   Compiling object v0.20.0
   Compiling addr2line v0.13.0
error: linking with `i686-w64-mingw32-gcc` failed: exit code: 1
  |
  = note: "i686-w64-mingw32-gcc" "-fno-use-linker-plugin" "-Wl,--nxcompat" "-Wl,--dynamicbase" "-Wl,--high-entropy-va" "-Wl,--disable-auto-image-base" "-Wl,--large-address-aware" "-nostartfiles" "D:\\a\\rust\\rust\\mingw32\\i686-w64-mingw32\\lib\\dllcrt2.o" "D:\\a\\rust\\rust\\build\\i686-pc-windows-gnu\\stage1\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\rsbegin.o" "-L" "D:\\a\\rust\\rust\\mingw32\\i686-w64-mingw32\\lib" "-L" "D:\\a\\rust\\rust\\build\\i686-pc-windows-gnu\\stage1\\lib\\rustlib\\i686-pc-windows-gnu\\lib" "-L" "D:\\a\\rust\\rust\\build\\i686-pc-windows-gnu\\stage1\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\self-contained" "D:\\a\\rust\\rust\\build\\i686-pc-windows-gnu\\stage1-std\\i686-pc-windows-gnu\\release\\deps\\std-001c7c07237f5a53.std.2oi95g00-cgu.0.rcgu.o" "-o" "D:\\a\\rust\\rust\\build\\i686-pc-windows-gnu\\stage1-std\\i686-pc-windows-gnu\\release\\deps\\std-001c7c07237f5a53.dll" "-Wl,C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\rustchXSkpj\\list.def" "D:\\a\\rust\\rust\\build\\i686-pc-windows-gnu\\stage1-std\\i686-pc-windows-gnu\\release\\deps\\std-001c7c07237f5a53.2hraozlwyo1yhfwv.rcgu.o" "D:\\a\\rust\\rust\\build\\i686-pc-windows-gnu\\stage1-std\\i686-pc-windows-gnu\\release\\deps\\std-001c7c07237f5a53.1hjeje4fj01jxwde.rcgu.o" "-shared" "-Wl,--out-implib,D:\\a\\rust\\rust\\build\\i686-pc-windows-gnu\\stage1-std\\i686-pc-windows-gnu\\release\\deps\\libstd-001c7c07237f5a53.dll.a" "-nodefaultlibs" "-L" "D:\\a\\rust\\rust\\build\\i686-pc-windows-gnu\\stage1-std\\i686-pc-windows-gnu\\release\\deps" "-L" "D:\\a\\rust\\rust\\build\\i686-pc-windows-gnu\\stage1-std\\release\\deps" "-L" "D:\\a\\rust\\rust\\build\\i686-pc-windows-gnu\\stage1-std\\i686-pc-windows-gnu\\release\\build\\compiler_builtins-9c3d08aa6513a296\\out" "-L" "D:\\a\\rust\\rust\\build\\i686-pc-windows-gnu\\stage1\\lib\\rustlib\\i686-pc-windows-gnu\\lib" "-ladvapi32" "-lws2_32" "-luserenv" "-Wl,-Bstatic" "-Wl,--whole-archive" "C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\rustchXSkpj\\libpanic_unwind-b835dd322c68c1f1.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\rustchXSkpj\\libobject-39cb832dd7b4fe6c.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\rustchXSkpj\\libaddr2line-4c97ef5a0e76d72a.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\rustchXSkpj\\libgimli-2fe4a88c7896e835.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\rustchXSkpj\\librustc_demangle-64d2fa27da74b60c.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\rustchXSkpj\\libhashbrown-a5eaa47a1565eb3e.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\rustchXSkpj\\librustc_std_workspace_alloc-62f28998d5602550.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\rustchXSkpj\\libunwind-1cae5105b9d9a6cf.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\rustchXSkpj\\libcfg_if-a8c586b295602734.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\rustchXSkpj\\liblibc-ecd3b8c387994089.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\rustchXSkpj\\liballoc-cab34448e6c5a1a9.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\rustchXSkpj\\librustc_std_workspace_core-b320f0b9b23c3ba1.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\rustchXSkpj\\libcore-bd38834d04123d9c.rlib" "-Wl,--no-whole-archive" "C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\rustchXSkpj\\libcompiler_builtins-4ad5645d782c03f2.rlib" "-Wl,-Bdynamic" "-lmsvcrt" "-lmingwex" "-lmingw32" "-lmsvcrt" "-luser32" "-lkernel32" "-lgcc_s" "-lgcc" "-lkernel32" "D:\\a\\rust\\rust\\build\\i686-pc-windows-gnu\\stage1\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\rsend.o"
  = note: D:/a/rust/rust/mingw32/bin/../lib/gcc/i686-w64-mingw32/6.3.0/../../../../i686-w64-mingw32/bin/ld.exe: unrecognized option '--high-entropy-va'

          D:/a/rust/rust/mingw32/bin/../lib/gcc/i686-w64-mingw32/6.3.0/../../../../i686-w64-mingw32/bin/ld.exe: use the --help option for usage information

          collect2.exe: error: ld returned 1 exit status
          

error: aborting due to previous error


error: could not compile `std`.

To learn more, run the command again with --verbose.
command did not execute successfully: "D:\\a\\rust\\rust\\build\\i686-pc-windows-gnu\\stage0\\bin\\cargo.exe" "build" "--target" "i686-pc-windows-gnu" "-Zbinary-dep-depinfo" "-j" "8" "--release" "--locked" "--color" "always" "--features" "panic-unwind backtrace compiler-builtins-c" "--manifest-path" "D:\\a\\rust\\rust\\library/test/Cargo.toml" "--message-format" "json-render-diagnostics"
failed to run: D:\a\rust\rust\build\bootstrap\debug\bootstrap test --stage 2 --exclude src/test/ui --exclude src/test/compile-fail
Build completed unsuccessfully in 0:16:31
Build completed unsuccessfully in 0:16:31
make: *** [Makefile:82: ci-mingw-subset-1] Error 1
  local time: Wed Aug 12 08:32:58 CUT 2020
  network time: Wed, 12 Aug 2020 08:32:58 GMT
== end clock drift check ==
== end clock drift check ==
##[error]Process completed with exit code 2.
Terminate orphan process: pid (4700) (python)
Terminate orphan process: pid (1464) (sccache)

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @rust-lang/infra. (Feature Requests)

@bors
Copy link
Contributor

bors commented Aug 12, 2020

💔 Test failed - checks-actions

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 12, 2020
@mati865
Copy link
Contributor Author

mati865 commented Aug 12, 2020

LLD ignores --high-entropy-va when linking 32 bit binaries but LD apparently throws the error.

Force pushed to enable high entropy only on 64 bit targets.

@kennytm
Copy link
Member

kennytm commented Aug 12, 2020

@bors try

@bors
Copy link
Contributor

bors commented Aug 12, 2020

⌛ Trying commit 372725d05a26a4a1350efec8943c93aec8fd5633 with merge b5ba1d6ee3722c4f81fecc22d300e07ba401af02...

@bors
Copy link
Contributor

bors commented Aug 12, 2020

☀️ Try build successful - checks-actions, checks-azure
Build commit: b5ba1d6ee3722c4f81fecc22d300e07ba401af02 (b5ba1d6ee3722c4f81fecc22d300e07ba401af02)

@mati865
Copy link
Contributor Author

mati865 commented Aug 12, 2020

Looks good but I don't know who would be the right reviewer here.
There are 2 weeks to beta so I think it would be nice if this landed soonish and was reverted for beta so we have more than 6 weeks of testing here.

@crlf0710 crlf0710 added O-windows Operating system: Windows O-windows-gnu Toolchain: GNU, Operating system: Windows S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 28, 2020
@crlf0710
Copy link
Member

Ping from triage, there's merge conflicts now.

@bors

This comment has been minimized.

@mati865
Copy link
Contributor Author

mati865 commented Aug 31, 2020

@Dylan-DPC-zz
Copy link

@bors try

@bors
Copy link
Contributor

bors commented Sep 15, 2020

⌛ Trying commit 0ad3da0 with merge 7beae27597059d3c7a90c62c24c93fdaaafc2d1b...

@bors
Copy link
Contributor

bors commented Sep 15, 2020

☀️ Try build successful - checks-actions, checks-azure
Build commit: 7beae27597059d3c7a90c62c24c93fdaaafc2d1b (7beae27597059d3c7a90c62c24c93fdaaafc2d1b)

@crlf0710 crlf0710 added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 8, 2020
@Dylan-DPC-zz
Copy link

r? @Mark-Simulacrum

@Mark-Simulacrum
Copy link
Member

I am inclined to just land this -- certainly seems like an improvement.

I agree that getting this tested for longer would be good; we can let it land in 1.50 (as opposed to 1.49) for example, though I am likely to forget about this by the time we promote master to beta in ~5 weeks.

@bors r+ rollup=never

@bors
Copy link
Contributor

bors commented Oct 13, 2020

📌 Commit 0ad3da0 has been approved by Mark-Simulacrum

@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 Oct 13, 2020
@bors
Copy link
Contributor

bors commented Oct 13, 2020

⌛ Testing commit 0ad3da0 with merge d65c08e...

@mati865
Copy link
Contributor Author

mati865 commented Oct 13, 2020

I agree that getting this tested for longer would be good; we can let it land in 1.50 (as opposed to 1.49) for example, though I am likely to forget about this by the time we promote master to beta in ~5 weeks.

I'll set up reminder if it lands.

@bors
Copy link
Contributor

bors commented Oct 13, 2020

☀️ Test successful - checks-actions, checks-azure
Approved by: Mark-Simulacrum
Pushing d65c08e to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 13, 2020
@bors bors merged commit d65c08e into rust-lang:master Oct 13, 2020
@rustbot rustbot added this to the 1.49.0 milestone Oct 13, 2020
@mati865 mati865 deleted the mingw-aslr branch October 13, 2020 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. O-windows Operating system: Windows O-windows-gnu Toolchain: GNU, Operating system: Windows S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ASLR on Windows breaks thread-local variables use high entropy ASLR on 64-bit Windows use ASLR on Windows
9 participants