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

CHERI CSA: CHERI support for Clang Static Analyzer + cheri.* Checkers #744

Open
wants to merge 77 commits into
base: dev
Choose a base branch
from

Conversation

eupharina
Copy link

@eupharina eupharina commented Jun 28, 2024

  1. Fix CSA crashes when compiling for CHERI
  2. Few CSA core improvements
    • Support non-constant offsets to ElementRegion
    • Add provenance bit to LocAsInteger
    • Improve LocAsInt arithmetic support
  3. New checkers
    • cheri.CapabilityCopy Check tag-stripping memory copy.
    • cheri.CheriAPIModelling Model CheriAPI
    • cheri.PointerSizeAssumptions Detect hardcoded expectations on pointer sizes
    • cheri.ProvenanceSource Check expressions with ambiguous provenance source.
    • cheri.SubObjectRepresentability Check for record fields with unrepresentable subobject bounds
    • optin.portability.PointerAlignment Check underaligned pointers
    • alpha.cheri.Allocation (Enable only for development!) Suggest narrowing bounds for escaping suballocation capabilities

eupharina added 30 commits June 27, 2024 11:42
Detects tag-stripping loads and stores that
may be used to copy or swap capabilities
Rely on ElementRegion type alignment solely when shift value is unknown

Except for char shifts
ProvenanceSourceChecker, CapabilityCopyChecker, CapabilityAlignmentChecker
eupharina added 30 commits June 27, 2024 11:42
Report warning when an underaligned pointer gets converted or
stored as a capability-aligned pointer value for the first time.
Do not report if it already has a strictly-aligned type.
Rework detection of addresses of capability-containing regions and
generic regions (those that are intended to hold arbitrary data)
by analyzing address Symbol type and origin.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant