Please test this patch: http://netbsd.org/~kamil/patch-00048-mmap-munmap-sanitizers.txt It works for me on amd64 and i386. I see no regressions in UBSan, ASan, TSan, MSan and libFuzzer. If this works for ARM and SPARC (and maybe others), I will switch all syscall(2)/__syscall(2) users to this approach (and refactor to deduplicate the code, check for MP issues, send upstream etc).
Attachment:
signature.asc
Description: OpenPGP digital signature