4.10.PRE
This commit is contained in:
parent
006580cdc1
commit
4de0a475d3
10 changed files with 218 additions and 8 deletions
59
fuzz/backend/README.md
Normal file
59
fuzz/backend/README.md
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
# Clixon fuzzing
|
||||
|
||||
This dir contains code for fuzzing clixon backend.
|
||||
|
||||
It requires the preeny package to change sockets to stdio.
|
||||
|
||||
## Prereqs
|
||||
|
||||
Preeny has a "desocketizing" module necessary to map stdio to the internal sockets that the backend uses. Install preeny example:
|
||||
```
|
||||
sudo apt install libini-config-dev # debian/ubuntu
|
||||
sudo apt install libseccomp-dev # debian/ubuntu
|
||||
git clone https://github.com/zardus/preeny.git
|
||||
cd preeny
|
||||
make
|
||||
sudo cp x86_64-linux-gnu/desock.so /usr/local/lib/ # install
|
||||
```
|
||||
|
||||
See [AFL docs](https://afl-1.readthedocs.io/en/latest) for installing afl.
|
||||
On ubuntu this may be enough:
|
||||
```
|
||||
sudo apt install afl
|
||||
```
|
||||
|
||||
You may have to change cpu frequency:
|
||||
```
|
||||
cd /sys/devices/system/cpu
|
||||
echo performance | tee cpu?/cpufreq/scaling_governor
|
||||
```
|
||||
|
||||
And possibly change core behaviour:
|
||||
```
|
||||
echo core >/proc/sys/kernel/core_pattern
|
||||
```
|
||||
|
||||
## Build
|
||||
|
||||
Make a modification to how Clixon sends internal messages in `include/clixon_custom.h`:
|
||||
```
|
||||
#define CLIXON_PROTO_PLAIN
|
||||
```
|
||||
|
||||
Build clixon statically with the afl-clang compiler:
|
||||
```
|
||||
CC=/usr/bin/afl-clang-fast LINKAGE=static ./configure --with-restconf=evhtp
|
||||
make clean
|
||||
make
|
||||
sudo make install
|
||||
```
|
||||
|
||||
## Run tests
|
||||
|
||||
Populate the input/ dir with input usecases, there are two examples already in this dir that can be modified.
|
||||
Use the script `runfuzz.sh` to run one test:
|
||||
```
|
||||
./runfuzz.sh
|
||||
```
|
||||
|
||||
After (or during) the test, investigate results in the output dir.
|
||||
Loading…
Add table
Add a link
Reference in a new issue