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

Updated roadmap for closures and fn pointers #34

Open
2 tasks done
cdstanford opened this issue Jun 1, 2023 · 3 comments
Open
2 tasks done

Updated roadmap for closures and fn pointers #34

cdstanford opened this issue Jun 1, 2023 · 3 comments
Labels
roadmap-v1 Roadmap for v1.0

Comments

@cdstanford
Copy link
Collaborator

cdstanford commented Jun 1, 2023

New roadmap for closures and function pointers. Replaces #30

For v0:

  • add two types of unsafe effect to our effect model: ClosureCreation and FnPointerCreation
  • in scanner.rs, whenever a closure or function pointer is created, add this to the list of effects associated with that function that need to be audited.

For v1, the plan is probably something like the following:

  • add closures to the call graph
  • for effects in a closure, we need a new audit model: effects can be caller-checked, creator-checked, safe, or unsafe.
  • for each closure variable or function pointer variable, track which possible closures/function pointers it might refer to (an overapproximation). If we don't have enough information to identify, could add an UnsafeCall effect to track this.
@cdstanford cdstanford added roadmap-v0 On the current roadmap roadmap-v1 Roadmap for v1.0 labels Jun 1, 2023
@cdstanford cdstanford changed the title Roamdap for closures and fn pointers Updated roadmap for closures and fn pointers Jun 1, 2023
@cdstanford
Copy link
Collaborator Author

cdstanford commented Jun 7, 2023

  • Currently in data/results/top10_all.csv, we have several CLOSURE lines, these should eventually go away for the roadmap above.

@cdstanford
Copy link
Collaborator Author

Limitations of current FnPtrCreation tracking:

Currently it doesn't track type aliases, statics, unnamed fields, and function pointers in smart pointers.

@cdstanford cdstanford removed the roadmap-v0 On the current roadmap label Aug 23, 2023
@cdstanford
Copy link
Collaborator Author

Just discussed this with David, false positives for closure creation seem to come up commonly, e.g. for closures like |x| x + 1 which are quite common.

An extremely useful optimization we should do here is:

  • if the closure contains no effects inside it -- so absolutely no effects are possible when called -- skip adding the ClosureCreation effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
roadmap-v1 Roadmap for v1.0
Projects
None yet
Development

No branches or pull requests

1 participant