microsoft / sca-fuzzer

Revizor - a fuzzer to search for microarchitectural leaks in CPUs
https://microsoft.github.io/sca-fuzzer/
MIT License
114 stars 34 forks source link

Quick start guide failed to parse objdump output #114

Open EdmundGoodman opened 4 days ago

EdmundGoodman commented 4 days ago

When going through the quickstart guide, I run the following commands:

python3.9 -m pip install virtualenv
python3.9 -m virtualenv ~/venv-revizor
source ~/venv-revizor/bin/activate
pip install revizor-fuzzer

git clone https://github.com/microsoft/sca-fuzzer.git

cd sca-fuzzer/src/x86/executor
make uninstall
make clean
make
make install

cd ../../../
rvzr download_spec -a x86-64 --extensions ALL_SUPPORTED --outfile base.json

./tests/quick-test.sh

And the quick test fails with the following error:

Traceback (most recent call last):
  File "/home/username/venv-revizor/bin/rvzr", line 8, in <module>
    sys.exit(main())
  File "/home/username/venv-revizor/lib/python3.9/site-packages/revizor/cli.py", line 393, in main
    exit_code = fuzzer.start_from_asm(args.num_test_cases, args.num_inputs, args.timeout,
  File "/home/username/venv-revizor/lib/python3.9/site-packages/revizor/fuzzer.py", line 119, in start_from_asm
    return self._start(num_test_cases, num_inputs, timeout, nonstop, save_violations)
  File "/home/username/venv-revizor/lib/python3.9/site-packages/revizor/x86/x86_fuzzer.py", line 117, in _start
    return super()._start(num_test_cases, num_inputs, timeout, nonstop, save_violations)
  File "/home/username/venv-revizor/lib/python3.9/site-packages/revizor/fuzzer.py", line 137, in _start
    test_case: TestCase = self.generation_function(self.existing_test_case)
  File "/home/username/venv-revizor/lib/python3.9/site-packages/revizor/asm_parser.py", line 166, in parse_file
    self.generator.get_elf_data(test_case, obj_file)
  File "/home/username/venv-revizor/lib/python3.9/site-packages/revizor/x86/x86_generator.py", line 64, in get_elf_data
    self.elf_parser.parse(test_case, obj_file)
  File "/home/username/venv-revizor/lib/python3.9/site-packages/revizor/x86/x86_elf_parser.py", line 69, in parse
    instruction_addresses = self._parse_objdump_output(obj_file)
  File "/home/username/venv-revizor/lib/python3.9/site-packages/revizor/x86/x86_elf_parser.py", line 225, in _parse_objdump_output
    assert section_name != "", "Failed to parse objdump output (section_name)"
AssertionError: Failed to parse objdump output (section_name)
Detection: FAIL
Command: rvzr  fuzz -s /home/username/Desktop/sca-fuzzer/tests/../base.json --save-violations f -I /home/username/Desktop/sca-fuzzer/tests/x86_tests/configs -t /home/username/Desktop/sca-fuzzer/tests/x86_tests/asm/spectre_v1.asm -c /home/username/Desktop/sca-fuzzer/tests/x86_tests/configs/ct-seq.yaml -i 20
Exit code: 1
Output: '
WARNING: [executor] SMT is on! You may experience false positives.'

Rather than giving the expected result

Detection: OK
Filtering: OK

My machine is an Intel i7-8565U running EndeavourOS Linux x86_64 with Linux kernel version 6.6.40-1-lts, and my python version is 3.9.19

Any insights on how to resolve this?

OleksiiOleksenko commented 4 days ago

Thanks for submitting a bug report!

What is the version of the assembler and of the objdump tool on your system? (as --version and objdump --version)

EdmundGoodman commented 4 days ago

Thanks for the quick response!

My assembler version is:

$ as --version
GNU assembler (GNU Binutils) 2.42.0
Copyright (C) 2024 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or later.
This program has absolutely no warranty.
This assembler was configured for a target of `x86_64-pc-linux-gnu'.

And my objdump version is:

$ objdump --version
GNU objdump (GNU Binutils) 2.42.0
Copyright (C) 2024 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) any later version.
This program has absolutely no warranty.