]> granicus.if.org Git - clang/commit
[analyzer] Add yaml parser to GenericTaintChecker
authorGabor Borsik <gabor.borsik@gmail.com>
Sun, 28 Jul 2019 13:38:04 +0000 (13:38 +0000)
committerGabor Borsik <gabor.borsik@gmail.com>
Sun, 28 Jul 2019 13:38:04 +0000 (13:38 +0000)
commit5304a2a576a7cef4c2d306ee29da95bf73f1b381
treeb3acc3d3e79d73323e6a89524fb378bf8dd4a25f
parentc76d0d6d37054fef520aa2832c18480c472b3137
[analyzer] Add yaml parser to GenericTaintChecker

While we implemented taint propagation rules for several
builtin/standard functions, there's a natural desire for users to add
such rules to custom functions.

A series of patches will implement an option that allows users to
annotate their functions with taint propagation rules through a YAML
file. This one adds parsing of the configuration file, which may be
specified in the commands line with the analyzer config:
alpha.security.taint.TaintPropagation:Config. The configuration may
contain propagation rules, filter functions (remove taint) and sink
functions (give a warning if it gets a tainted value).

I also added a new header for future checkers to conveniently read YAML
files as checker options.

Differential Revision: https://reviews.llvm.org/D59555

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@367190 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/StaticAnalyzer/Checkers/Checkers.td
lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp
lib/StaticAnalyzer/Checkers/Yaml.h [new file with mode: 0755]
test/Analysis/Inputs/taint-generic-config-ill-formed.yaml [new file with mode: 0755]
test/Analysis/Inputs/taint-generic-config-invalid-arg.yaml [new file with mode: 0755]
test/Analysis/Inputs/taint-generic-config.yaml [new file with mode: 0755]
test/Analysis/analyzer-config.c
test/Analysis/taint-generic.c