clixon/test/fuzz
Olof hagsand d358387d39 * Fixed: [State XML validation error when CLICON_MODULE_LIBRARY_RFC7895=true and ietf-yang-libra$
* Removed obsolete option: `CLICON_MODULE_LIBRARY_RFC7895'
  * Obsolete config options given in the confi file are considered an error
* Added section in CONTRIBUTING relating to optimzation
* Changed reset merge to implicit default values.
  * This avoids a potential overwriting of explicitly set default values in the existing config
* Adapted some code to [Make cligen_* functions const ](https://github.com/clicon/cligen/pull/83)
* Test: fixed test for * Fixed: [datamodel tree generated from basemodel tree is not proper when a list has more than one key and key is of enum type](https://github.com/clicon/clixon/issues/417)
2023-02-12 16:19:27 +01:00
..
backend * Fixed: [State XML validation error when CLICON_MODULE_LIBRARY_RFC7895=true and ietf-yang-libra$ 2023-02-12 16:19:27 +01:00
cli * Fixed: [State XML validation error when CLICON_MODULE_LIBRARY_RFC7895=true and ietf-yang-libra$ 2023-02-12 16:19:27 +01:00
http1 * Fixed: [State XML validation error when CLICON_MODULE_LIBRARY_RFC7895=true and ietf-yang-libra$ 2023-02-12 16:19:27 +01:00
netconf * Fixed: [State XML validation error when CLICON_MODULE_LIBRARY_RFC7895=true and ietf-yang-libra$ 2023-02-12 16:19:27 +01:00
restconf * Fixed: [State XML validation error when CLICON_MODULE_LIBRARY_RFC7895=true and ietf-yang-libra$ 2023-02-12 16:19:27 +01:00
xpath Fixed xpath crashes discovered by fuzzing 2022-11-04 17:45:54 +01:00
README.md * Preparations for Clixon 5.4 release, docs, readme:s, etc 2021-11-29 13:52:52 +01:00

Fuzzing with AFL

Clixon can be fuzzed with american fuzzy lop but not without pain.

Some issues are as follows:

  • Static linking. Fuzzing requires static linking. You can statically link clixon using: LINKAGE=static ./configure but that does not work with Clixon plugins (at least yet). Therefore fuzzing has been made with no plugins using the hello example only.
  • Multiple processes. Only the backend can run stand-alone, cli/netconf/restconf requires a backend. When you fuzz eg clixon_cli, the backend must be running and it will be slow due to IPC. Possibly one could link them together and run as a monolith by making a threaded image.

Restconf also has the extra problem of running TLS sockets.

Prereqs

See AFL docs for installing afl. On ubuntu this may be enough:

  sudo apt install afl

Or get source: https://github.com/google/AFL, see docs/QuickStartGuide.txt for instructions, essentially type make

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

backend/restconf

Backend and restconf requires the preeny package to change sockets to stdio.

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