Skip to content

Conversation

fanquake
Copy link
Member

The binutils we use for gitian builds strips the reloc section from
Windows binaries, which breaks ASLR. As a temporary workaround, export
main(). This is the same workaround as #18702 (bitcoin-cli), and will
fix the currently failing security check:

+ make -j1 -C src check-security
make: Entering directory '/home/ubuntu/build/bitcoin/distsrc-x86_64-w64-mingw32/src'
Checking binary security...
bitcoin-util.exe: failed RELOC_SECTION
make: *** [check-security] Error 1

Relevant upstream issue:
https://sourceware.org/bugzilla/show_bug.cgi?id=19011

The binutils we use for gitian builds strips the reloc section from
Windows binaries, which breaks ASLR. As a temporary workaround, export
main(). This is the same workaround as bitcoin#18702 (bitcoin-cli), and will
fix the currently failing security check:
```bash
+ make -j1 -C src check-security
make: Entering directory '/home/ubuntu/build/bitcoin/distsrc-x86_64-w64-mingw32/src'
Checking binary security...
bitcoin-util.exe: failed RELOC_SECTION
make: *** [check-security] Error 1
```

Relevant upstream issue:
https://sourceware.org/bugzilla/show_bug.cgi?id=19011
@fanquake fanquake force-pushed the fix_bitcoin_util_reloc_section branch from c7ba085 to c061800 Compare January 15, 2021 03:53
@dongcarl
Copy link
Contributor

ACK c061800


Let's fix the builds and see if we need

bitcoin/src/bitcoin-cli.cpp

Lines 932 to 934 in 3b6d1b6

{
util::WinCmdLineArgs winArgs;
std::tie(argc, argv) = winArgs.get();
later

Tested on my windows machine and nothing failed catastrophically

@laanwj
Copy link
Member

laanwj commented Jan 16, 2021

Good catch!

ACK c061800

@laanwj laanwj merged commit 7acda55 into bitcoin:master Jan 17, 2021
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Jan 17, 2021
…oin-util

c061800 build: fix RELOC_SECTION security check for bitcoin-util (fanquake)

Pull request description:

  The binutils we use for gitian builds strips the reloc section from
  Windows binaries, which breaks ASLR. As a temporary workaround, export
  main(). This is the same workaround as bitcoin#18702 (bitcoin-cli), and will
  fix the currently failing security check:
  ```bash
  + make -j1 -C src check-security
  make: Entering directory '/home/ubuntu/build/bitcoin/distsrc-x86_64-w64-mingw32/src'
  Checking binary security...
  bitcoin-util.exe: failed RELOC_SECTION
  make: *** [check-security] Error 1
  ```

  Relevant upstream issue:
  https://sourceware.org/bugzilla/show_bug.cgi?id=19011

ACKs for top commit:
  dongcarl:
    ACK c061800
  laanwj:
    ACK c061800

Tree-SHA512: a1a4da0b2cddfc377190b9044a04f42a859ca79f11ce2c2ab4c3d066a2786c34d5446d75f8eec634f308d2d3349ebbd7c9f76dcaebeeb28e471c829851592367
@DrahtBot
Copy link
Contributor

Gitian builds

File commit 30e664d
(master)
commit 0552226
(master and this pull)
*-osx-unsigned.dmg 61b5ab6e94391ec7... 3934a6307e1fb48e...
*-osx64.tar.gz e92276d46559f171... eb19a3af6c642a24...
*.tar.gz 9be6af995f6e4f3b... 990b1ba73ce128b7...
bitcoin-core-osx-22-res.yml 4565877b1ef9f4a5... c84cb124adbc13c3...
linux-build.log 975ec704d8675956... 007cab9fc0111a21...
osx-build.log 4a491ad2d3ee3430... 67575dc86a235c8c...
win-build.log 6da2ae4d2d5c8c0b... e9c32782c0782a6c...
*-win64-debug.zip 6993364235f1b77b...
*-win64-setup-unsigned.exe 46c326efb04bf933...
*-win64.zip 1d3d134ed9a5c97b...
bitcoin-core-osx-22-res.yml.diff 3ef0e957fb7d7ebd...
bitcoin-core-win-22-res.yml 1111c84cf83d4d5d...
linux-build.log.diff fc78b7561dd76dee...
osx-build.log.diff 0207ec427d530105...
win-build.log.diff 649e332f288fccd4...

@bitcoin bitcoin locked as resolved and limited conversation to collaborators Aug 16, 2022
@fanquake fanquake deleted the fix_bitcoin_util_reloc_section branch November 9, 2022 16:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants