Update the boundries for mprotect.
Patch by Andrew Adams. Fixes PR30905.
Details
Details
Diff Detail
Diff Detail
- Build Status
Buildable 1021 Build 1021: arc lint + arc unit
Event Timeline
Comment Actions
Yes, this is clearly a bug. LGTM. Though looking back at it, perhaps the rounding to page size should happen in the caller of protectMappedMemory rather than in that function itself, but that's independent of the bug fix.
Comment Actions
Slight tweak here...
lib/Support/Unix/Memory.inc | ||
---|---|---|
158–161 | Instead of this, I would use alignAddr. It seems much easier to get correct: void *Start = alignAddr(M.Address - PageSize + 1, PageSize); void *End = alignAddr(M.Address + M.Size, PageSize); |
Comment Actions
Tested. I'll land in a couple of hours if there are no additional comments. Thanks Keno, Chandler and Andrew.
Instead of this, I would use alignAddr. It seems much easier to get correct: