Skip to content

fix: reject variable offsets that overflow uint32 bounds#2031

Open
SAY-5 wants to merge 1 commit into
cilium:mainfrom
SAY-5:fix-variable-offset-overflow
Open

fix: reject variable offsets that overflow uint32 bounds#2031
SAY-5 wants to merge 1 commit into
cilium:mainfrom
SAY-5:fix-variable-offset-overflow

Conversation

@SAY-5

@SAY-5 SAY-5 commented Jun 2, 2026

Copy link
Copy Markdown

A variable offset whose offset+size wraps around uint32 slips past the bounds checks in newVariable and checkUnsafeMemory, so VariablePointer indexes the backing slice out of range and panics. Both checks now use the existing overflow-safe Memory.bounds helper and return an error instead. Fixes #2028.

Signed-off-by: Sai Asish Y <say.apm35@gmail.com>
@SAY-5 SAY-5 requested a review from a team as a code owner June 2, 2026 20:42
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.

memory: VariablePointer can panic on malformed variable offset

1 participant