FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix ARM64 UBSan pointer overflow in GetConstSegmentForCode by aravinth-kanesh · Pull Request #294 · polyml/polyml · GitHub

/ polyml Public

Fix ARM64 UBSan pointer overflow in GetConstSegmentForCode - #294

Open
aravinth-kanesh wants to merge 1 commit into
polyml:masterfrom
aravinth-kanesh:fix/arm64-const-segment-overflow
Open

Fix ARM64 UBSan pointer overflow in GetConstSegmentForCode#294
aravinth-kanesh wants to merge 1 commit into
polyml:masterfrom
aravinth-kanesh:fix/arm64-const-segment-overflow

Conversation

aravinth-kanesh commented Jul 17, 2026
edited
Loading

Copy link
Copy Markdown

Fixes #271.

Casts the divisor to POLYSIGNED so the negative offset isn't promoted to unsigned before the division. Without the cast, offset / sizeof(PolyWord) converts the negative offset to a large unsigned value and the resulting pointer addition overflows (UBSan: addition of unsigned offset overflowed).

Validated locally - both reproducers in #271 no longer trigger the UBSan violation.

Cast the divisor to POLYSIGNED so a negative offset is not promoted
to unsigned before the division. Without the cast, offset / sizeof(PolyWord)
converts the negative offset to a large unsigned value, and the resulting
pointer addition overflows (UBSan: addition of unsigned offset overflowed).

Fixes polyml#271.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

ARM64: UBSan pointer overflow in GetConstSegmentForCode (signed offset ÷ unsigned sizeof)

1 participant


Back | FazBrowse Home | New Git URL