https://github.com/trailofbits/vast-checker
https://github.com/trailofbits/vast-checker
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/trailofbits/vast-checker
- Owner: trailofbits
- License: apache-2.0
- Created: 2023-04-17T16:09:02.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-06-06T17:03:13.000Z (about 3 years ago)
- Last Synced: 2024-12-31T07:24:35.347Z (over 1 year ago)
- Language: MLIR
- Size: 71.3 KB
- Stars: 24
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# vast-checker
VAST-checker is a [VAST](https://github.com/trailofbits/vast)-based tool that
scans C code for variants of the
[Sequoia](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-33909) bug. It
is intended to be run after translating C code to
[](https://github.com/trailofbits/vast/blob/master/docs/HighLevel/HighLevel.md)VAST's
`hl` MLIR dialect via the `vast-front` tool that ships with VAST. The main
purpose of the project is to demonstrate the capabilities of VAST and MLIR in
bug hunting and program analysis use cases.
# Building on Ubuntu 22.04
```sh
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main'
sudo apt-get update && sudo apt-get install -y --no-install-recommends \
clang-16 \
clang-tools-16 \
libclang-common-16-dev \
libclang-16-dev \
llvm-16 \
llvm-16-dev \
libllvm16 \
libmlir-16-dev \
mlir-16-tools \
lld-16
```
```sh
git clone --recursive https://github.com/trailofbits/vast-checker.git
```
```sh
cmake -S vast-checker -B build --toolchain ./external/vast/cmake/lld.toolchain.cmake \
-D CMAKE_BUILD_TYPE=Release \
-D CMAKE_PREFIX_PATH=/usr/lib/llvm-16 \
-D CMAKE_C_COMPILER=clang-16 \
-D CMAKE_CXX_COMPILER=clang++-16
```
```sh
cmake --build build -j$(nproc)
```
# Usage
```sh
./build/external/vast/tools/vast-front/vast-front \
-vast-emit-mlir=hl \
-o extract.hl.mlir \
vast-checker/sequoia/extract.c
```
```sh
./build/vast-checker -sequoia extract.hl.mlir > /dev/null
```
# Contributing
See the [CONTRIBUTING](CONTRIBUTING.md) document.
# Licensing
vast-checker is licensed according to the Apache 2.0 license. VAST and vast-checker link against and uses Clang and LLVM APIs. Clang is also licensed under Apache 2.0, with LLVM exceptions.