aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
diff options
context:
space:
mode:
authorDaniel Krupp <daniel.krupp@ericsson.com>2024-05-02 16:46:41 +0200
committerGitHub <noreply@github.com>2024-05-02 16:46:41 +0200
commit6ceb1c0ef9f544be0eed65e46cc7d99941a001bf (patch)
treed576ad7040e8e0a6b1cbd08a33f1473934b90842 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp
parent9b9a2a2fd0aaed6704f75adfcde0d85e65008601 (diff)
downloadllvm-6ceb1c0ef9f544be0eed65e46cc7d99941a001bf.zip
llvm-6ceb1c0ef9f544be0eed65e46cc7d99941a001bf.tar.gz
llvm-6ceb1c0ef9f544be0eed65e46cc7d99941a001bf.tar.bz2
[analyzer] Remove untrusted buffer size warning in the TaintPropagation checker (#68607)
Before this commit the the checker alpha.security.taint.TaintPropagation always reported warnings when the size argument of a memcpy-like or malloc-like function was tainted. However, this produced false positive reports in situations where the size was tainted, but correctly performed bound checks guaranteed the safety of the call. This commit removes the rough "always warn if the size argument is tainted" heuristic; but it would be good to add a more refined "warns if the size argument is tainted and can be too large" heuristic in follow-up commits. That logic would belong to CStringChecker and MallocChecker, because those are the checkers responsible for the more detailed modeling of memcpy-like and malloc-like functions. To mark this plan, TODO comments are added in those two checkers. There were several test cases that used these sinks to test generic properties of taint tracking; those were adapted to use different logic. As a minor unrelated change, this commit ensures that strcat (and its wide variant, wcsncat) propagates taint from the first argument to the first argument, i.e. a tainted string remains tainted if we concatenate it with another string. This change was required because the adapted variant of multipleTaintedArgs is relying on strncat to compose a value that combines taint from two different sources.
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
0 files changed, 0 insertions, 0 deletions