<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/55947>55947</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Invalid ELF file causes llvm-objdump to crash 
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          Alan-Jowett
      </td>
    </tr>
</table>

<pre>
    C:\ebpf_fuzz>llvm-objdump --version
LLVM (http://llvm.org/):
  LLVM version 11.0.1
  Optimized build.
  Default target: x86_64-pc-windows-msvc
  Host CPU: skylake-avx512

  Registered Targets:
    aarch64    - AArch64 (little endian)
    aarch64_32 - AArch64 (little endian ILP32)
    aarch64_be - AArch64 (big endian)
    amdgcn     - AMD GCN GPUs
    arm        - ARM
    arm64      - ARM64 (little endian)
    arm64_32   - ARM64 (little endian ILP32)
    armeb      - ARM (big endian)
    avr        - Atmel AVR Microcontroller
    bpf        - BPF (host endian)
    bpfeb      - BPF (big endian)
    bpfel      - BPF (little endian)
    hexagon    - Hexagon
    lanai      - Lanai
    mips       - MIPS (32-bit big endian)
    mips64     - MIPS (64-bit big endian)
    mips64el   - MIPS (64-bit little endian)
    mipsel     - MIPS (32-bit little endian)
    msp430     - MSP430 [experimental]
    nvptx      - NVIDIA PTX 32-bit
    nvptx64    - NVIDIA PTX 64-bit
    ppc32      - PowerPC 32
    ppc64      - PowerPC 64
    ppc64le    - PowerPC 64 LE
    r600       - AMD GPUs HD2XXX-HD6XXX
    riscv32    - 32-bit RISC-V
    riscv64    - 64-bit RISC-V
    sparc      - Sparc
    sparcel    - Sparc LE
    sparcv9    - Sparc V9
    systemz    - SystemZ
    thumb      - Thumb
    thumbeb    - Thumb (big endian)
    wasm32     - WebAssembly 32-bit
    wasm64     - WebAssembly 64-bit
    x86        - 32-bit X86: Pentium-Pro and above
    x86-64     - 64-bit X86: EM64T and AMD64
    xcore      - XCore

C:\ebpf_fuzz>llvm-objdump -Sl crash-9a08f14f3b33cbe8d0a82d353320218cedbdfdae

crash-9a08f14f3b33cbe8d0a82d353320218cedbdfdae: file format elf64-bpf


Disassembly of section bind:

0000000000000000 <bind>:
LLVM ERROR: Invalid data was encountered while parsing the file
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.
Stack dump:
0.      Program arguments: llvm-objdump -Sl crash-9a08f14f3b33cbe8d0a82d353320218cedbdfdae
 #0 0x00007ff6ede3c596 C:\Program Files\LLVM\bin\llvm-objdump.exe 0x49c596 (C:\Program Files\LLVM\bin\llvm-objdump.exe+0x49c596)
 #1 0x00007ff6ede3c596
 #2 0x00007ff6ede3c596 (C:\Program Files\LLVM\bin\llvm-objdump.exe+0x49c596)
 #3 0x00007ff976a81881 C:\Program Files\LLVM\bin\llvm-objdump.exe 0x467572 C:\Program Files\LLVM\bin\llvm-objdump.exe 0x46759a
 #4 0x00007ff976a81881 C:\Program Files\LLVM\bin\llvm-objdump.exe 0xc2eb C:\Program Files\LLVM\bin\llvm-objdump.exe 0x421a10
 #5 0x00007ff976a81881 C:\Program Files\LLVM\bin\llvm-objdump.exe 0x41025a C:\Program Files\LLVM\bin\llvm-objdump.exe 0x4220e4
 #6 0x00007ff976a81881 C:\Program Files\LLVM\bin\llvm-objdump.exe 0x345a52 C:\Program Files\LLVM\bin\llvm-objdump.exe 0x4b8be4
 #7 0x00007ff976a81881 C:\Program Files\LLVM\bin\llvm-objdump.exe 0x1bd93 C:\Program Files\LLVM\bin\llvm-objdump.exe 0x9aed
 #8 0x00007ff976a81881 C:\Program Files\LLVM\bin\llvm-objdump.exe 0x19869 C:\Program Files\LLVM\bin\llvm-objdump.exe 0x13cd4
 #9 0x00007ff976a81881 C:\Program Files\LLVM\bin\llvm-objdump.exe 0x85f3 C:\Program Files\LLVM\bin\llvm-objdump.exe 0x61aeb0
#10 0x00007ff976a81881 (C:\Windows\System32\ucrtbase.dll+0x71881)
#11 0x00007ff976a82851 (C:\Windows\System32\ucrtbase.dll+0x72851)
0x00007FF6EDE3C596 (0x0000CCB18B69BFA4 0x00007FF6EDE3D00D 0x0000000000000016 0x00007FF6EDE3C590)
0x00007FF976A81881 (0x000000498898C401 0x0000000000000000 0x0000000000000000 0x000000498898C470), raise() + 0x1E1 bytes(s)
0x00007FF976A82851 (0x0000000000000003 0x0000004900000003 0x0000000000000000 0x000000498898C5E0), abort() + 0x31 bytes(s)
0x00007FF6EDE07572 (0x00007C1600000013 0x00007FF6EDDB00EB 0x0000000000007C16 0x0000022A3C493760)
0x00007FF6EDE0759A (0x0000022A3C4A0000 0x0000022A3C670000 0x0000022A3C6702B4 0x000000498898C778)
0x00007FF6ED9AC2EB (0x0000000000000040 0x0000022A00000000 0x0000976785DA0D0A 0x0000000000000008)
0x00007FF6EDDC1A10 (0x000000498898C7D0 0x00007FF6ED9AD6A9 0x000000498898C940 0x000000498898CA90)
0x00007FF6EDDB025A (0x0000022A3C4BF070 0x00007FF6EDFBA72B 0x0000000000000040 0x00007FF6EDDC2B94)
0x00007FF6EDDC20E4 (0x0000004900000001 0x00007FF97912A407 0x0000000000000000 0x000000498898C890)
0x00007FF6EDCE5A52 (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000)
0x00007FF6EDE58BE4 (0x00008D64A157C75A 0x0000000000000000 0x0000000000000000 0x0000000000000003)
0x00007FF6ED9BBD93 (0x0000000000000000 0x0000000000000000 0x0000976785DA073A 0x0000000000000000)
0x00007FF6ED9A9AED (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000)
0x00007FF6ED9B9869 (0x0000000000000000 0x0000022A00000000 0x0000022A3C4A0000 0x0000022A3C670000)
0x00007FF6ED9B3CD4 (0x0000022A3C4AA7F0 0x0000000000000010 0x0000022A3C4C0798 0x00007FF976A1FDE6)
0x00007FF6ED9A85F3 (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000)
0x00007FF6EDFBAEB0 (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000)
0x00007FF977DB7034 (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000), BaseThreadInitThunk() + 0x14 bytes(s)
0x00007FF979162651 (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000), RtlUserThreadStart() + 0x21 bytes(s)

Malformed ELF file:
[Artifacts-bpf2c_fuzzer-x64-Debug.zip](https://github.com/llvm/llvm-project/files/8863917/Artifacts-bpf2c_fuzzer-x64-Debug.zip)

Found while running fuzzing tests in this workflow:
https://github.com/microsoft/ebpf-for-windows/actions/runs/2462995102




</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy9WVlzo7gW_jXOiwqXEPuDH1js6UwlM64knUndly4BwmaaxYXAWX79PWIxGGN3tyczrhQg6SzfWaQjKX4evi_cmWLPNJf5u-hbVH18zJRlkuxTKff_Dqt0hyRpzwoe59kMezNs390936MZMbdluROcZAV_gmGeF5u6ZYnumhahmrrlR7I8x3O5G_pzV8Zp_MFC5FdxEs67fo9FtEpKVNJiw0qQhd5M_ZuuSrtAeo2zMH_lUsr3QUf_JeclctdfBSX__p7Q70yi-zdNJg1FR_fANjEvWQEKn2rRfIATIUqLYKur4lNCtt00wM4kLsuEIZaFMc2EcWOObwq5wIFu79YKmeTz2TGfH28m1aThJshQC-zeQ7-5f6Df1l_5gKRIUfsDkof7o5HGpnbkhzYJemHRefopi4qU-QMtl6zZFwOoZcoSZD8_oPs4KPIgz8oiTxJW9PSQlT29s17VqSciPiEbaHsYLe0ZGII0GZGe98qWvdFNnjXUX5pGP5rQjMadrDvR6MfSeMcP8O9v149CkUIkPy7RGWiCpY1ZzwLp_0OW2qATlvNWCa7WCSfYLnDxnargjutxLRozzWFvO1bEKctKmsw0r6fP9rvyrfPAH8-33q2N1k8vqFE0ouvm34CuMaOn2-2COj1runX-yoq1C8KOCPqU7wh0dUQAxo0I0N2ypyl0jPs0FZMOJhz64pGXlxfpi6fDa0Ac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