Skip to content

Comments

memory: fix off-by-one in bounds check#1694

Merged
ti-mo merged 1 commit intocilium:mainfrom
ti-mo:tb/memory-bounds-check
Feb 20, 2025
Merged

memory: fix off-by-one in bounds check#1694
ti-mo merged 1 commit intocilium:mainfrom
ti-mo:tb/memory-bounds-check

Conversation

@ti-mo
Copy link
Contributor

@ti-mo ti-mo commented Feb 20, 2025

It previously wasn't possible to access the last byte of the memory segment. Also add a u64 overflow check.

This wasn't caught in tests because this requires accessing a page-aligned variable in its entirety. Add a test with a page-aligned array Variable.

cc @mejedi

It previously wasn't possible to access the last byte of the memory segment.
Also add a u64 overflow check.

This wasn't caught in tests because this requires accessing a page-aligned
variable in its entirety. Add a test with a page-aligned array Variable.

Signed-off-by: Timo Beckers <[email protected]>
@ti-mo ti-mo requested a review from a team as a code owner February 20, 2025 11:36
@ti-mo ti-mo mentioned this pull request Feb 20, 2025
Copy link
Contributor

@mejedi mejedi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for making a fix.

@ti-mo ti-mo merged commit 061b77f into cilium:main Feb 20, 2025
18 checks passed
@ti-mo ti-mo deleted the tb/memory-bounds-check branch February 20, 2025 11:41
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.

2 participants