Skip to content

[CHERI CSA Report] Bad pointer alignment cast in sdk/lib/queue/queue_compartment.cc #564

@resistor

Description

@resistor

The new CHERI clang-static-analyzer checkers are producing the following warning. This could very well be a false positive.

---
MainSourceFile:  '/workspaces/cheriot-rtos/sdk/lib/queue/queue_compartment.cc'
Diagnostics:
  - DiagnosticName:  clang-analyzer-optin.portability.PointerAlignment
    DiagnosticMessage:
      Message:         'Pointer value aligned to a 4 byte boundary cast to type ''RestrictedEndpoint * __sealed_capability'' with 8-byte capability alignment'
      FilePath:        '/workspaces/cheriot-rtos/sdk/lib/queue/queue_compartment.cc'
      FileOffset:      1321
      Replacements:    []
    Notes:
      - Message:         'Calling ''unseal'''
        FilePath:        '/workspaces/cheriot-rtos/sdk/lib/queue/queue_compartment.cc'
        FileOffset:      5119
        Replacements:    []
        Ranges:
          - FilePath:        '/workspaces/cheriot-rtos/sdk/lib/queue/queue_compartment.cc'
            FileOffset:      5119
            Length:          26
      - Message:         'Pointer value aligned to a 4 byte boundary cast to type ''RestrictedEndpoint * __sealed_capability'' with 8-byte capability alignment'
        FilePath:        '/workspaces/cheriot-rtos/sdk/lib/queue/queue_compartment.cc'
        FileOffset:      1321
        Replacements:    []
        Ranges:
          - FilePath:        '/workspaces/cheriot-rtos/sdk/lib/queue/queue_compartment.cc'
            FileOffset:      1321
            Length:          60
    Level:           Warning
    BuildDirectory:  '/workspaces/cheriot-rtos'
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions