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

Import null pointer information from PDG into static analysis #1086

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Commits on Jun 15, 2024

  1. Handle nested fields and other projections

    Record field and index projections for pointers
    by recording a Project event with a base and target
    pointer pair.
    ahomescu committed Jun 15, 2024
    Configuration menu
    Copy the full SHA
    a5f07e7 View commit details
    Browse the repository at this point in the history
  2. Build PDG exclusively on provenance

    The event source- and assignment-based PDG
    construction steps were giving incorrect results
    for indirect accesses, so remove them completely.
    ahomescu committed Jun 15, 2024
    Configuration menu
    Copy the full SHA
    bccd076 View commit details
    Browse the repository at this point in the history
  3. Pointer provenance improvements

    Track the provenance of pointers with finer granularity
    by storing the size of every allocation, local, and constant
    inside the corresponding events. With this information, we can
    keep track of the boundaries of every object and track whether
    a projected pointer falls inside the original allocation.
    ahomescu committed Jun 15, 2024
    Configuration menu
    Copy the full SHA
    5a05d85 View commit details
    Browse the repository at this point in the history
  4. Add size of locals to AddrOfLocal events

    Keep track of the size of every local for the
    new provenance algorithm.
    ahomescu committed Jun 15, 2024
    Configuration menu
    Copy the full SHA
    51d52e1 View commit details
    Browse the repository at this point in the history
  5. Add constant size information to events

    Add a new AddrOfConst event and use it to keep
    track of the sizes of all global constants for
    the new provenance algorithm.
    ahomescu committed Jun 15, 2024
    Configuration menu
    Copy the full SHA
    8bb5991 View commit details
    Browse the repository at this point in the history
  6. Add corner case for Offset(0, _, _) nodes

    Handle Offset nodes with a base pointer of 0
    where the offset is non-zero, potentially resulting
    in a brand new pointer.
    
    One such case occurs in mod_cgi from lighttpd:
        const uintptr_t baseptr = (uintptr_t)env->b->ptr;
        for (i = 0; i < env->oused; ++i)
                envp[i] += baseptr;
    ahomescu committed Jun 15, 2024
    Configuration menu
    Copy the full SHA
    98b98a7 View commit details
    Browse the repository at this point in the history
  7. Add is_null flag to PDG graphs

    Mark each PDG graph with a boolean flag that
    represents whether that graph corresponds to the
    null pointer or not. The PDG construction algorithm
    seems to build one unique graph for all null pointers
    in the entire program.
    ahomescu committed Jun 15, 2024
    Configuration menu
    Copy the full SHA
    d9c61e0 View commit details
    Browse the repository at this point in the history
  8. Add an extra null pointer test to analysis example

    Add one test where a function argument can be either
    null or non-null in the recur() function of the
    analysis/tests/misc example code.
    ahomescu committed Jun 15, 2024
    Configuration menu
    Copy the full SHA
    841a196 View commit details
    Browse the repository at this point in the history
  9. Use PDG to remove NON_NULL from pointers in static analysis

    Remove the NON_NULL permission from all nodes in
    the null graph from the PDG.
    ahomescu committed Jun 15, 2024
    Configuration menu
    Copy the full SHA
    710b626 View commit details
    Browse the repository at this point in the history