ubsan: add another suppression for InsecureRandomContext #33949

pull fanquake wants to merge 1 commits into bitcoin:master from fanquake:suppress_insecure_rand_context changing 1 files +1 −0
  1. fanquake commented at 1:52 pm on November 26, 2025: member

    We’ve been suppressing this in infra for a little while, it’s now appearing elsewhere. i.e https://github.com/willcl-ark/bitcoin/actions/runs/19702968577/job/56443491265#step:9:2738:

     0Run bip324_cipher_roundtrip with args ['/home/runner/work/_temp/build/bin/fuzz', '-runs=1', PosixPath('/home/runner/work/_temp/ci/scratch/qa-assets/fuzz_corpora/bip324_cipher_roundtrip')]INFO: Running with entropic power schedule (0xFF, 100).
     1INFO: Seed: 2138761624
     2INFO: Loaded 1 modules   (612416 inline 8-bit counters): 612416 [0x55aa0745d458, 0x55aa074f2c98), 
     3INFO: Loaded 1 PC tables (612416 PCs): 612416 [0x55aa074f2c98,0x55aa07e4b098), 
     4INFO:     1479 files found in /home/runner/work/_temp/ci/scratch/qa-assets/fuzz_corpora/bip324_cipher_roundtrip
     5INFO: -max_len is not provided; libFuzzer will not generate inputs larger than 214082 bytes
     6INFO: seed corpus: files: 1479 min: 1b max: 214082b total: 869543b rss: 112Mb
     7/home/runner/work/_temp/src/random.h:432:29: runtime error: unsigned integer overflow: 11400714825904921328 * 13787848793156543929 cannot be represented in type 'unsigned long'
     8    [#0](/bitcoin-bitcoin/0/) 0x55aa041751db in InsecureRandomContext::InsecureRandomContext(unsigned long) (/home/runner/work/_temp/build/bin/fuzz+0x1c181db) (BuildId: 240d4d47bf0144daf13a950328fb39f74c0478d6)
     9    [#1](/bitcoin-bitcoin/1/) 0x55aa041737c4 in bip324_cipher_roundtrip_fuzz_target(std::span<unsigned char const, 18446744073709551615ul>) (/home/runner/work/_temp/build/bin/fuzz+0x1c167c4) (BuildId: 240d4d47bf0144daf13a950328fb39f74c0478d6)
    10    [#2](/bitcoin-bitcoin/2/) 0x55aa04a13ea5 in LLVMFuzzerTestOneInput (/home/runner/work/_temp/build/bin/fuzz+0x24b6ea5) (BuildId: 240d4d47bf0144daf13a950328fb39f74c0478d6)
    11    [#3](/bitcoin-bitcoin/3/) 0x55aa040189ff in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) (/home/runner/work/_temp/build/bin/fuzz+0x1abb9ff) (BuildId: 240d4d47bf0144daf13a950328fb39f74c0478d6)
    12    [#4](/bitcoin-bitcoin/4/) 0x55aa04018009 in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) (/home/runner/work/_temp/build/bin/fuzz+0x1abb009) (BuildId: 240d4d47bf0144daf13a950328fb39f74c0478d6)
    13    [#5](/bitcoin-bitcoin/5/) 0x55aa04019d72 in fuzzer::Fuzzer::ReadAndExecuteSeedCorpora(std::vector<fuzzer::SizedFile, std::allocator<fuzzer::SizedFile>>&) (/home/runner/work/_temp/build/bin/fuzz+0x1abcd72) (BuildId: 240d4d47bf0144daf13a950328fb39f74c0478d6)
    14    [#6](/bitcoin-bitcoin/6/) 0x55aa0401a290 in fuzzer::Fuzzer::Loop(std::vector<fuzzer::SizedFile, std::allocator<fuzzer::SizedFile>>&) (/home/runner/work/_temp/build/bin/fuzz+0x1abd290) (BuildId: 240d4d47bf0144daf13a950328fb39f74c0478d6)
    15    [#7](/bitcoin-bitcoin/7/) 0x55aa04006915 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) (/home/runner/work/_temp/build/bin/fuzz+0x1aa9915) (BuildId: 240d4d47bf0144daf13a950328fb39f74c0478d6)
    16    [#8](/bitcoin-bitcoin/8/) 0x55aa04032cd6 in main (/home/runner/work/_temp/build/bin/fuzz+0x1ad5cd6) (BuildId: 240d4d47bf0144daf13a950328fb39f74c0478d6)
    17    [#9](/bitcoin-bitcoin/9/) 0x7f8d6de271c9  (/lib/x86_64-linux-gnu/libc.so.6+0x2a1c9) (BuildId: 274eec488d230825a136fa9c4d85370fed7a0a5e)
    18    [#10](/bitcoin-bitcoin/10/) 0x7f8d6de2728a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28a) (BuildId: 274eec488d230825a136fa9c4d85370fed7a0a5e)
    19    [#11](/bitcoin-bitcoin/11/) 0x55aa03ffaee4 in _start (/home/runner/work/_temp/build/bin/fuzz+0x1a9dee4) (BuildId: 240d4d47bf0144daf13a950328fb39f74c0478d6)
    20
    21SUMMARY: UndefinedBehaviorSanitizer: unsigned-integer-overflow /home/runner/work/_temp/src/random.h:432:29 
    
  2. ubsan: add another suppression for InsecureRandomContext
    We've been suppressing this in infra for a little while, it's now
    appearing elsewhere. i.e
    https://github.com/willcl-ark/bitcoin/actions/runs/19702968577/job/56443491265#step:9:2738.
    d35b1755e0
  3. DrahtBot commented at 1:52 pm on November 26, 2025: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/33949.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK dergoegge

    If your review is incorrectly listed, please copy-paste <!–meta-tag:bot-skip–> into the comment that the bot should ignore.

  4. fanquake commented at 1:52 pm on November 26, 2025: member
  5. maflcko commented at 2:41 pm on November 26, 2025: member
    Not sure. Is this caused by removing -g? If yes, I am not sure this is something meaningful to support when running with sanitizers.
  6. maflcko commented at 2:43 pm on November 26, 2025: member
    Going further, we could require -fno-inline for ubsan. But if you want to go the route in this pull, might as well just wildcard-suppress InsecureRandomContext?
  7. dergoegge approved
  8. dergoegge commented at 2:58 pm on November 26, 2025: member

    ACK d35b1755e0fe7f4760ea76dd2ba054e568bb8395

    Don’t feel strongly about adding this, also happy to just keep adding this to my own suppressions.

  9. maflcko commented at 6:15 pm on November 27, 2025: member

    To explain my comment: On this pull and current master the compile flags are: C++ compiler flags .................... -ftrivial-auto-var-init=pattern -O2 -g -std=c++20 ...

    On the failing push, they are: C++ compiler flags .................... -ftrivial-auto-var-init=pattern -O2 -std=c++20 ... (with -g removed)

    So I fail to see why the correct fix is to add a suppression. See also the docs:

    https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html#runtime-suppressions

    Sometimes your binary must have enough debug info and/or symbol table, so that the runtime could figure out source file or function name to match against the suppression.

  10. fanquake commented at 10:13 am on November 28, 2025: member
    I think this is the same issue in our infra.
  11. fanquake closed this on Nov 28, 2025

  12. fanquake deleted the branch on Nov 28, 2025

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-12-01 21:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me