contrib: Add test for ELF symbol-check #20476

pull laanwj wants to merge 2 commits into bitcoin:master from laanwj:2020_11_test_symbol_check changing 3 files +129 −0
  1. laanwj commented at 12:20 PM on November 24, 2020: member

    Check both failure cases:

    • Use a glibc symbol from a version that is too new
    • Use a symbol from a library that is not in the allowlist

    And also check a conforming binary.

    Adding a similar check for Windows PE can be done in a separate PR.

  2. laanwj added the label Tests on Nov 24, 2020
  3. laanwj added the label Scripts and tools on Nov 24, 2020
  4. laanwj cross-referenced this on Nov 26, 2020 from issue contrib: Parse ELF directly for symbol and security checks by laanwj
  5. in contrib/devtools/test-symbol-check.py:31 in afc20c234f outdated
      26 | +        # there's no way to do this test for RISC-V at the moment; bionic's libc is 2.27
      27 | +        # and we allow all symbols from 2.27.
      28 | +        if 'riscv' in get_machine(cc):
      29 | +            self.skipTest("test not available for RISC-V")
      30 | +
      31 | +        # emfd_create was introduced in GLIBC 2.27, so is newer than the upper limit of
    


    fanquake commented at 9:50 AM on November 30, 2020:

    s/emfd_create/memfd_create

  6. fanquake commented at 9:54 AM on November 30, 2020: member

    Concept ACK - thanks for putting this together. Will actually test shortly.

  7. fanquake added the label Needs gitian build on Nov 30, 2020
  8. fanquake commented at 10:04 AM on December 2, 2020: member

    I added a test for macOS if you wanted to pull that in as well: https://github.com/fanquake/bitcoin/commit/9e6e59b01e1e4e3325bab59cf97139b462b42651.

  9. DrahtBot commented at 1:28 PM on December 2, 2020: contributor

    <!--a722867cd34abeea1fadc8d60700f111-->

    Gitian builds

    File commit f17e8ba3a17b6516a1b1fb7f45d506a339e99f90<br>(master) commit 58120ed529ce61f9e09bdfe52fcebad03950b874<br>(master and this pull)
    bitcoin-core-linux-22-res.yml 6f0b719c784eefe4... 55a00a6e623803dc...
    bitcoin-core-osx-22-res.yml e4d32d3c0842638c... aa14c0ca3ce99331...
    bitcoin-core-win-22-res.yml 56db8c3b379f620c... 4b619f8a164f9262...
    *-aarch64-linux-gnu-debug.tar.gz 4c8388193af8a61e... 8c9337c0cdd2cc9f...
    *-aarch64-linux-gnu.tar.gz 1835e3b9ae2ec936... bf60e150e5709440...
    *-arm-linux-gnueabihf-debug.tar.gz fbc6bac8916983ea... eacb8039b37bc5e5...
    *-arm-linux-gnueabihf.tar.gz e7cfe2f2cdffaf3b... 1e0db55d171e6a30...
    *-osx-unsigned.dmg e781b8468665316d... f9304c7e594bf969...
    *-osx64.tar.gz 35c3793544745d8a... 1d5170d14bf24676...
    *-riscv64-linux-gnu-debug.tar.gz 941c0cea0da48faa... 4ee7bfca69772615...
    *-riscv64-linux-gnu.tar.gz 37c303be1611e51c... 5ae21c1c4998aadf...
    *-win64-debug.zip 66de372db25058b4... b54ed786ad75109b...
    *-win64-setup-unsigned.exe 4b6c333acd3f9cba... 2405901747f545b6...
    *-win64.zip 1173f4205ab9a460... e3f2e95699e8e89d...
    *-x86_64-linux-gnu-debug.tar.gz 816ba486d4fe35ab... a845822e431f9626...
    *-x86_64-linux-gnu.tar.gz b4ce0ce1137cc11f... 7570a844384fe303...
    *.tar.gz 161acebcdfc94552... 106717564a806f45...
    linux-build.log f43d56b96440d9eb... 58e03fbd38ecfa64...
    osx-build.log 2b6266bbc3875f3e... 2d9018917095b586...
    win-build.log 8d1eb99e0ca0cb32... e7e1c919de0a5c1b...
    bitcoin-core-linux-22-res.yml.diff 3cf2077e2009bce0...
    bitcoin-core-osx-22-res.yml.diff d54f1aad8f823e10...
    bitcoin-core-win-22-res.yml.diff 4fcda02450718fe2...
    linux-build.log.diff 8ced788bea660ef8...
    osx-build.log.diff b3e0bc4bcfb475dc...
    win-build.log.diff c240bd4de2f025e3...
  10. DrahtBot removed the label Needs gitian build on Dec 2, 2020
  11. contrib: Add test for ELF symbol-check
    Check both failure cases:
    - Use a glibc symbol from a version that is too new
    - Use a symbol from a library that is not in the allowlist
    
    And also check a conforming binary.
    
    Adding a similar check for Windows PE can be done in a separate PR.
    5bab08df17
  12. contrib: add MACHO tests to symbol-check tests ed1bbcefea
  13. laanwj force-pushed on Dec 3, 2020
  14. laanwj commented at 11:17 AM on December 3, 2020: member

    I added a test for macOS if you wanted to pull that in as well: fanquake@9e6e59b.

    Thanks ! I didn't mention macOS in the OP because I (mistakenly) thought we only had a symbol check for windows and linux. Good to have a test for that too.

    I've fixed the comment and cherry-picked that commit.

  15. laanwj closed this on Dec 3, 2020

  16. laanwj reopened this on Dec 3, 2020

  17. laanwj commented at 11:13 PM on December 3, 2020: member

    (close/ropen was to test the IRC bot)

  18. fanquake approved
  19. fanquake commented at 7:33 AM on December 7, 2020: member

    ACK ed1bbcefeaafef460b6e5609de85e13c12e0d2a4

  20. fanquake merged this on Dec 7, 2020
  21. fanquake closed this on Dec 7, 2020

  22. sidhujag referenced this in commit 5c42906277 on Dec 7, 2020
  23. fanquake cross-referenced this on Dec 9, 2020 from issue contrib: add symbol check test for PE binaries by fanquake
  24. fanquake referenced this in commit 054710615c on Dec 10, 2020
  25. sidhujag referenced this in commit bb1ae294fc on Dec 10, 2020
  26. bitcoin locked this on Feb 15, 2022

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: 2026-05-20 06:54 UTC