clixon/test/fuzz
Olof hagsand 081e6871b3 * Renamed clixon-clispec.yang to clixon-autocli.yang
* First version of clixon-autocli.yang semantics
   * Default rules for module exclusion, list-keywords, completion, treeref-state
   * Specialized rules for compress and exclusion of modules
   * See [autocli documentation](https://clixon-docs.readthedocs.io/en/latest/cli.html#autocli)
* Obsoleted and moved autocli config options from clixon-config.yang to clixon-autocli.yang as follows:
   * `CLICON_CLI_GENMODEL`, use: `autocli/module-default=false` instead
      * Removed `clicon_cli_genmodel()`
   * `CLICON_CLI_GENMODEL_TYPE`, use `autocli/list-keyword-default` and compress rules instead)
      * Removed `clicon_cli_genmodel_type()`
   * `CLICON_CLI_GENMODEL_COMPLETION`, use `autocli/completion-default` instead
      * Removed `clicon_cli_genmodel_completion()`
   * `CLICON_CLI_AUTOCLI_EXCLUDE`, use `autocli/rule/operation=exclude` instead
   * `CLICON_CLI_MODEL_TREENAME`, use constant `AUTOCLI_TREENAME` instead
     * Removed `clicon_cli_model_treename()`
* New YANG functions: yang_single_child_type, yang_find_namespace_by_prefix, yang_str2key
* Changed return values of yang_find_prefix_by_namespace
* Merged `cli_cli2xml()` into `cli2xml()`
2022-01-07 12:50:07 +01:00
..
backend Moved fuzz dir to test/fuzz 2021-10-10 18:05:45 +02:00
cli * Renamed clixon-clispec.yang to clixon-autocli.yang 2022-01-07 12:50:07 +01:00
netconf * Renamed clixon-clispec.yang to clixon-autocli.yang 2022-01-07 12:50:07 +01:00
restconf Moved fuzz dir to test/fuzz 2021-10-10 18:05:45 +02: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