Documentation
¶
Overview ¶
Package interesting contains tools for our static analysis to determine whether a leaf function is interesting.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Classifier ¶
type Classifier struct {
// contains filtered or unexported fields
}
Type Classifier contains information used to map code features to concrete capabilities.
func ClassifierExcludingUnanalyzed ¶ added in v0.2.0
func ClassifierExcludingUnanalyzed(classifier *Classifier) *Classifier
ClassifierExcludingUnanalyzed returns a copy of the supplied Classifier that is modified to never classify capabilities as CAPABILITY_UNANALYZED.
func DefaultClassifier ¶
func DefaultClassifier() *Classifier
DefaultClassifier returns the default internal Classifier.
func LoadClassifier ¶ added in v0.2.0
LoadClassifier returns a capability classifier loaded from the specified io.Reader. The filename argument is used only for providing context to error messages. The classifier will also include the default Capslock classifications unless the excludeBuiltin argument is set.
Refer to the interesting/interesting.cm file in the source code for an example of the capability map format. Classifications loaded from a caller-specified file always override builtin classifications.
func (*Classifier) FunctionCategory ¶
func (c *Classifier) FunctionCategory(pkg, name string) cpb.Capability
FunctionCategory returns a Category for the given function specified by a package name and function name. Examples of function names include "math.Cos", "(time.Time).Clock", and "(*sync.Cond).Signal".
If the return value is Unspecified, then we have not declared it to be either safe or unsafe, so its descendants will have to be considered by the static analysis.
func (*Classifier) IncludeCall ¶
func (c *Classifier) IncludeCall(edge *callgraph.Edge) bool
IncludeCall returns true if a call from one function to another should be considered when searching for transitive capabilities. We return false for some internal calls in the standard library where we know a potential transitive capability does not arise in practice.