diff options
author | fanquake <fanquake@gmail.com> | 2023-05-22 11:12:03 +0100 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2023-05-22 11:34:58 +0100 |
commit | 09351f51d279612973ecd76811dc075dff08209f (patch) | |
tree | 800bf7467ecbb7dda2f34bc1278021d9e5b39fb9 /ci | |
parent | ad7819d2f8abc311996cb6836315413641c2bebf (diff) | |
parent | 5228223e1ff2af29e6e77668ce3288005c2adbbc (diff) | |
download | bitcoin-09351f51d279612973ecd76811dc075dff08209f.tar.xz |
Merge bitcoin/bitcoin#27699: random: drop syscall wrapper usage for getrandom()
5228223e1ff2af29e6e77668ce3288005c2adbbc ci: remove MSAN getrandom syscall workaround (fanquake)
d5e06919db5e221bfef445c5a40c88de72dc5869 random: switch to using getrandom() directly (fanquake)
c2ba3f5b0c7d0eece7d16d1ffc125d8a6a9297af random: add [[maybe_unused]] to GetDevURandom (fanquake)
c13c97dbf846cf0e6a5581ac414ef96a215b0dc6 random: getentropy on macOS does not need unistd.h (fanquake)
Pull request description:
This requires a linux kernel of `3.17`+, which seems entirely
reasonable. `3.17` went EOL in 2015, and the last supported `3.x` kernel
(`3.16`) went EOL > 4 years ago, in 2020. For reference, the current
oldest maintained kernel is `4.14` (released 2017, going EOL Jan 2024).
Support for `getrandom()` (and `getentropy()`) was added to
glibc `2.25` https://sourceware.org/legacy-ml/libc-alpha/2017-02/msg00079.html:
> * The getentropy and getrandom functions, and the <sys/random.h> header
file have been added.
and we already require `2.27` or later.
All that being said, I don't think you would encounter a current day (+~6 months from now)
system, running with kernel headers older than 3.17 (released 2014) but also having a
glibc of 2.27+ (released 2018)?
Removing this (our only) use of `syscall()` also means we can drop a workaround in our MSAN jobs.
If this is merged, I'll drop the [same workaround in oss-fuzz](https://github.com/google/oss-fuzz/blob/25946a544856413d31d9cbb3a366a4aef5a8fd60/projects/bitcoin-core/build.sh#L49-L56).
ACKs for top commit:
josibake:
ACK https://github.com/bitcoin/bitcoin/pull/27699/commits/5228223e1ff2af29e6e77668ce3288005c2adbbc
hebasto:
ACK 5228223e1ff2af29e6e77668ce3288005c2adbbc, I've tested build system changes on Ubuntu 22.04 and macOS Monterey 12.6.6 (x86_64).
Tree-SHA512: cc978e08510c461b875ca8c08ae176b4519fa1108f0efd74dcb7474518945357e0184e54423282c9a496de195e4ddc3e221ee78623bd63e24c50cc86acdf32e2
Diffstat (limited to 'ci')
-rwxr-xr-x | ci/test/06_script_b.sh | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/ci/test/06_script_b.sh b/ci/test/06_script_b.sh index 83da4dac32..68ce3c5042 100755 --- a/ci/test/06_script_b.sh +++ b/ci/test/06_script_b.sh @@ -101,14 +101,6 @@ cd "${BASE_BUILD_DIR}/bitcoin-$HOST" bash -c "./configure --cache-file=../config.cache $BITCOIN_CONFIG_ALL $BITCOIN_CONFIG" || ( (cat config.log) && false) -if [[ ${USE_MEMORY_SANITIZER} == "true" ]]; then - # MemorySanitizer (MSAN) does not support tracking memory initialization done by - # using the Linux getrandom syscall. Avoid using getrandom by undefining - # HAVE_SYS_GETRANDOM. See https://github.com/google/sanitizers/issues/852 for - # details. - grep -v HAVE_SYS_GETRANDOM src/config/bitcoin-config.h > src/config/bitcoin-config.h.tmp && mv src/config/bitcoin-config.h.tmp src/config/bitcoin-config.h -fi - if [[ "${RUN_TIDY}" == "true" ]]; then MAYBE_BEAR="bear --config src/.bear-tidy-config" MAYBE_TOKEN="--" |