Repository navigation
build: adds switch to enable/disable randomized base address in MSVC builds - #21045
Conversation
|
@EthanHeilman any chance you could set the status on this PR to draft while you're still working on it? Example. It's slightly easier to keep track of than using Feel free to ping me when you're ready for reviews. |
ccd3f85 to
1ea9381
Compare
|
cr ACK 1ea938167cd284a7aecdec31b7f2173f5658d110: patch looks correct Thanks for improving hardening! |
|
@EthanHeilman thanks for the PR. Explicitly calling out the Rather than adding a new |
1ea9381 to
9bd3f35
Compare
|
ACK 9bd3f35. |
|
Thanks @sipsorcery that is a better place for it, I've updated the PR. Currently testing it locally. The reason I'm adding this flag is that I was doing some bitcoin research which required predictable base addresses and it took me a while to figure out how to disable randomized addresses. I figured I'd save the next person who wants this option some time. |
|
Tested and confirmed the correct behavior. |
|
cr ACK 9bd3f35: patch looks correct |
In m4 builds we have the --disable-hardening switch that can be given in
./configureto turn off randomized addresses. This PR provides a simple way of turning off randomized addresses in MSVC builds.This PR:
I have run the following test to verify this works
I ran the msvc build with
<RandomizedBaseAddress>true</RandomizedBaseAddress>then checkedbitcoind.exeandbitcoin-cli.exewithdumpbin.exe:bitcoind
bitcoin-cli
Then I built with
<RandomizedBaseAddress>false</RandomizedBaseAddress>then checkedbitcoind.exeandbitcoin-cli.exewithdumpbin.exeand observed thatDynamic basewas longer listed inOPTIONAL HEADER VALUESbitcoind
bitcoin-cli