This is an archive of the discontinued LLVM Phabricator instance.

[analyzer][NFC] Refactor GenericTaintChecker to use CallDescriptionMap
ClosedPublic

Authored by gamesh411 on Dec 20 2021, 2:59 AM.

Details

Summary

GenericTaintChecker now uses CallDescriptionMap to describe the possible
operation in code which trigger the introduction (sources), the removal
(filters), the passing along (propagations) and detection (sinks) of
tainted values.

Diff Detail

Event Timeline

gamesh411 created this revision.Dec 20 2021, 2:59 AM
gamesh411 requested review of this revision.Dec 20 2021, 2:59 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 20 2021, 2:59 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
NoQ accepted this revision.Jan 5 2022, 10:24 PM

I haven't read this whole patch with full scrutiny but it sure looks lovely. I now also see what the problem is with non-static strings in call descriptions.

This revision is now accepted and ready to land.Jan 5 2022, 10:24 PM
gamesh411 updated this revision to Diff 399246.Jan 12 2022, 1:19 AM

Tidy things up thanks to the recommendations of @steakhal

Sweet stuff!

clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp
55

typo

163–164
312–313

I would expect this in plural form.

318

Definitely reads oddly. The return type is singular but the function parses name parts.

647

A comment like this would make it cleaner:
// We don't have external taint config, no parsing required.

750–752

It's unfortunate that we don't shortcircuit after the patch.

865

Use inclusive terms.

gamesh411 updated this revision to Diff 400464.Jan 17 2022, 1:07 AM
gamesh411 marked 7 inline comments as done.

Fixes round two

Applied typo and naming fixes, introduced 2 move operations, and re-introduced short circuiting.

gamesh411 updated this revision to Diff 400498.EditedJan 17 2022, 5:16 AM

All (except the last) commits were excluded in the previous patch upload

gamesh411 updated this revision to Diff 400790.Jan 18 2022, 3:16 AM

Remove explicit template keyword for MSVC compatibility

steakhal accepted this revision.Jan 18 2022, 5:45 AM
This revision was landed with ongoing or failed builds.Jan 18 2022, 7:04 AM
This revision was automatically updated to reflect the committed changes.