[all-commits] [llvm/llvm-project] a08402: [sanitizer_common][fuchsia] Get correct vmar info

PiJoules via All-commits all-commits at lists.llvm.org
Fri Jan 12 19:10:18 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a08402f95bc785c124702b075904cc110128661f
      https://github.com/llvm/llvm-project/commit/a08402f95bc785c124702b075904cc110128661f
  Author: Leonard Chan <leonardchan at google.com>
  Date:   2024-01-12 (Fri, 12 Jan 2024)

  Changed paths:
    M compiler-rt/lib/sanitizer_common/sanitizer_fuchsia.cpp

  Log Message:
  -----------
  [sanitizer_common][fuchsia] Get correct vmar info

Forward fix for https://github.com/llvm/llvm-project/pull/75256

The process for MmapAlignedOrDieOnFatalError involves trimming the start
and end of a mapping to ensure it's aligned correctly. This invloves
calling zx_vmar_map again but overwriting a part of the original vmar
which involves a call to zx_object_get_info(ZX_INFO_VMAR). After
https://github.com/llvm/llvm-project/pull/75256, we unconditionally
called this on gSanitizerHeapVmar but this can lead to a
ZX_ERR_INVALID_ARGS if the prior mapping was on the root vmar.

This can be fixed by also returning the vmar we did the last mapping to
and using that for followup operations that specifically involve the
same vmar. This way we don't have to try each syscall for both vmars.




More information about the All-commits mailing list