Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New format for dataflow summaries #131

Open
victornicolet opened this issue Jan 13, 2025 · 0 comments
Open

New format for dataflow summaries #131

victornicolet opened this issue Jan 13, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@victornicolet
Copy link
Contributor

Users can specify dataflow summaries for functions that are either time consuming to analyze, or where the result might be unsound because of reflection or unsafe pointer manipulation. Currently, those summaries use integer indices to maps from arguments to other arguments and arguments to return values. Those summaries are difficult to write, and cannot express field-sensitive flows.

Instead summaries could look like:

- package: my-package-name
  (interface: my-interface-name)
  method: my-method-name
  flows:
     - from: !arg parameterName .accessPath
       to: !arg parameterName .accessPath
     - from: !arg parameterName2 .accessPath
       to: !ret returnindex .accessPath
     - from: !arg parameterindex
       to: !arg parameterindex2

A dataflow summary applies to a specific method (generally, function) in a package, and optionally from an interface. If interface is specified, the summary is used for all implementations of the interface method.
The summary has flows from a function parameter to a function parameter or return. A function parameter is specified by !arg followed by a name or index, and optionally an object access path (dot-separated list of field names). A function return is specified by !ret followed by an index (the index of the element in the tuple returned, 0 if the tuple is a singleton) and optionally an object access path.

Users can refer to parameters by name or by index, whichever is preferred.

@victornicolet victornicolet added the enhancement New feature or request label Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant