Skip to content

harden bounds checks and layout size validation in providers#627

Open
jmestwa-coder wants to merge 1 commit intoapache:trunkfrom
jmestwa-coder:slotmem-harden-bounds-and-layout-safety
Open

harden bounds checks and layout size validation in providers#627
jmestwa-coder wants to merge 1 commit intoapache:trunkfrom
jmestwa-coder:slotmem-harden-bounds-and-layout-safety

Conversation

@jmestwa-coder
Copy link
Copy Markdown

slotmem: harden bounds checks and layout size validation in providers

  • Add overflow-safe calculations for slot layout sizes to prevent under-allocation from integer wraparound.
  • Validate slot id before pointer arithmetic to avoid undefined behavior.
  • Enforce bounds on get/put so copy lengths cannot exceed slot size, and reject invalid buffers.
  • Fix out-of-bounds read in release-path logging when id is out of range.
  • Validate shared-memory segment size during attach before deriving internal pointers.
  • Apply these checks consistently across both shared-memory and plain slotmem providers.

These changes ensure slotmem operations stay within defined memory boundaries and handle invalid inputs safely, while preserving all valid existing behaviour.

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