[compiler-rt] [Sanitizers][Apple] Fix logic bugs that break RestrictMemoryToMaxAddress (PR #124712)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 29 12:40:56 PST 2025
================
@@ -1272,10 +1272,11 @@ uptr FindAvailableMemoryRange(uptr size, uptr alignment, uptr left_padding,
mach_msg_type_number_t count = kRegionInfoSize;
kr = mach_vm_region_recurse(mach_task_self(), &address, &vmsize, &depth,
(vm_region_info_t)&vminfo, &count);
- if (kr == KERN_INVALID_ADDRESS) {
+ if (kr == KERN_INVALID_ADDRESS || address > max_vm_address) {
----------------
thetruestblue wrote:
I dont know if this is the case. For this condition we simply finishing checking that iteration. A different return code would probably be more properly handled by not doing that. I also don't know if we would expect different kernel codes in other cases (entitlements?) I would rather do a follow up PR with this change.
https://github.com/llvm/llvm-project/pull/124712
More information about the llvm-commits
mailing list