Skip to content

[CHERI CSA Report] Subject-object bounds representability warning in sdk/core/loader/types.h #565

@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/core/loader/types.h'
Diagnostics:
  - DiagnosticName:  clang-analyzer-cheri.SubObjectRepresentability
    DiagnosticMessage:
      Message:         'Field ''privilegedCompartments'' of type ''class (unnamed class at /workspaces/cheriot-rtos/sdk/core/loader/types.h:505:3)'' (size 120) requires 8 byte alignment for precise bounds; field offset is 34 (aligned to 2); Current bounds: 32-160'
      FilePath:        '/workspaces/cheriot-rtos/sdk/core/loader/types.h'
      FileOffset:      13868
      Replacements:    []
      Ranges:
        - FilePath:        '/workspaces/cheriot-rtos/sdk/core/loader/types.h'
          FileOffset:      13868
          Length:          1916
    Notes:
      - Message:         '2/22 bytes exposed'
        FilePath:        '/workspaces/cheriot-rtos/sdk/core/loader/types.h'
        FileOffset:      10751
        Replacements:    []
      - Message:         '4/4 bytes exposed'
        FilePath:        '/workspaces/cheriot-rtos/sdk/core/loader/types.h'
        FileOffset:      16569
        Replacements:    []
      - Message:         '2/2 bytes exposed'
        FilePath:        '/workspaces/cheriot-rtos/sdk/core/loader/types.h'
        FileOffset:      17033
        Replacements:    []
      - Message:         'Field ''privilegedCompartments'' of type ''class (unnamed class at /workspaces/cheriot-rtos/sdk/core/loader/types.h:505:3)'' (size 120) requires 8 byte alignment for precise bounds; field offset is 34 (aligned to 2); Current bounds: 32-160'
        FilePath:        '/workspaces/cheriot-rtos/sdk/core/loader/types.h'
        FileOffset:      13868
        Replacements:    []
        Ranges:
          - FilePath:        '/workspaces/cheriot-rtos/sdk/core/loader/types.h'
            FileOffset:      13868
            Length:          1916
    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